This guide explains how to use the custom template feature of SmartURLs.
Templates are written in a single-line input field, but can produce multi-line output using the $nl token.
SmartURLs is intentionally lightweight. It never reads webpage contents and works only with the URL and browser tab information.
SmartURLs replaces tokens based strictly on tab metadata and the current URL.
| Token | Description | Example Output |
|---|---|---|
$title |
Page title shown in the tab | Why the Moon? |
$title(html) |
HTML-escaped page title (converts &, <, >, ", ' to entities). Safe for use in HTML tags/attributes. |
Rock & Roll <Best Hits>(for title: βRock & Roll <Best Hits>β) |
$url |
Full URL | https://www.youtube.com/watch?v=bmC-FwibsZg |
$domain |
Hostname only | www.youtube.com |
$path |
Path part of the URL | /watch |
$basename |
Last segment of the path | watch |
$idx |
Tab index (1-based) | 3 |
$date |
Local date (YYYY-MM-DD) | 2025-01-12 |
$time |
Local time (HH:MM:SS) | 14:03:55 |
$date(utc) |
UTC date | 2025-01-12 |
$time(utc) |
UTC time | 05:03:55 |
$nl |
Inserts a newline | (produces line breaks in output) |
β οΈ Note about
$nl: Only supported in Copy custom templates. Cannot be used in Open from text custom templates. If you want to reuse the same template for both Copy and Open, avoid$nlin the Open template or use Smart (auto-detect) mode instead.
β οΈ Note about
$title(html): Only supported in Copy custom templates. Open-from-text custom templates do not process this token. For Open templates, use$titleinstead.
To show how tokens expand, these examples use:
π Example Title
Why the Moon?
π Example URL
https://www.youtube.com/watch?v=bmC-FwibsZg
From this URL:
$domain β www.youtube.com$path β /watch$basename β watch$v (query parameter) β bmC-FwibsZgDates and times are examples; actual output depends on your system clock.
SmartURLs can extract query parameters directly from the URL.
π€ Syntax
$<param>
π Example URL
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
| Token | Output |
|---|---|
$v |
bmC-FwibsZg |
$t |
123 |
If a parameter does not exist, its value becomes an empty string.
β οΈ Note about Query Parameter Tokens: Query parameter tokens (for example
$v,$id,$tag, etc.) are evaluated only in Copy custom templates. They are not evaluated in Open-from-text custom templates, so do not use them in Open templates.
Conditional blocks allow templates to output certain text only if specific query parameters are present.
π€ Syntax
πΉ Single parameter
{{q=v: ... }}
πΈ Multiple parameters (AND condition)
{{q=v,t: ... }}
Inside a conditional block:
$v, $t, etc. expand normally$nl, $title, $domain also workelse is availableIf conditions are not met, the entire block is removed from output.
β οΈ Note about Conditional Blocks: Conditional blocks (for example ``) are available only in Copy custom templates. They do not work in Open-from-text custom templates. If you need flexible filtering when opening URLs, use the Smart (auto-detect) mode instead.
Templates are written as one line, but may output multiple lines via $nl.
Example URL and title used in this section:
π Title
Why the Moon?
π URL
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
$title$nl$url
π¬ Output
Why the Moon?
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
- [$title]($url)
π¬ Output
- [Why the Moon?](https://www.youtube.com/watch?v=bmC-FwibsZg&t=123)
π Template
{{q=v:Video ID: $v$nl}}$title$nl$url
π¬ Output
Video ID: bmC-FwibsZg
Why the Moon?
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
If v= is missing:
Why the Moon?
https://example.com/page
Based on the known YouTube thumbnail pattern:
https://img.youtube.com/vi/VIDEO_ID/maxresdefault.jpg
π Template
{{q=v:Thumbnail: https://img.youtube.com/vi/$v/maxresdefault.jpg$nl}}$title$nl$url
π¬ Output
Thumbnail: https://img.youtube.com/vi/bmC-FwibsZg/maxresdefault.jpg
Why the Moon?
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
{{q=v:$nl}}[$title]($url)
π¬ Output

[Why the Moon?](https://www.youtube.com/watch?v=bmC-FwibsZg&t=123)
π Template
{{q=t:Timestamp: $t sec$nl}}$title$nl$url
π¬ Output
Timestamp: 123 sec
Why the Moon?
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
{{q=v,t:Video: $v ($t sec)$nl}}$url
π¬ Output
Video: bmC-FwibsZg (123 sec)
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
[$domain] $path$nl$url
π¬ Output
[www.youtube.com] /watch
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
## $basename: $title$nl$url
π¬ Output
## watch: Why the Moon?
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
$title β $url
π¬ Output
Why the Moon? β https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
π Template
- [$title]($url) β $date $time
π¬ Output
- [Why the Moon?](https://www.youtube.com/watch?v=bmC-FwibsZg&t=123) β 2025-01-12 14:03:55
π Template
$title$nl$url$nl---$nl$domain
π¬ Output
Why the Moon?
https://www.youtube.com/watch?v=bmC-FwibsZg&t=123
---
www.youtube.com
SmartURLs intentionally stays simple.
β SmartURLs DOES NOT:
elseβοΈ SmartURLs ONLY uses:
This ensures consistent behavior across all websites.
These features are available in: SmartURLs v1.4.0 and later
For feature requests or questions, please open an issue here: