1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-24 01:42:10 +00:00

Exclude custom 404 from sitemap

This commit is contained in:
Rohan Kumar 2022-06-27 14:32:15 -07:00
parent 85d84910f8
commit c3026ed9d8
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 14 additions and 0 deletions

View file

@ -4,6 +4,7 @@ outputs:
url: "/404.html"
title: "Error 404 (Not Found)"
layout: "404"
private: true
---
You have requested a page that was not found on this server.

View file

@ -0,0 +1,13 @@
{{- printf `<?xml version="1.0" encoding="utf-8" standalone="yes"?>` | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{- range .Data.Pages }}
{{- if not .Params.private -}}
<url>
<loc>{{ .Permalink }}</loc>
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}
</url>
{{- end -}}
{{- end }}
</urlset>