diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index 51f78a0d4..0421991a4 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -213,7 +213,7 @@ copy : (`bool`) Whether to display a copy-to-clipboard button. Default is `false`. file -: (`string`) The file name to display. +: (`string`) The file name to display above the rendered code. lang : (`string`) The code language. If you do not provide a `lang` argument, the code language is determined by the file extension. If the file extension is `html`, sets the code language to `go-html-template`. Default is `text`. @@ -233,11 +233,14 @@ config copy : (`bool`) Whether to display a copy-to-clipboard button. Default is `false`. +datakey: +: (`string`) The section of `site.Data.docs` to render. + file -: (`string`) The file name to display. Omit the file extension for site configuration examples. +: (`string`) The file name to display above the rendered code. Omit the file extension for site configuration examples. fm -: (`bool`) Whether the example is front matter. Default is `false`. +: (`bool`) Whether to render the code as front matter. Default is `false`. skipHeader : (`bool`) Whether to omit top-level key(s) when rendering a section of `site.Data.docs.config`. diff --git a/layouts/shortcodes/code-toggle.html b/layouts/shortcodes/code-toggle.html index 6e6185b5a..1b2c82df9 100644 --- a/layouts/shortcodes/code-toggle.html +++ b/layouts/shortcodes/code-toggle.html @@ -3,11 +3,11 @@ Renders syntax-highlighted configuration data in JSON, TOML, and YAML formats. @param {string} [config] The section of site.Data.docs.config to render. -@param {bool} [copy=false] If true, display a copy to clipboard button. +@param {bool} [copy=false] Whether to display a copy-to-clipboard button. @param {string} [dataKey] The section of site.Data.docs to render. @param {string} [file] The file name to display above the rendered code. -@param {bool} [fm=false] If true, render the code as front matter. -@param {bool} [skipHeader=false] If false, omit top level key(s) when rendering a section of site.Data.docs.config. +@param {bool} [fm=false] Whether to render the code as front matter. +@param {bool} [skipHeader=false] Whether to omit top level key(s) when rendering a section of site.Data.docs.config. @example {{< code-toggle file=hugo config=build />}} @@ -72,7 +72,7 @@ Renders syntax-highlighted configuration data in JSON, TOML, and YAML formats.