Skip to content

Templates

A template defines the POST body sent to your API endpoint. You write the JSON structure using {{variables}} that get replaced with extracted page data at share time.

VariableDescription
{{title}}Page title
{{url}}Full page URL
{{content}}Main content in Markdown
{{author}}Page author (from meta tags)
{{published}}Published date
{{domain}}Domain name (e.g. github.com)
{{description}}Meta description
{{wordCount}}Word count of main content
{{date}}Current date (YYYY-MM-DD)
{{time}}Current time (HH:mm)
{{selection}}Selected text in Markdown
{{selectionHtml}}Selected text as raw HTML
{{image}}Primary image URL
{{favicon}}Site favicon URL
{{site}}Site name
{{fullHtml}}Complete page HTML
{{contentHtml}}Main content as HTML

You can extract specific elements from the page:

{{selector:h1.title}} → text content
{{selector:.author@href}} → attribute value
{{selector:.tag|list}} → all matches as array
{{selector:#content|markdown}} → converted to Markdown

Chain filters with | to transform values:

{{title|truncate:100}}
{{content|replace:foo:bar}}
{{url|split:/|last}}
{{published|date:YYYY-MM-DD}}
{{selector:.tags|list|join:, }}

Context Bro includes 50+ built-in filters.

Context Bro ships with 7 preset templates you can add with one click:

PresetTrigger PatternsUse Case
General PageDefault for any page
GitHub PR / Issuegithub.com/*/pull/*, github.com/*/issues/*GitHub PRs and issues
Stack Overflow Q&Astackoverflow.com/questions/*Questions with accepted answers
News Article*.reuters.com/*, *.bbc.com/*, etc.News sites
Reddit Post*.reddit.com/r/*/comments/*Reddit discussions
YouTube Videoyoutube.com/watch*, youtube.com/live*YouTube videos
Selection OnlyJust the selected text + source

To add a preset: Settings → Templates → “From preset…” dropdown.

Templates can have URL trigger patterns. When you share a page, Context Bro auto-selects the template whose trigger matches the current URL.

Patterns support wildcards:

github.com/*/pull/* → matches any GitHub PR
*.reddit.com/* → matches any Reddit page
stackoverflow.com/* → matches Stack Overflow
{
"type": "research",
"title": "{{title}}",
"url": "{{url}}",
"summary": "{{description}}",
"content": "{{content|truncate:5000}}",
"tags": "{{selector:meta[name='keywords']@content|split:,}}",
"capturedAt": "{{date}}T{{time}}:00Z"
}