added latest shortcode

pull/1387/head
Scott Anderson 2020-08-19 13:53:38 -06:00
parent 80137e504b
commit 77f4c0a58a
2 changed files with 28 additions and 0 deletions

View File

@ -209,6 +209,31 @@ If all content in an article is OSS-specific, include `oss` in the `products` fr
products: [oss]
```
### Latest links
Each of the InfluxData projects have different "latest" versions.
Use the `{{< latest >}}` shortcode to populate link paths with the latest version
for the specified project.
```md
[Link to latest Telegraf](/{{< latest "telegraf" >}}/path/to/doc/)
```
`{{< latest "telegraf" >}}` is replaced with `telegraf/v1.15` (or whatever the latest version is).
Use the following for project names:
- influxdb
- telegraf
- chronograf
- kapacitor
- enterprise_influxdb
**Note**: Include a leading slash before the latest shortcode and a trailing slash after in all link paths:
```md
/{{< latest "influxdb" >}}/
```
### Tabbed Content
Shortcodes are available for creating "tabbed" content (content that is changed by a users' selection).
Ther following three must be used:

View File

@ -0,0 +1,3 @@
{{- $product := .Get 0 -}}
{{- $latestVersion := (index .Site.Data.products $product).latest -}}
{{ $product }}/{{ $latestVersion }}