Tags
Learn about the powerful Statamic tags that come bundled.
#dok:outline
Displays outline navigation generated from the headings in your markdown file, allowing you to quickly hop between heading sections in your content.
{{ dok:outline markdown="{content | raw}" }}
<a href="#{{ id }}">{{ text }}</a>
{{ if children }}
{{ children }}
<a href="#{{ id }}">{{ text }}</a>
...
{{ /children }}
{{ /if }}
{{ /dok:outline }}
| Parameter | Description | Required |
|---|---|---|
markdown |
The raw, unprocessed markdown you want want the navigation to be based on. Eg. {{ markdown | raw }} |
✅ |
min |
The minimum number of headings before the component displays. |
#The project tag
The project tags give information about the project and its releases.
The project tags work by using the collection page variable, meaning you need to be on an entry route for it to work automatically. If you want to use these tags anywhere other than an entry, you must use the collection parameter.
{{ project:versions collection="my_documentation" }}
If you're inside nested tags that overwrite the collection variable, you can use the collection parameter to pass in the page scope collection.
{{ project:versions :collection="page:collection" }}
You shouldn't map the same collection to multiple releases. This tag works by finding the first release that contains the collection.
#project:entry
Gets the current project entry.
{{ project:entry }}
{{ title }}
{{ logo }}
<img src="{{ url }}" />
{{ /logo }}
{{ /project:entry }}
You can also pass in a wildcard to grab specific data from the entry. This is just syntax sugar for when you just need to get a single piece of data from the entry but don't want to use the full tag pair.
{{ project:entry:title }}
{{ project:entry:logo }}
<img src="{{ url }}" />
{{ /project:entry:logo }}
#project:stable:entry
You can set a stable release in the project entry. This tag returns the entry you set.
{{ project:stable:entry }}
<p>The stable version is {{ version }}</p>
{{ /project:stable:entry }}
You can also pass in a wildcard to grab specific data from the entry. This is just syntax sugar for when you just need to get a single piece of data from the entry but don't want to use the full tag pair.
Stable version is: {{ project:stable:entry:version }}
#project:stable:url
Returns the home URL for your stable release.
{{ project:stable:url }}
/docs/1.x
#project:versions
Gets all of the versions for the current project.
{{ project:versions }}
{{# Gets the version #}}
<p>{{ version }}</p>
{{# Gets the home URL #}}
<p>{{ url }}</p>
{{# Gets the label (beta, alpha, etc) #}}
<p>{{ label }}</p>
{{ /project:versions }}
An entry array is also available, allowing you to get any data that exists on that release entry.
{{ project:versions }}
{{ entry }}
{{ title }}
{{ /entry }}
{{ /project:versions }}
#project:versioned
Returns true or false depending on if the project has more than one version.
{{ if {project:versioned} }}
Stuff to display if the project has more than one version
{{ /if }}
#The release tag
The release tags give information on the current release.
The release tags work by using the collection page variable, meaning you need to be on an entry route for it to work automatically. If you want to use these tags anywhere other than an entry, you must use the collection parameter.
{{ release:version collection="my_documentation" }}
If you're inside nested tags that overwrite the collection variable, you can use the collection parameter to pass in the page scope collection.
{{ release:version :collection="page:collection" }}
You shouldn't map the same collection to multiple releases. This tag works by finding the first release that contains the collection.
#release:entry
Gets the current release entry data.
{{ release:entry }}
{{ title }}
{{ version_navigation }}
{{ version }}
{{ show_outdated_banner }}
{{ github_repository_url }}
{{ github_edit_url }}
{{ /release:entry }}
You can also pass in a wildcard to grab specific data from the entry. This is just syntax sugar for when you just need to get a single piece of data from the entry but don't want to use the full tag pair.
{{ release:entry:version }}
#release:nav:handle
Gets the handle for the the release navigation.
{{ release:nav:handle }}
#release:version
Gets the version for the the release.
{{ release:version }}
1.x
#release:outdated
Returns true or false depending on if the release is outdated.
{{ if {release:outdated} }}
This will show if the current release is outdated.
{{ /if }}
This works by looking at the show_outdated_banner field in your release entry.
#release:breadcrumbs
Returns an array of breadcrumbs based on the current release navigation.
{{ release:breadcrumbs }}
<span>
{{ title }}
{{ unless last }}
{{ svg src="arrow-right" aria-hidden="true" }}
{{ /unless }}
</span>
{{ /release:breadcrumbs }}
| Parameter | Description | Required |
|---|---|---|
prefix |
Prefix the breadcrumb list with a string of your choice. Eg Home |
|
prefix_single |
Uses the prefix only if there is one breadcrumb item. |