Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekblog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@geeklabor.de>2022-01-11 01:36:39 +0300
committerGitHub <noreply@github.com>2022-01-11 01:36:39 +0300
commit8b10c81053687b9e855af0f650956d694ce18c24 (patch)
tree280726755b23e8cbc19dd7dd75a61311987f622c /exampleSite
parent1a4ce2b0ec19d195c70d11654e229c7e6bf6bdeb (diff)
docs: document how to use different type in include shortcode (#146)
Diffstat (limited to 'exampleSite')
-rw-r--r--exampleSite/content/_includes/include-page.md10
-rw-r--r--exampleSite/content/posts/advanced/includes.md40
2 files changed, 31 insertions, 19 deletions
diff --git a/exampleSite/content/_includes/include-page.md b/exampleSite/content/_includes/include-page.md
new file mode 100644
index 0000000..bfc0534
--- /dev/null
+++ b/exampleSite/content/_includes/include-page.md
@@ -0,0 +1,10 @@
+_**Example page include**_
+
+{{< hint info >}}
+**Example Shortcode**\
+Shortcode used in an include page.
+{{< /hint >}}
+
+| Head 1 | Head 2 | Head 3 |
+| ------ | ------ | ------ |
+| 1 | 2 | 3 |
diff --git a/exampleSite/content/posts/advanced/includes.md b/exampleSite/content/posts/advanced/includes.md
index 2fab9ea..9801b7d 100644
--- a/exampleSite/content/posts/advanced/includes.md
+++ b/exampleSite/content/posts/advanced/includes.md
@@ -14,22 +14,20 @@ Include shortcode can include files of different types. By specifying a language
{{< toc >}}
-## Usage
-
<!-- prettier-ignore-start -->
```tpl
-{{</* include file="relative/path/from/hugo/root" language="go" markdown=[false|true] */>}}
+{{</* include file="relative/path/from/hugo/root" language="go" */>}}
```
<!-- prettier-ignore-end -->
-### Attributes
+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
@@ -42,11 +40,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 >}}
-<!-- prettier-ignore-start -->
+<!-- prettier-ignore -->
```tpl
{{</* include file="/static/_includes/example.md.part" */>}}
```
-<!-- prettier-ignore-end -->
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
@@ -58,17 +55,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.
-<!-- prettier-ignore-start -->
+<!-- prettier-ignore -->
```tpl
{{</* include file="config.yaml" language="yaml" options="linenos=table,hl_lines=5-6,linenostart=100" */>}}
```
-<!-- prettier-ignore-end -->
-**Code Include:**
+Result:
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
-{{< 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" >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
@@ -78,11 +74,10 @@ This method can be used to include source code files and keep them automatically
HTML content will be filtered by the `safeHTML` filter and added to the rendered page output.
-<!-- prettier-ignore-start -->
+<!-- prettier-ignore -->
```tpl
-{{</* include file="/static/_includes/example.html.part" */>}}
+{{</* include file="/static/_includes/example.html.part" type="html" */>}}
```
-<!-- prettier-ignore-end -->
{{< include file="/static/_includes/example.html.part" type="html" >}}
@@ -102,4 +97,11 @@ _includes/
└── _index.md
```
+Specify the page include:
+
+<!-- prettier-ignore -->
+```tpl
+{{</* include file="/_includes/include-page.md" type="page" */>}}
+```
+
{{< include file="/_includes/include-page.md" type="page" >}}