Use bool param when calling code-toggle

This commit is contained in:
Joe Mooring 2023-03-27 13:28:30 -07:00 committed by Joe Mooring
parent fb33bf59bd
commit 064896c06e
10 changed files with 33 additions and 35 deletions

View File

@ -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:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
disqusShortname = "yourDisqusShortname"
{{</ code-toggle >}}

View File

@ -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.
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
include_toc: true
show_comments: false
{{</ 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.
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
title ="Blog"
[[cascade]]
background = "yosemite.jpg"
@ -193,7 +193,7 @@ Any of the above can be omitted.
In `content/blog/_index.md`
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
title: Blog
cascade:
banner: images/typewriter.jpg

View File

@ -139,7 +139,7 @@ params
### Resources metadata example
{{< code-toggle copy="false">}}
{{< code-toggle copy=false >}}
title: Application
date : 2018-01-25
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:
{{< code-toggle copy="false">}}
{{< code-toggle copy=false >}}
[[resources]]
src = "*specs.pdf"
title = "Specification #:counter"

View File

@ -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
multi-language site:
{{< code-toggle copy="false" file="config" >}}
{{< code-toggle copy=false file="config" >}}
staticDir = ["static1", "static2"]
[languages]

View File

@ -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:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
[taxonomies]
tag = "tags"
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:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
disableKinds = ["taxonomy","term"]
{{</ 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_.
{{% /note %}}
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
[taxonomies]
tag = "tags"
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].
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
[taxonomies]
tag = "tags"
{{</ code-toggle >}}
@ -156,7 +156,7 @@ If you would like the ability to quickly generate content files with preconfigur
### Example: Front Matter with Taxonomies
{{< code-toggle copy="false">}}
{{< code-toggle copy=false >}}
title = "Hugo: A fast and flexible static site generator"
tags = [ "Development", "Go", "fast", "Blogging" ]
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`
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
title = "foo"
tags = [ "a", "b", "c" ]
tags_weight = 22

View File

@ -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.
{{< 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'
slug = 'my-first-post'
{{< /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:
{{< 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'
url = '/articles/my-first-article'
{{< /code-toggle >}}
@ -59,7 +59,7 @@ https://example.org/articles/my-first-article/
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'
url = '/articles/my-first-article.html'
{{< /code-toggle >}}
@ -111,7 +111,7 @@ content/
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/'
{{< /code-toggle >}}
@ -133,7 +133,7 @@ public/
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/'
{{< /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:
{{< code-toggle file="config" copy="false" >}}
{{< code-toggle file="config" copy=false >}}
'tags' = '/:title/'
{{< /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
{{< code-toggle file="config" copy="false" >}}
{{< code-toggle file="config" copy=false >}}
permalinks:
posts: /:06/:1/:2/:title/
{{< /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:
{{< code-toggle file="config" copy="false" >}}
{{< code-toggle file="config" copy=false >}}
uglyURLs = true
{{< /code-toggle >}}
@ -239,7 +239,7 @@ This is an imperfect, brute force approach that can affect content as well as HT
To enable:
{{< code-toggle file="config" copy="false" >}}
{{< code-toggle file="config" copy=false >}}
canonifyURLs = true
{{< /code-toggle >}}
@ -262,7 +262,7 @@ This is an imperfect, brute force approach that can affect content as well as HT
To enable:
{{< code-toggle file="config" copy="false" >}}
{{< code-toggle file="config" copy=false >}}
relativeURLs = true
{{< /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:
{{< 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']
{{< /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:
{{< 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']
{{< /code-toggle >}}
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']
{{< /code-toggle >}}

View File

@ -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:
{{< code file="delimit-example-front-matter.toml" nocopy="true" >}}
+++
title: I love Delimit
{{< code-toggle file="content/about.md" copy=false fm=true >}}
title: About
tags: [ "tag1", "tag2", "tag3" ]
+++
{{< /code >}}
{{< /code-toggle >}}
{{< code file="delimit-page-tags-input.html" >}}
<p>Tags: {{ delimit .Params.tags ", " }}</p>

View File

@ -649,13 +649,13 @@ To exclude specific files from the `content` and `data` directories when renderi
To ignore files ending with `.foo` or `.boo`:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
ignoreFiles = ['\.foo$', '\.boo$']
{{< /code-toggle >}}
To ignore a file using the absolute file path:
{{< code-toggle copy="false" >}}
{{< code-toggle copy=false >}}
ignoreFiles = ['^/home/user/project/content/test\.md$']
{{< /code-toggle >}}

View File

@ -624,7 +624,7 @@ content/
└── 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'
date = 2021-12-06T10:37:16-08:00
draft = false