File tree Expand file tree Collapse file tree 4 files changed +61
-10
lines changed
Expand file tree Collapse file tree 4 files changed +61
-10
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,16 @@ menuOrder = [
1717 " legacy" ,
1818 " extra"
1919]
20+
2021enable_search = true
2122robots = ' '
2223
24+ sitemaps = [
25+ " https://docs.chef.io/sitemap-main.xml" ,
26+ " https://docs.chef.io/360/1.0/sitemap.xml" ,
27+ " https://docs.chef.io/360/1.1/sitemap.xml"
28+ ]
29+
2330[chef-web-docs ]
2431 gh_path = " https://github.com/chef/chef-web-docs/blob/main/content/"
2532
Original file line number Diff line number Diff line change @@ -7,24 +7,34 @@ pluralizeListTitles = false
77disableKinds = [" taxonomy" , " term" ]
88configDir = " config"
99
10- # We do redirects using Netlify's _redirects file, generated by Hugo (see "outputs" below).
1110disableAliases = true
1211# Summary length
1312summaryLength = 20
13+
14+ # We do redirects using Netlify's _redirects file, generated by Hugo.
15+ # See the REDIR output and output format and the text/netlify mediatype.
1416[outputs ]
15- home = [ " HTML" , " RSS" , " REDIR" ]
16- section = [ " HTML" , " RSS" ]
17+ home = [ " HTML" , " RSS" , " REDIR" , " SITEMAP-MAIN " ]
18+ section = [ " HTML" , " RSS" ]
1719
1820[mediaTypes ]
19- [mediaTypes ."text/netlify" ]
20- delimiter = " "
21+ [mediaTypes ."text/netlify" ]
22+ delimiter = " "
2123
2224[outputFormats ]
23- [outputFormats .REDIR ]
24- mediatype = " text/netlify"
25- baseName = " _redirects"
26- isPlainText = true
27- notAlternative = true
25+ [outputFormats .REDIR ]
26+ mediatype = " text/netlify"
27+ baseName = " _redirects"
28+ isPlainText = true
29+ notAlternative = true
30+
31+ [outputFormats .SITEMAP-MAIN ]
32+ MediaType = " application/xml"
33+ BaseName = " sitemap-main"
34+ IsHTML = false
35+ IsPlainText = true
36+ Rel = " sitemap"
37+ protocol = " xml://"
2838
2939[markup ]
3040 [markup .goldmark ]
Original file line number Diff line number Diff line change 1+ {{ printf "<?xml version =\" 1.0\" encoding =\" utf-8\" standalone =\" yes\" ?>" | safeHTML }}
2+ <urlset xmlns =" http://www.sitemaps.org/schemas/sitemap/0.9"
3+ xmlns : xhtml =" http://www.w3.org/1999/xhtml" >
4+ {{ range .Data.Pages }}
5+ {{- if or (eq (isset .Params "sitemapexclude") false) (ne .Params.sitemapExclude true) }}
6+ <url >
7+ <loc >{{ .Permalink }}</loc >{{ if not .Lastmod.IsZero }}
8+ <lastmod >{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod >{{ end }}{{ with .Sitemap.ChangeFreq }}
9+ <changefreq >{{ . }}</changefreq >{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
10+ <priority >{{ .Sitemap.Priority }}</priority >{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
11+ <xhtml : link
12+ rel =" alternate"
13+ hreflang =" {{ .Language.Lang }}"
14+ href =" {{ .Permalink }}"
15+ />{{ end }}
16+ <xhtml : link
17+ rel =" alternate"
18+ hreflang =" {{ .Language.Lang }}"
19+ href =" {{ .Permalink }}"
20+ />{{ end }}
21+ </url >
22+ {{- end }}
23+ {{ end }}
24+ </urlset >
25+
26+ <!-- From https://dereckcurry.com/posts/excluding-pages-from-the-sitemap/ -->
Original file line number Diff line number Diff line change 1+ {{ printf "<?xml version =\" 1.0\" encoding =\" utf-8\" standalone =\" yes\" ?>" | safeHTML }}
2+ <sitemapindex xmlns =" http://www.sitemaps.org/schemas/sitemap/0.9" >
3+ {{- range .Site.Params.sitemaps }}
4+ <sitemap >
5+ <loc >{{ . }}</loc >
6+ </sitemap >
7+ {{ end -}}
8+ </sitemapindex >
You can’t perform that action at this time.
0 commit comments