Skip to content

Sitemap

module Sitemap
AssemblyNacara.Plugin.Sitemap
Attributes[<RequireQualifiedAccess>]

A sitemap of the built site, and optionally a robots.txt pointing at it.

Only pages that exist in this build are listed, and only when the site declares where it is published. Translations are cross-referenced with hreflang, so a search engine can offer a reader the language they asked for.

Functions and values

create () : IPlugin

A sitemap, with the default options.

createWith (configure: SitemapOptions -> SitemapOptions) : IPlugin

A sitemap, configured.

Parameter
configureGiven the defaults, the options to use. Anything it leaves alone keeps its default.
defaults: SitemapOptions
excludeCollections (value: string list) (options: SitemapOptions) : SitemapOptions

Pages to leave out, by collection name.

Parameter
valueThe value to use.
optionsThe options so far.
path (value: string) (options: SitemapOptions) : SitemapOptions

Where the sitemap is written, relative to the output directory.

Parameter
valueThe value to use.
optionsThe options so far.
register (site: Site) : Site

Add a sitemap to a site.

registerWith (configure: SitemapOptions -> SitemapOptions) (site: Site) : Site

Add a sitemap to a site, configured.

Parameter
configureGiven the defaults, the options to use. Anything it leaves alone keeps its default.
siteThe site being described.
render (site: SiteInfo) (options: SitemapOptions) (pages: Page list) : string

Render the sitemap for a set of pages.

Parameter
siteWhere the site is published, for the absolute urls a sitemap needs.
optionsWhat to leave out, and where the file goes.
pagesEvery page the build produced.
writeRobots (value: bool) (options: SitemapOptions) : SitemapOptions

Also write a robots.txt pointing at the sitemap.

Parameter
valueThe value to use.
optionsThe options so far.