added latest shortcode
parent
80137e504b
commit
77f4c0a58a
|
@ -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:
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{{- $product := .Get 0 -}}
|
||||
{{- $latestVersion := (index .Site.Data.products $product).latest -}}
|
||||
{{ $product }}/{{ $latestVersion }}
|
Loading…
Reference in New Issue