Add support for boilerplate text. (#3005)

This commit is contained in:
Martin Taillefer 2018-12-23 07:46:24 -08:00 committed by GitHub
parent 2c692e2a0b
commit b22c30f127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 0 deletions

View File

@ -539,6 +539,7 @@ webhook
Keycloak
OpenID
Istioctl
Boilerplates
- search.md
searchresults

View File

@ -0,0 +1,2 @@
This is some boilerplate *markdown* _text_.

View File

@ -65,6 +65,11 @@ is the best fit for your content:
</tr>
</table>
### About blog posts
The Istio blog is intended to contain authoritative posts regarding Istio and technologies or products related to
Istio. We generally do not publish user or enthusiast posts about using Istio.
## Naming a topic
Choose a title for your topic that has the keywords you want search engines to find.
@ -433,6 +438,22 @@ will use when the user chooses to download the file. For example:
If you don't specify the `downloadas` attribute, then the download name is taken from the `url`
attribute instead.
## Embedding boilerplate text
You can embed common boilerplate text into any markdown output using the `boilerplate` sequence:
{{< text markdown >}}
{{</* boilerplate example */>}}
{{< /text >}}
which results in:
{{< boilerplate example >}}
You supply the name of a boilerplate file to insert at the current location. Boilerplates are
located in language-specific subdirectories of the `boilerplates` directory. Boilerplates are just
normal markdown files.
## Using tabs
If you have some content to display in a variety of formats, it is convenient to use a tab set and display each

View File

@ -0,0 +1,4 @@
{{- /* Inserts a boilerplate markdown file into the document. See https://preliminary.istio.io/about/contribute/writing-a-new-topic/#embedding-boilerplate-text for details */ -}}
{{- $path := printf "boilerplates/%s/%s.md" .Site.Language.Lang (.Get 0) -}}
{{- $markdown := readFile $path -}}
{{- markdownify $markdown }}