Site Menu Settings (settings
)
The Platen display options control how the Platen site’s menu is structured and displays.
With the root_section
setting, you can define a content folder to add to the site menu as
the main section.
With the before_injection
, before_hugo_config
, before_root_section
,
after_root_section
, after_hugo_config
, and after_injection
settings
(collectively, the menu position settings), you can use Platen features to add entries to
the site’s menu in one of several locations using a partial defined for the feature.
In addition to the position settings, feature module authors can define any settings that make sense for their functionality, such as top-level defaults that apply to every position unless overridden.
For more information on how to define these settings, see Defining a Feature Menu Entry.
For more information on how this setting is used internally and how to define a feature that can
support these menu items, see partials.menu
in Defining Features.
JSON Schema
Definition
{
"$id": "https://platen.io/schemas/platen/site/display/menu/settings/schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Optional settings controlling how a Platen site's menu is structured.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/",
"properties": {
"after_hugo_config": {
"description": "Define feature menu entries after configured entries and before injection.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#after_hugo_config",
"properties": {
"entries": {
"description": "Define one or more entries to include at this position.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#entries",
"items": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/entry/schema.json"
},
"title": "Entries",
"type": "array"
},
"group": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/group/schema.json"
}
},
"title": "Feature Entries After Menu Configuration Entries",
"type": "object"
},
"after_injection": {
"description": "Define feature menu entries at the end of the site menu.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#after_injection",
"properties": {
"entries": {
"description": "Define one or more entries to include at this position.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#entries",
"items": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/entry/schema.json"
},
"title": "Entries",
"type": "array"
},
"group": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/group/schema.json"
}
},
"title": "Feature Entries After Menu Injection",
"type": "object"
},
"after_root_section": {
"description": "Define feature menu entries after automatic entries and before configured ones.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#after_root_section",
"properties": {
"entries": {
"description": "Define one or more entries to include at this position.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#entries",
"items": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/entry/schema.json"
},
"title": "Entries",
"type": "array"
},
"group": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/group/schema.json"
}
},
"title": "Feature Entries After Main Menu Entries",
"type": "object"
},
"before_hugo_config": {
"description": "Define feature menu entries after injection and before configured entries.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#before_hugo_config",
"properties": {
"entries": {
"description": "Define one or more entries to include at this position.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#entries",
"items": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/entry/schema.json"
},
"title": "Entries",
"type": "array"
},
"group": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/group/schema.json"
}
},
"title": "Feature Entries Before Hugo Menu Configuration Entries",
"type": "object"
},
"before_injection": {
"description": "Define entries at the beginning of the site menu.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#before_injection",
"properties": {
"entries": {
"description": "Define one or more entries to include at this position.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#entries",
"items": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/entry/schema.json"
},
"title": "Entries",
"type": "array"
},
"group": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/group/schema.json"
}
},
"title": "Feature Entries Before Menu Injection",
"type": "object"
},
"before_root_section": {
"description": "Define feature menu entries after configured entries and before automatic ones.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#before_root_section",
"properties": {
"entries": {
"description": "Define one or more entries to include at this position.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#entries",
"items": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/entry/schema.json"
},
"title": "Entries",
"type": "array"
},
"group": {
"$ref": "https://platen.io/schemas/platen/site/display/menu/group/schema.json"
}
},
"title": "Feature Entries Before Main Menu Entries",
"type": "object"
},
"languages_icon": {
"description": "Defines the options for the languages icon for selecting translations in a multilingual site.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#languages_icon",
"properties": {
"library": {
"description": "The library the icon is in.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#library",
"oneOf": [
{
"enum": [
"builtin_bootstrap",
"boxicons",
"font_awesome",
"heroicons",
"iconoir",
"ionicons",
"jam_icons",
"lucide",
"material_icons",
"remix_icon",
"tabler_icons",
"unicons"
]
},
{
"type": "string"
}
],
"title": "Icon Library"
},
"name": {
"default": "translate@builtin_bootstrap",
"description": "The name of the icon.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#name",
"title": "Icon Name",
"type": "string"
},
"src": {
"description": "The source for a custom icon.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#src",
"title": "Icon SVG Source",
"type": "string"
},
"use_legacy": {
"default": true,
"description": "Choose whether to use the legacy SVG icon or the configurable shoelace icon.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#use_legacy",
"title": "Use Legacy Languages Icon",
"type": "boolean"
},
"variant": {
"description": "The icon variant.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#variant",
"title": "Icon Variant",
"type": "string"
}
},
"title": "Languages Icon",
"type": "object"
},
"root_section": {
"default": "/",
"description": "Specifies the root section of the content folder to add to the site menu.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#root_section",
"title": "Menu Root Section",
"type": "string"
}
},
"title": "Site Menu Settings",
"type": "object"
}
Menu Root Section (root_section
)
Specifies the root section of the content folder to add to the site menu. You can specify a
folder path relative to the root of the content folder, like games
for content/games
, or
projects/releases
for content/projects/releases
.
You can specify a single forward slash (/
) to set the menu’s root section to the entire
content folder.
If you want to uninclude a page or section from the site menu, set the
platen.menu.hide
parameter in the page or section’s frontmatter to true
.
The default value is /
.
Languages Icon (languages_icon
)
This setting defines the options for the languages icon that displays on multilingual sites. The icon displays beside the language of the current page in the dropdown entry. When you select the component in the menu, Platen displays the list of translations for the current page.
JSON Schema
Definition
{
"description": "Defines the options for the languages icon for selecting translations in a multilingual site.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/",
"properties": {
"library": {
"description": "The library the icon is in.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#library",
"oneOf": [
{
"enum": [
"builtin_bootstrap",
"boxicons",
"font_awesome",
"heroicons",
"iconoir",
"ionicons",
"jam_icons",
"lucide",
"material_icons",
"remix_icon",
"tabler_icons",
"unicons"
]
},
{
"type": "string"
}
],
"title": "Icon Library"
},
"name": {
"default": "translate@builtin_bootstrap",
"description": "The name of the icon.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#name",
"title": "Icon Name",
"type": "string"
},
"src": {
"description": "The source for a custom icon.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#src",
"title": "Icon SVG Source",
"type": "string"
},
"use_legacy": {
"default": true,
"description": "Choose whether to use the legacy SVG icon or the configurable shoelace icon.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#use_legacy",
"title": "Use Legacy Languages Icon",
"type": "boolean"
},
"variant": {
"description": "The icon variant.\n\nhttps://platen.io/schemas/platen/site/display/menu/settings/#variant",
"title": "Icon Variant",
"type": "string"
}
},
"title": "Languages Icon",
"type": "object"
}
Icon Name (name
)
This setting specifies the name of the icon to display. You can specify the icon with Platen’s shorthand syntax for icons.
The shorthand syntax for icons in Platen is <name>[&<variant>][@<library>]
, where:
<name>
is mandatory and represents the name of the icon.&<variant>
is optional and represents the variant of the icon. Not all icons and libraries support variants. When you specify a variant in this syntax, you must specify it after the icon’s name. You must separate the variant from the icon name with an ampersand (&
). When you don’t specify a variant, Platen uses the library’s default variant.&<library>
is optional and represents the library the icon belongs to. When you specify a library in this syntax, you must specify it after the icon’s name and variant. You must separate the library from the icon name or variant with an at sign (@
). When you don’t specify a library, Platen uses the configured default library.
You can always use any valid icon in Shoelace’s default icon library.
If you specify the icon’s variant or library with the shorthand syntax, don’t specify the [sref:variant
]
or [sref:library
] settings for this icon.
The default icon for this setting is:
Icon Library (library
)
This setting specifies the library to load the icon from. You can use any of the registered icon libraries.
If you don’t specify a value for this setting, Platen uses the features.shoelace.icons.default_library
setting’s value as the library.
Don’t specify this setting if you’re including the library in the name
setting with the shorthand syntax.
Icon Variant (variant
)
This setting specifies the icon’s variant. Not all icons and libraries have variants. If this value isn’t set, the icon uses its default variant.
Don’t specify this setting if you’re including the variant in the name
setting with the shorthand syntax.
Icon SVG Source (src
)
This setting specifies the URL to an SVG file to use as a custom icon. If you specify this value, Platen
ignores the settings for the name
, library
, and variant
settings.
Use Legacy Languages Icon (use_legacy
)
Use this setting to choose whether to use the legacy implementation for the languages icon. The current
default value is true
, which renders the default icon and ignores all other settings for the language
icon.
In the future, the default value will change to false
. Later, this setting will be removed and only the
new implementation will be available. We strongly recommend you update this setting to false
and adjust
your site’s theme as needed.
Feature Entries Before Menu Injection (before_injection
)
This setting allows you to add menu entries for the feature at the very top of the site menu, after the brand and search section.
When the menu partial is called, this value is passed to the partial along with the current page’s context.
Group Settings (group
)
In the position settings for platen.display.menu
, you can group entries at the
top-level or nested in the entries list. These settings determine how those grouped entries are
displayed.
If this setting isn’t defined at the top-level for a position, all entries for that position are added in an unordered list without a containing item to indicate that they’re semantically related.
You can use this setting for individual entries, creating a nested group of related entries.
For more information, see Group Settings
Entries (entries
)
You must define at least one entry to include at this position. A position without any
entries isn’t processed, even if group
is defined.
Feature Entries Before Hugo Menu Configuration Entries (before_hugo_config
)
This setting allows you to add menu entries for the feature after any from the injection
partial but before the entries from the menu.before
setting in Hugo’s configuration
file.
When the menu partial is called, this value is passed to the partial along with the current page’s context.
Group Settings (group
)
In the position settings for platen.display.menu
, you can group entries at the
top-level or nested in the entries list. These settings determine how those grouped entries are
displayed.
If this setting isn’t defined at the top-level for a position, all entries for that position are added in an unordered list without a containing item to indicate that they’re semantically related.
You can use this setting for individual entries, creating a nested group of related entries.
For more information, see Group Settings
Entries (entries
)
You must define at least one entry to include at this position. A position without any
entries isn’t processed, even if group
is defined.
Feature Entries Before Main Menu Entries (before_root_section
)
This setting allows you to add menu entries for the feature after the entries from the
menu.before
setting in Hugo’s configuration file but before the content added from the
root content section by Platen.
When the menu partial is called, this value is passed to the partial along with the current page’s context.
Group Settings (group
)
In the position settings for platen.display.menu
, you can group entries at the
top-level or nested in the entries list. These settings determine how those grouped entries are
displayed.
If this setting isn’t defined at the top-level for a position, all entries for that position are added in an unordered list without a containing item to indicate that they’re semantically related.
You can use this setting for individual entries, creating a nested group of related entries.
For more information, see Group Settings
Entries (entries
)
You must define at least one entry to include at this position. A position without any
entries isn’t processed, even if group
is defined.
Feature Entries After Main Menu Entries (after_root_section
)
This setting allows you to add menu entries for the feature after the content added from
the root content section by Platen but before the entries from the menu.after
setting
in Hugo’s configuration file.
When the menu partial is called, this value is passed to the partial along with the current page’s context.
Group Settings (group
)
In the position settings for platen.display.menu
, you can group entries at the
top-level or nested in the entries list. These settings determine how those grouped entries are
displayed.
If this setting isn’t defined at the top-level for a position, all entries for that position are added in an unordered list without a containing item to indicate that they’re semantically related.
You can use this setting for individual entries, creating a nested group of related entries.
For more information, see Group Settings
Entries (entries
)
You must define at least one entry to include at this position. A position without any
entries isn’t processed, even if group
is defined.
Feature Entries After Menu Configuration Entries (after_hugo_config
)
This setting allows you to add menu entries for the feature after the entries from the
menu.after
setting in Hugo’s configuration file but before the injection partial.
When the menu partial is called, this value is passed to the partial along with the current page’s context.
Group Settings (group
)
In the position settings for platen.display.menu
, you can group entries at the
top-level or nested in the entries list. These settings determine how those grouped entries are
displayed.
If this setting isn’t defined at the top-level for a position, all entries for that position are added in an unordered list without a containing item to indicate that they’re semantically related.
You can use this setting for individual entries, creating a nested group of related entries.
For more information, see Group Settings
Entries (entries
)
You must define at least one entry to include at this position. A position without any
entries isn’t processed, even if group
is defined.
Feature Entries After Menu Injection (after_injection
)
This setting allows you to add menu entries for the feature at the very bottom of the site menu after everything else.
When the menu partial is called, this value is passed to the partial along with the current page’s context.
Group Settings (group
)
In the position settings for platen.display.menu
, you can group entries at the
top-level or nested in the entries list. These settings determine how those grouped entries are
displayed.
If this setting isn’t defined at the top-level for a position, all entries for that position are added in an unordered list without a containing item to indicate that they’re semantically related.
You can use this setting for individual entries, creating a nested group of related entries.
For more information, see Group Settings
Entries (entries
)
You must define at least one entry to include at this position. A position without any
entries isn’t processed, even if group
is defined.