mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 15:24:47 -04:00
Use bool param when calling code-toggle
This commit is contained in:
parent
fb33bf59bd
commit
064896c06e
@ -25,7 +25,7 @@ Hugo comes with all the code you need to load Disqus into your templates. Before
|
|||||||
|
|
||||||
Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
|
Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
disqusShortname = "yourDisqusShortname"
|
disqusShortname = "yourDisqusShortname"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ You can add fields to your front matter arbitrarily to meet your needs. These us
|
|||||||
|
|
||||||
The following fields can be accessed via `.Params.include_toc` and `.Params.show_comments`, respectively. The [Variables] section provides more information on using Hugo's page- and site-level variables in your templates.
|
The following fields can be accessed via `.Params.include_toc` and `.Params.show_comments`, respectively. The [Variables] section provides more information on using Hugo's page- and site-level variables in your templates.
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
include_toc: true
|
include_toc: true
|
||||||
show_comments: false
|
show_comments: false
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
@ -159,7 +159,7 @@ Any node or section can pass down to descendants a set of Front Matter values as
|
|||||||
|
|
||||||
The `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
|
The `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
title ="Blog"
|
title ="Blog"
|
||||||
[[cascade]]
|
[[cascade]]
|
||||||
background = "yosemite.jpg"
|
background = "yosemite.jpg"
|
||||||
@ -193,7 +193,7 @@ Any of the above can be omitted.
|
|||||||
|
|
||||||
In `content/blog/_index.md`
|
In `content/blog/_index.md`
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
title: Blog
|
title: Blog
|
||||||
cascade:
|
cascade:
|
||||||
banner: images/typewriter.jpg
|
banner: images/typewriter.jpg
|
||||||
|
@ -139,7 +139,7 @@ params
|
|||||||
|
|
||||||
### Resources metadata example
|
### Resources metadata example
|
||||||
|
|
||||||
{{< code-toggle copy="false">}}
|
{{< code-toggle copy=false >}}
|
||||||
title: Application
|
title: Application
|
||||||
date : 2018-01-25
|
date : 2018-01-25
|
||||||
resources :
|
resources :
|
||||||
@ -185,7 +185,7 @@ The counter starts at 1 the first time they are used in either `name` or `title`
|
|||||||
|
|
||||||
For example, if a bundle has the resources `photo_specs.pdf`, `other_specs.pdf`, `guide.pdf` and `checklist.pdf`, and the front matter has specified the `resources` as:
|
For example, if a bundle has the resources `photo_specs.pdf`, `other_specs.pdf`, `guide.pdf` and `checklist.pdf`, and the front matter has specified the `resources` as:
|
||||||
|
|
||||||
{{< code-toggle copy="false">}}
|
{{< code-toggle copy=false >}}
|
||||||
[[resources]]
|
[[resources]]
|
||||||
src = "*specs.pdf"
|
src = "*specs.pdf"
|
||||||
title = "Specification #:counter"
|
title = "Specification #:counter"
|
||||||
|
@ -28,7 +28,7 @@ This union filesystem will be served from your site root. So a file
|
|||||||
Here's an example of setting `staticDir` and `staticDir2` for a
|
Here's an example of setting `staticDir` and `staticDir2` for a
|
||||||
multi-language site:
|
multi-language site:
|
||||||
|
|
||||||
{{< code-toggle copy="false" file="config" >}}
|
{{< code-toggle copy=false file="config" >}}
|
||||||
staticDir = ["static1", "static2"]
|
staticDir = ["static1", "static2"]
|
||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
|
@ -83,7 +83,7 @@ Hugo natively supports taxonomies.
|
|||||||
|
|
||||||
Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
|
Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
category = "categories"
|
category = "categories"
|
||||||
@ -91,7 +91,7 @@ Without adding a single line to your [site config][config] file, Hugo will autom
|
|||||||
|
|
||||||
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
|
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
disableKinds = ["taxonomy","term"]
|
disableKinds = ["taxonomy","term"]
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ Custom taxonomies other than the [defaults](#default-taxonomies) must be defined
|
|||||||
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
category = "categories"
|
category = "categories"
|
||||||
@ -125,7 +125,7 @@ While adding custom taxonomies, you need to put in the default taxonomies too, _
|
|||||||
|
|
||||||
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
|
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
@ -156,7 +156,7 @@ If you would like the ability to quickly generate content files with preconfigur
|
|||||||
|
|
||||||
### Example: Front Matter with Taxonomies
|
### Example: Front Matter with Taxonomies
|
||||||
|
|
||||||
{{< code-toggle copy="false">}}
|
{{< code-toggle copy=false >}}
|
||||||
title = "Hugo: A fast and flexible static site generator"
|
title = "Hugo: A fast and flexible static site generator"
|
||||||
tags = [ "Development", "Go", "fast", "Blogging" ]
|
tags = [ "Development", "Go", "fast", "Blogging" ]
|
||||||
categories = [ "Development" ]
|
categories = [ "Development" ]
|
||||||
@ -173,7 +173,7 @@ The following show a piece of content that has a weight of 22, which can be used
|
|||||||
|
|
||||||
### Example: Taxonomic `weight`
|
### Example: Taxonomic `weight`
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
title = "foo"
|
title = "foo"
|
||||||
tags = [ "a", "b", "c" ]
|
tags = [ "a", "b", "c" ]
|
||||||
tags_weight = 22
|
tags_weight = 22
|
||||||
|
@ -29,7 +29,7 @@ You can change the structure and appearance of URLs with front matter values and
|
|||||||
|
|
||||||
Set the `slug` in front matter to override the last segment of the path. The `slug` value does not affect section pages.
|
Set the `slug` in front matter to override the last segment of the path. The `slug` value does not affect section pages.
|
||||||
|
|
||||||
{{< code-toggle file="content/posts/post-1.md" copy="false" fm=true >}}
|
{{< code-toggle file="content/posts/post-1.md" copy=false fm=true >}}
|
||||||
title = 'My First Post'
|
title = 'My First Post'
|
||||||
slug = 'my-first-post'
|
slug = 'my-first-post'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
@ -46,7 +46,7 @@ Set the `url` in front matter to override the entire path. Use this with either
|
|||||||
|
|
||||||
With this front matter:
|
With this front matter:
|
||||||
|
|
||||||
{{< code-toggle file="content/posts/post-1.md" copy="false" fm=true >}}
|
{{< code-toggle file="content/posts/post-1.md" copy=false fm=true >}}
|
||||||
title = 'My First Article'
|
title = 'My First Article'
|
||||||
url = '/articles/my-first-article'
|
url = '/articles/my-first-article'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
@ -59,7 +59,7 @@ https://example.org/articles/my-first-article/
|
|||||||
|
|
||||||
If you include a file extension:
|
If you include a file extension:
|
||||||
|
|
||||||
{{< code-toggle file="content/posts/post-1.md" copy="false" fm=true >}}
|
{{< code-toggle file="content/posts/post-1.md" copy=false fm=true >}}
|
||||||
title = 'My First Article'
|
title = 'My First Article'
|
||||||
url = '/articles/my-first-article.html'
|
url = '/articles/my-first-article.html'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
@ -111,7 +111,7 @@ content/
|
|||||||
|
|
||||||
Create a date-based hierarchy, recursively, for regular pages within the `posts` section:
|
Create a date-based hierarchy, recursively, for regular pages within the `posts` section:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
posts = '/posts/:year/:month/:title/'
|
posts = '/posts/:year/:month/:title/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ public/
|
|||||||
|
|
||||||
To create a date-based hierarchy for regular pages in the content root:
|
To create a date-based hierarchy for regular pages in the content root:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
'/' = '/:year/:month/:title/'
|
'/' = '/:year/:month/:title/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ A URL pattern defined for the content root is not recursive.
|
|||||||
|
|
||||||
Use the same approach with taxonomies. For example, to omit the taxonomy segment of the URL:
|
Use the same approach with taxonomies. For example, to omit the taxonomy segment of the URL:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
'tags' = '/:title/'
|
'tags' = '/:title/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ For time-related values, you can also use the layout string components defined i
|
|||||||
|
|
||||||
[time package]: https://pkg.go.dev/time#pkg-constants
|
[time package]: https://pkg.go.dev/time#pkg-constants
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
permalinks:
|
permalinks:
|
||||||
posts: /:06/:1/:2/:title/
|
posts: /:06/:1/:2/:title/
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
@ -212,7 +212,7 @@ pretty|content/about.md|`https://example.org/about/`
|
|||||||
|
|
||||||
By default, Hugo produces pretty URLs. To generate ugly URLs, change your site configuration:
|
By default, Hugo produces pretty URLs. To generate ugly URLs, change your site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
uglyURLs = true
|
uglyURLs = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ This is an imperfect, brute force approach that can affect content as well as HT
|
|||||||
|
|
||||||
To enable:
|
To enable:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
canonifyURLs = true
|
canonifyURLs = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ This is an imperfect, brute force approach that can affect content as well as HT
|
|||||||
|
|
||||||
To enable:
|
To enable:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy="false" >}}
|
{{< code-toggle file="config" copy=false >}}
|
||||||
relativeURLs = true
|
relativeURLs = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ Create redirects from old URLs to new URLs with aliases:
|
|||||||
|
|
||||||
Change the file name of an existing page, and create an alias from the previous URL to the new URL:
|
Change the file name of an existing page, and create an alias from the previous URL to the new URL:
|
||||||
|
|
||||||
{{< code-toggle file="content/posts/new-file-name.md" copy="false" >}}
|
{{< code-toggle file="content/posts/new-file-name.md" copy=false >}}
|
||||||
aliases = ['/posts/previous-file-name']
|
aliases = ['/posts/previous-file-name']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
@ -289,13 +289,13 @@ Each of these directory-relative aliases is equivalent to the site-relative alia
|
|||||||
|
|
||||||
You can create more than one alias to the current page:
|
You can create more than one alias to the current page:
|
||||||
|
|
||||||
{{< code-toggle file="content/posts/new-file-name.md" copy="false" >}}
|
{{< code-toggle file="content/posts/new-file-name.md" copy=false >}}
|
||||||
aliases = ['previous-file-name','original-file-name']
|
aliases = ['previous-file-name','original-file-name']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
In a multilingual site, use a directory-relative alias, or include the language prefix with a site-relative alias:
|
In a multilingual site, use a directory-relative alias, or include the language prefix with a site-relative alias:
|
||||||
|
|
||||||
{{< code-toggle file="content/posts/new-file-name.de.md" copy="false" >}}
|
{{< code-toggle file="content/posts/new-file-name.de.md" copy=false >}}
|
||||||
aliases = ['/de/posts/previous-file-name']
|
aliases = ['/de/posts/previous-file-name']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -31,12 +31,10 @@ To maintain a consistent output order, maps will be sorted by keys and only a sl
|
|||||||
|
|
||||||
The examples of `delimit` that follow all use the same front matter:
|
The examples of `delimit` that follow all use the same front matter:
|
||||||
|
|
||||||
{{< code file="delimit-example-front-matter.toml" nocopy="true" >}}
|
{{< code-toggle file="content/about.md" copy=false fm=true >}}
|
||||||
+++
|
title: About
|
||||||
title: I love Delimit
|
|
||||||
tags: [ "tag1", "tag2", "tag3" ]
|
tags: [ "tag1", "tag2", "tag3" ]
|
||||||
+++
|
{{< /code-toggle >}}
|
||||||
{{< /code >}}
|
|
||||||
|
|
||||||
{{< code file="delimit-page-tags-input.html" >}}
|
{{< code file="delimit-page-tags-input.html" >}}
|
||||||
<p>Tags: {{ delimit .Params.tags ", " }}</p>
|
<p>Tags: {{ delimit .Params.tags ", " }}</p>
|
||||||
|
@ -19,7 +19,7 @@ relatedfuncs: []
|
|||||||
|
|
||||||
The following examples pull from a content file with the following front matter:
|
The following examples pull from a content file with the following front matter:
|
||||||
|
|
||||||
{{< code file="content/blog/greatest-city.md" copy="false">}}
|
{{< code file="content/blog/greatest-city.md" copy="false" >}}
|
||||||
+++
|
+++
|
||||||
title = "The World's Greatest City"
|
title = "The World's Greatest City"
|
||||||
location = "Chicago IL"
|
location = "Chicago IL"
|
||||||
|
@ -649,13 +649,13 @@ To exclude specific files from the `content` and `data` directories when renderi
|
|||||||
|
|
||||||
To ignore files ending with `.foo` or `.boo`:
|
To ignore files ending with `.foo` or `.boo`:
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
ignoreFiles = ['\.foo$', '\.boo$']
|
ignoreFiles = ['\.foo$', '\.boo$']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
To ignore a file using the absolute file path:
|
To ignore a file using the absolute file path:
|
||||||
|
|
||||||
{{< code-toggle copy="false" >}}
|
{{< code-toggle copy=false >}}
|
||||||
ignoreFiles = ['^/home/user/project/content/test\.md$']
|
ignoreFiles = ['^/home/user/project/content/test\.md$']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ content/
|
|||||||
└── event-3.md
|
└── event-3.md
|
||||||
```
|
```
|
||||||
|
|
||||||
{{< code-toggle file="content/events/event-1.md" copy="false" >}}
|
{{< code-toggle file="content/events/event-1.md" copy=false >}}
|
||||||
title = 'Event 1'
|
title = 'Event 1'
|
||||||
date = 2021-12-06T10:37:16-08:00
|
date = 2021-12-06T10:37:16-08:00
|
||||||
draft = false
|
draft = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user