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/": { "links": [ "https://astro.build/showcase/" ], "title": "Node", "exists": true, "backlinks": [] }, "https://astro.build/showcase/": { "title": "showcase", "external": true, "exists": true, "links": [], "backlinks": [ "node/" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "none", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
Node is renamed to “Custom Name”.
{}
{ "node/": { "links": [ "https://astro.build/showcase/" ], "title": "Custom Name", "exists": true, "backlinks": [] }, "https://astro.build/showcase/": { "title": "showcase", "external": true, "exists": true, "links": [], "backlinks": [ "node/" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "none", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
External node to https://astro.build/showcase/ is renamed to “Astro Showcases”.
{}
{ "node/": { "links": [ "https://astro.build/showcase/" ], "title": "Node", "exists": true, "backlinks": [] }, "https://astro.build/showcase/": { "title": "Astro Showcases", "external": true, "exists": true, "links": [], "backlinks": [ "node/" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "none", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
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.
{}
{ "node/": { "title": "node/", "links": [ "dir/a/" ], "exists": true, "backlinks": [] }, "dir/a/": { "title": "dir/a/", "exists": true, "links": [], "backlinks": [ "node/", "dir/b/" ] }, "dir/b/": { "title": "dir/b/", "links": [ "dir/a/", "dir/node/" ], "exists": true, "backlinks": [] }, "dir/node/": { "title": "dir/node/", "exists": true, "links": [], "backlinks": [ "dir/b/" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "none", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
Sitemap with a shapeColor
style applied to all pages in the dir
resource.
{}
{ "node/": { "title": "node/", "links": [ "dir/a/" ], "exists": true, "backlinks": [] }, "dir/a/": { "title": "dir/a/", "exists": true, "links": [], "backlinks": [ "node/", "dir/b/" ], "nodeStyle": { "shapeColor": "nodeColor7" } }, "dir/b/": { "title": "dir/b/", "links": [ "dir/a/", "dir/node/" ], "exists": true, "backlinks": [], "nodeStyle": { "shapeColor": "nodeColor7" } }, "dir/node/": { "title": "dir/node/", "exists": true, "links": [], "backlinks": [ "dir/b/" ], "nodeStyle": { "shapeColor": "nodeColor7" } }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "none", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
Sitemap with a shape
style applied where the last part of the URL is node
.
{}
{ "node/": { "title": "node/", "links": [ "dir/a/" ], "exists": true, "backlinks": [], "nodeStyle": { "shape": "triangle" } }, "dir/a/": { "title": "dir/a/", "exists": true, "links": [], "backlinks": [ "node/", "dir/b/" ] }, "dir/b/": { "title": "dir/b/", "links": [ "dir/a/", "dir/node/" ], "exists": true, "backlinks": [] }, "dir/node/": { "title": "dir/node/", "exists": true, "links": [], "backlinks": [ "dir/b/" ], "nodeStyle": { "shape": "triangle" } }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "none", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
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.
{ "tagRenderMode": "node"}
{ "node/": { "title": "node/", "links": [ "dir/a/" ], "exists": true, "backlinks": [] }, "dir/a/": { "title": "dir/a/", "exists": true, "links": [], "backlinks": [ "node/", "dir/b/" ] }, "dir/b/": { "title": "dir/b/", "links": [ "dir/a/", "dir/node/" ], "exists": true, "backlinks": [] }, "dir/node/": { "title": "dir/node/", "exists": true, "links": [], "backlinks": [ "dir/b/" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "node", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
Sitemap with dir
tag applied to all pages in the dir
directory.
{ "tagRenderMode": "node"}
{ "node/": { "title": "node/", "links": [ "dir/a/" ], "exists": true, "backlinks": [] }, "dir/a/": { "title": "dir/a/", "exists": true, "links": [], "backlinks": [ "node/", "dir/b/" ], "tags": [ "dir" ] }, "dir/b/": { "title": "dir/b/", "links": [ "dir/a/", "dir/node/" ], "exists": true, "backlinks": [], "tags": [ "dir" ] }, "dir/node/": { "title": "dir/node/", "exists": true, "links": [], "backlinks": [ "dir/b/" ], "tags": [ "dir" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "node", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}
Sitemap with node
tag applied where the last part of the URL is node
.
{ "tagRenderMode": "node"}
{ "node/": { "title": "node/", "links": [ "dir/a/" ], "exists": true, "backlinks": [], "tags": [ "node" ] }, "dir/a/": { "title": "dir/a/", "exists": true, "links": [], "backlinks": [ "node/", "dir/b/" ] }, "dir/b/": { "title": "dir/b/", "links": [ "dir/a/", "dir/node/" ], "exists": true, "backlinks": [] }, "dir/node/": { "title": "dir/node/", "exists": true, "links": [], "backlinks": [ "dir/b/" ], "tags": [ "node" ] }}
{ "actions": [], "tagStyles": {}, "tagRenderMode": "node", "enableDrag": false, "enableZoom": false, "enablePan": false, "enableHover": true, "enableClick": "disable", "depth": 8, "depthDirection": "both", "followLink": "same", "scale": 1.1, "minZoom": 0.05, "maxZoom": 4, "renderLabels": true, "renderArrows": true, "renderUnresolved": false, "renderExternal": true, "scaleLinks": true, "scaleArrows": true, "minZoomArrows": 0.8, "labelOpacityScale": 1.3, "labelMutedOpacity": 0, "labelHoverOpacity": 1, "labelAdjacentOpacity": 1, "labelFontSize": 12, "labelHoverScale": 1, "labelOffset": 10, "labelHoverOffset": 14, "zoomDuration": 75, "zoomEase": "out_quad", "hoverDuration": 200, "hoverEase": "out_quad", "nodeDefaultStyle": { "shape": "circle", "shapeColor": "nodeColor", "shapeSize": 10, "strokeWidth": 0, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.5 }, "nodeVisitedStyle": { "shapeColor": "nodeColorVisited" }, "nodeCurrentStyle": { "shapeColor": "nodeColorCurrent" }, "nodeUnresolvedStyle": { "shapeColor": "nodeColorUnresolved" }, "nodeExternalStyle": { "shape": "square", "shapeColor": "nodeColorExternal", "strokeColor": "inherit", "nodeScale": 0.6 }, "tagDefaultStyle": { "shape": "circle", "shapeSize": 6, "shapeColor": "backgroundColor", "strokeColor": "nodeColorTag", "strokeWidth": 1, "colliderScale": 1, "nodeScale": 1, "neighborScale": 0.7 }, "linkWidth": 1, "linkHoverWidth": 1, "arrowSize": 5, "arrowAngle": 0.5235987755982988, "centerForce": 0.05, "colliderPadding": 20, "repelForce": 200, "linkDistance": 0, "alphaDecay": 0.0228, "visibilityRules": [ "**/*" ], "prefetchPages": false}