From e9a07f78d27dd78c3286facb45a949a6cd6efd45 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 10 Jan 2022 23:36:20 +0100 Subject: [PATCH] docs: document how to use different type in include shortcode (#275) --- exampleSite/content/shortcodes/includes.md | 34 ++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/exampleSite/content/shortcodes/includes.md b/exampleSite/content/shortcodes/includes.md index 07b5c51..8ff734d 100644 --- a/exampleSite/content/shortcodes/includes.md +++ b/exampleSite/content/shortcodes/includes.md @@ -8,18 +8,18 @@ Include shortcode can include files of different types. By specifying a language ```tpl -{{}} +{{}} ``` Attributes: -| Name | Usage | default | -| -------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------- | -| file | path to the included file relative to the Hugo root | undefined | -| language | language for [syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages) | undefined | -| type | special include type (`html,page`) | undefined | -| options | highlighting [options](https://gohugo.io/content-management/syntax-highlighting/#highlight-shortcode) | `linenos=table` | +| Name | Usage | default | +| -------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | +| file | path to the included file relative to the Hugo root | undefined | +| language | language for [syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages) | undefined | +| type | special include type (`html,page`) | undefined (rendered as markdown) | +| options | highlighting [options](https://gohugo.io/content-management/syntax-highlighting/#highlight-shortcode) | `linenos=table` | ## Examples @@ -32,11 +32,10 @@ If no other options are specified, files will be rendered as Markdown using the If you include markdown files that should not get a menu entry, place them outside the content folder or exclude them otherwise. {{< /hint >}} - + ```tpl {{}} ``` - @@ -48,17 +47,16 @@ If you include markdown files that should not get a menu entry, place them outsi This method can be used to include source code files and keep them automatically up to date. - + ```tpl {{}} ``` - Result: -{{< include file="config.yaml" language="yaml" options="linenos=table,hl_lines=5-6,linenostart=100">}} +{{< include file="config.yaml" language="yaml" options="linenos=table,hl_lines=5-6,linenostart=100" >}} @@ -68,11 +66,10 @@ Result: HTML content will be filtered by the `safeHTML` filter and added to the rendered page output. - + ```tpl -{{}} +{{}} ``` - {{< include file="/static/_includes/example.html.part" type="html" >}} @@ -93,4 +90,11 @@ _includes/ └── _index.md ``` +Specify the page include: + + +```tpl +{{}} +``` + {{< include file="/_includes/include-page.md" type="page" >}}