Post Processing
This page details configuration options for adding or removing properties from the sitemap after it has been generated, via rules and explicit overrides.
Page Titles
The pageTitles
option allows you to explicitly set the title of a specific endpoint/URL as the node title.
Normally, the node title is either derived from the frontmatter title
field, or the most common
label associated with the link.
If you specify a title for a page in the pageTitles
object, it will override the default behavior.
Sitemap with no custom page titles.
Node is renamed to “Custom Name”.
External node to https://astro.build/showcase/ is renamed to “Astro Showcases”.
Style Rules
The styleRules
option allows you to specify a set of rules that will be applied to pages based on their resource path.
The rules are specified as a list of strings, where each string is a glob pattern.
The first rule that matches the file path will be applied to the page.
If a custom style was specified in the page’s frontmatter, it will override the style rule, otherwise, these styles have precedence over all other styles.
Sitemap with no style rules applied.
Sitemap with a shapeColor
style applied to all pages in the dir
resource.
Sitemap with a shape
style applied where the last part of the URL is node
.
Tag Rules
The tagRules
option allows you to specify a set of rules which will add tags to pages based on their resource path.
The rules are specified as a list of strings, where each string is a glob pattern.
The first rule that matches the file path will be applied to the page.
Sitemap with no tag rules applied.
Sitemap with dir
tag applied to all pages in the dir
directory.
Sitemap with node
tag applied where the last part of the URL is node
.