Skip to content

Instantly share code, notes, and snippets.

@sid-r-singh
Last active December 5, 2021 19:06
Show Gist options
  • Save sid-r-singh/ee3ca4d4e8b047f43a1b5a320cdc83bc to your computer and use it in GitHub Desktop.
Save sid-r-singh/ee3ca4d4e8b047f43a1b5a320cdc83bc to your computer and use it in GitHub Desktop.
My config.toml
[outputFormats]
[outputFormats.articles]
baseName = "articles"
mediaType = "application/xml"
isPlainText = false
protocol = "xml://"
path = "/"
[outputFormats.authors]
baseName = "authors"
mediaType = "application/xml"
isPlainText = false
protocol = "xml://"
path = "/"
[outputFormats.tags]
baseName = "tags"
mediaType = "application/xml"
isPlainText = false
protocol = "xml://"
path = "/"
[outputFormats.sitemapindex]
baseName = "sitemapindex"
mediaType = "application/xml"
isPlainText = false
protocol = "xml://"
path = "/"
[outputs]
home = ["HTML", "articles", "authors", "tags", "sitemapindex"]
{{ printf "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | safeHTML }}
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd">
{{- range . }}
<sitemap>
<loc>{{ .SitemapAbsURL }}</loc>
<lastmod>{{ .LastChange.Format "2006-01-02T15:04:05Z" | safeHTML }}</lastmod>
</sitemap>
{{- end }}
</sitemapindex>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment