diff --git a/content/en/content-management/shortcodes.md b/content/en/content-management/shortcodes.md index d240c8693..2b19d3c6b 100644 --- a/content/en/content-management/shortcodes.md +++ b/content/en/content-management/shortcodes.md @@ -152,17 +152,17 @@ Include this in your markdown: This will display all files in the gist alphabetically by file name. -{{< gist jmooring 50a7482715eac222e230d1e64dd9a89b >}} +{{< gist jmooring 23932424365401ffa5e9d9810102a477 >}} To display a specific file within the gist: ```text -{{* gist user 50a7482715eac222e230d1e64dd9a89b 1-template.html */>}} +{{* gist user 23932424365401ffa5e9d9810102a477 list.html */>}} ``` Rendered: -{{< gist jmooring 50a7482715eac222e230d1e64dd9a89b 1-template.html >}} +{{< gist jmooring 23932424365401ffa5e9d9810102a477 list.html >}} ### `highlight` diff --git a/content/en/functions/hugo/Environment.md b/content/en/functions/hugo/Environment.md index f17a1e603..f130de787 100644 --- a/content/en/functions/hugo/Environment.md +++ b/content/en/functions/hugo/Environment.md @@ -5,7 +5,9 @@ categories: [] keywords: [] action: aliases: [] - related: [] + related: + - functions/hugo/IsDevelopment + - functions/hugo/IsProduction returnType: string signatures: [hugo.Environment] --- diff --git a/content/en/functions/hugo/IsDevelopment.md b/content/en/functions/hugo/IsDevelopment.md index 1db33a7aa..9926b67c9 100644 --- a/content/en/functions/hugo/IsDevelopment.md +++ b/content/en/functions/hugo/IsDevelopment.md @@ -5,7 +5,9 @@ categories: [] keywords: [] action: aliases: [] - related: [] + related: + - functions/hugo/IsProduction + - functions/hugo/Environment returnType: bool signatures: [hugo.IsDevelopment] --- diff --git a/content/en/functions/hugo/IsProduction.md b/content/en/functions/hugo/IsProduction.md index 77945f1a0..7e9bda0e3 100644 --- a/content/en/functions/hugo/IsProduction.md +++ b/content/en/functions/hugo/IsProduction.md @@ -5,7 +5,9 @@ categories: [] keywords: [] action: aliases: [] - related: [] + related: + - functions/hugo/IsDevelopment + - functions/hugo/Environment returnType: bool signatures: [hugo.IsProduction] --- diff --git a/content/en/methods/duration/Minutes.md b/content/en/methods/duration/Minutes.md index 764ef9208..d3e57fba5 100644 --- a/content/en/methods/duration/Minutes.md +++ b/content/en/methods/duration/Minutes.md @@ -13,5 +13,5 @@ action: ```go-html-template {{ $d = time.ParseDuration "3.5h2.5m1.5s" }} -{{ $d.Nanoseconds }} → 212.525 +{{ $d.Minutes }} → 212.525 ``` diff --git a/content/en/methods/page/Fragments.md b/content/en/methods/page/Fragments.md index 1b5b1731f..84bf312ef 100644 --- a/content/en/methods/page/Fragments.md +++ b/content/en/methods/page/Fragments.md @@ -46,14 +46,14 @@ Identifiers
{{ .Fragments.Identifiers | jsonify (dict "indent" " ") }}``` -Identifiers.Contains -: (`bool`) Reports whether one or more headings on the page has the given `id`, useful for validating fragments within a link [render hook]. +Identifiers.Contains ID +: (`bool`) Reports whether one or more headings on the page has the given `id` attribute, useful for validating fragments within a link [render hook]. ```go-html-template {{ .Fragments.Identifiers.Contains "section-2" }} → true ``` -Identifiers.Count +Identifiers.Count ID : (`int`) The number of headings on a page with the given `id` attribute, useful for detecting duplicates. ```go-html-template diff --git a/content/en/methods/page/Title.md b/content/en/methods/page/Title.md index d21cc1110..52e46ff44 100644 --- a/content/en/methods/page/Title.md +++ b/content/en/methods/page/Title.md @@ -10,7 +10,7 @@ action: signatures: [PAGE.Title] --- -For pages backed by a file, the `Title` method returns the `title` field in front matter. For section pages that are automatically generated, the `Title` method returns the section name. +With pages backed by a file, the `Title` method returns the `title` field as defined in front matter: {{< code-toggle file=content/about.md fm=true >}} title = 'About us' @@ -20,4 +20,19 @@ title = 'About us' {{ .Title }} → About us ``` -With automatic section pages, the title is capitalized by default, using the `titleCaseStyle` defined in your site configuration. To disable this behavior, set `pluralizeListTitles` to `false` in your site configuration. +With section pages not backed by a file, the `Title` method returns the section name, pluralized and converted to title case. + +To disable [pluralization]: + +{{< code-toggle file=hugo >}} +pluralizeListTitles = false +{{< /code-toggle >}} + +To change the [title case style], specify one of `ap`, `chicago`, `go`, `firstupper`, or `none`: + +{{< code-toggle file=hugo >}} +titleCaseStyle = "ap" +{{< /code-toggle >}} + +[pluralization]: /functions/inflect/pluralize +[title case style]: /getting-started/configuration/#configure-title-case diff --git a/content/en/methods/shortcode/IsNamedParams.md b/content/en/methods/shortcode/IsNamedParams.md index 1eadf6653..83eeb2f74 100644 --- a/content/en/methods/shortcode/IsNamedParams.md +++ b/content/en/methods/shortcode/IsNamedParams.md @@ -1,6 +1,6 @@ --- title: IsNamedParams -description: Reports whether the shortcode call specifies named or positional parameters. +description: Reports whether the shortcode call uses named parameters. categories: [] keywords: [] action: diff --git a/content/en/methods/site/Param.md b/content/en/methods/site/Param.md new file mode 100644 index 000000000..f39a17675 --- /dev/null +++ b/content/en/methods/site/Param.md @@ -0,0 +1,29 @@ +--- +title: Param +description: Returns the site parameter with the given key. +categories: [] +keywords: [] +action: + related: [] + returnType: any + signatures: [SITE.Param KEY] +--- + +The `Param` method on a `Site` object is a convenience method to return the value of a user-defined parameter in the site configuration. + +{{< code-toggle file=hugo >}} +[params] +display_toc = true +{{< /code-toggle >}} + + +```go-html-template +{{ .Site.Param "display_toc" }} → true +``` + +The above is equivalent to either of these: + +```go-html-template +{{ .Site.Params.display_toc }} +{{ index .Site.Params "display_toc: }} +``` diff --git a/content/en/templates/shortcode-templates.md b/content/en/templates/shortcode-templates.md index 0099332ab..4606369b6 100644 --- a/content/en/templates/shortcode-templates.md +++ b/content/en/templates/shortcode-templates.md @@ -365,10 +365,6 @@ When the above fails, you will see an `ERROR` log similar to the below: ERROR 2018/11/07 10:05:55 missing value for parameter name: "/Users/bep/dev/go/gohugoio/hugo/docs/content/en/variables/shortcodes.md:32:1" ``` -## More shortcode examples - -More shortcode examples can be found in the [shortcodes directory for spf13.com][spfscs] and the [shortcodes directory for the Hugo docs][docsshortcodes]. - ## Inline shortcodes You can also implement your shortcodes inline -- e.g. where you use them in the content file. This can be useful for scripting that you only need in one place.