Improve type formatting (#2032)

This commit is contained in:
Joe Mooring 2023-03-27 21:39:40 -07:00 committed by GitHub
parent 7785fa7d9f
commit f90fb1bf52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 37 deletions

View File

@ -68,28 +68,28 @@ Access the entry with `site.Menus.main` and `site.Menus.footer` in your template
Use these properties when defining menu entries in front matter:
identifier
: (string) Required when two or more menu entries have the same `name`, or when localizing the `name` using translation tables. Must start with a letter, followed by letters, digits, or underscores.
: (`string`) Required when two or more menu entries have the same `name`, or when localizing the `name` using translation tables. Must start with a letter, followed by letters, digits, or underscores.
name
: (string) The text to display when rendering the menu entry.
: (`string`) The text to display when rendering the menu entry.
params
: (map) User-defined properties for the menu entry.
: (`map`) User-defined properties for the menu entry.
parent
: (string) The `identifier` of the parent menu entry. If `identifier` is not defined, use `name`. Required for child entries in a nested menu.
: (`string`) The `identifier` of the parent menu entry. If `identifier` is not defined, use `name`. Required for child entries in a nested menu.
post
: (string) The HTML to append when rendering the menu entry.
: (`string`) The HTML to append when rendering the menu entry.
pre
: (string) The HTML to prepend when rendering the menu entry.
: (`string`) The HTML to prepend when rendering the menu entry.
title
: (string) The HTML `title` attribute of the rendered menu entry.
: (`string`) The HTML `title` attribute of the rendered menu entry.
weight
: (int) A non-zero integer indicating the entry's position relative the root of the menu, or to its parent for a child entry. Lighter entries float to the top, while heavier entries sink to the bottom.
: (`int`) A non-zero integer indicating the entry's position relative the root of the menu, or to its parent for a child entry. Lighter entries float to the top, while heavier entries sink to the bottom.
### Example {#example-front-matter}
@ -155,10 +155,10 @@ Each menu entry defined in site configuration requires two or more properties:
- Specify `name` and `url` for external links
pageRef
: (string) The file path of the target page, relative to the `content` directory. Required for *internal* links.
: (`string`) The file path of the target page, relative to the `content` directory. Required for *internal* links.
url
: (string) Required for *external* links.
: (`string`) Required for *external* links.
{{% note %}}
The [properties] available to entries defined in front matter are also available to entries defined in site configuration.

View File

@ -68,19 +68,19 @@ If starting with a Sass file within the `assets` directory:
The `resources.PostCSS` method takes an optional map of options.
config
: (string) The directory that contains the PostCSS configuration file. Default is the root of the project directory.
: (`string`) The directory that contains the PostCSS configuration file. Default is the root of the project directory.
noMap
: (bool) Default is `false`. If `true`, disables inline sourcemaps.
: (`bool`) Default is `false`. If `true`, disables inline sourcemaps.
inlineImports
: (bool) Default is `false`. Enable inlining of @import statements. It does so recursively, but will only import a file once.
: (`bool`) Default is `false`. Enable inlining of @import statements. It does so recursively, but will only import a file once.
URL imports (e.g. `@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');`) and imports with media queries will be ignored.
Note that this import routine does not care about the CSS spec, so you can have @import anywhere in the file.
Hugo will look for imports relative to the module mount and will respect theme overrides.
skipInlineImportsNotFound {{< new-in "0.99.0" >}}
: (bool) Default is `false`. Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true.
: (`bool`) Default is `false`. Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true.
{{< code file="layouts/partials/css.html" >}}
{{ $opts := dict "config" "config-directory" "noMap" true }}
@ -94,16 +94,16 @@ skipInlineImportsNotFound {{< new-in "0.99.0" >}}
To avoid using a PostCSS configuration file, you can specify a minimal configuration using the options map.
use
: (string) A space-delimited list of PostCSS plugins to use.
: (`string`) A space-delimited list of PostCSS plugins to use.
parser
: (string) A custom PostCSS parser.
: (`string`) A custom PostCSS parser.
stringifier
: (string) A custom PostCSS stringifier.
: (`string`) A custom PostCSS stringifier.
syntax
: (string) Custom postcss syntax.
: (`string`) Custom postcss syntax.
{{< code file="layouts/partials/css.html" >}}
{{ $opts := dict "use" "autoprefixer postcss-color-alpha" }}

View File

@ -19,54 +19,54 @@ aliases: [/variables/menu/]
After [defining the menu entries], access their properties with these variables.
.Children
: (menu) A collection of child menu entries, if any, under the current menu entry.
: (`menu`) A collection of child menu entries, if any, under the current menu entry.
.Identifier
: (string) The `identifier` property of the menu entry. If you define the menu entry [automatically], the page's `.Section`.
: (`string`) The `identifier` property of the menu entry. If you define the menu entry [automatically], the page's `.Section`.
.KeyName
: (string) The `identifier` property of the menu entry, else the `name` property.
: (`string`) The `identifier` property of the menu entry, else the `name` property.
.Menu
: (string) The identifier of the menu that contains the menu entry.
: (`string`) The identifier of the menu that contains the menu entry.
.Name
: (string) The `name` property of the menu entry.
: (`string`) The `name` property of the menu entry.
- If you define the menu entry [automatically], the page's `.LinkTitle`, else the page's `.Title`.
- If you define the menu [in front matter] or [in site configuration], falls back to the page's `.LinkTitle`, then to the page's `.Title`.
.Page
: (page) A reference to the page associated with the menu entry.
: (`page`) A reference to the page associated with the menu entry.
<!-- This provides no value when rendering menu. Omitting to avoid confusion.
.PageRef
: (string) The `pageRef` property of the menu entry.
: (`string`) The `pageRef` property of the menu entry.
-->
.Params
: (map) The `params` property of the menu entry.
: (`map`) The `params` property of the menu entry.
.Parent
: (string) The `parent` property of the menu entry.
: (`string`) The `parent` property of the menu entry.
.Post
: (template.HTML) The `post` property of the menu entry.
: (`template.HTML`) The `post` property of the menu entry.
.Pre
: (template.HTML) The `pre` property of the menu entry.
: (`template.HTML`) The `pre` property of the menu entry.
.Title
: (string) The `title` property of the menu entry.
: (`string`) The `title` property of the menu entry.
- If you define the menu entry [automatically], the page's `.LinkTitle`, else the page's `.Title`.
- If you define the menu [in front matter] or [in site configuration], falls back to the page's `.LinkTitle`, then to the page's `.Title`.
.URL
: (string) The `.RelPermalink` of the page associated with the menu entry. For menu entries pointing to external resources, the `url` property of the menu entry.
: (`string`) The `.RelPermalink` of the page associated with the menu entry. For menu entries pointing to external resources, the `url` property of the menu entry.
.Weight
: (int) The `weight` property of the menu entry.
: (`int`) The `weight` property of the menu entry.
- If you define the menu entry [automatically], the page's `.Weight`.
- If you define the menu [in front matter] or [in site configuration], falls back to the page's `.Weight`.
@ -74,19 +74,19 @@ After [defining the menu entries], access their properties with these variables.
## Methods
.HasChildren
: (bool) Returns `true` if `.Children` is non-nil.
: (`bool`) Returns `true` if `.Children` is non-nil.
.IsEqual
: (bool) Returns `true` if the compared menu entries represent the same menu entry.
: (`bool`) Returns `true` if the compared menu entries represent the same menu entry.
.IsSameResource
: (bool) Returns `true` if the compared menu entries point to the same resource.
: (`bool`) Returns `true` if the compared menu entries point to the same resource.
.Page.HasMenuCurrent
: (bool) Use this method to determine ancestors of the active menu entry. See [details](/functions/hasmenucurrent/).
: (`bool`) Use this method to determine ancestors of the active menu entry. See [details](/functions/hasmenucurrent/).
.Page.IsMenuCurrent
: (bool) Use this method to determine the active menu entry. See [details](/functions/ismenucurrent/).
: (`bool`) Use this method to determine the active menu entry. See [details](/functions/ismenucurrent/).
[automatically]: /content-management/menus/#define-automatically
[defining the menu entries]: /content-management/menus/#overview