mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2025-07-16 19:51:22 +00:00
Add human-readable sitemap
This commit is contained in:
parent
f2c703e155
commit
dcf89964d8
4
exampleSite/content.en/sitemap/_index.md
Normal file
4
exampleSite/content.en/sitemap/_index.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Sitemap"
|
||||||
|
layout: "sitemap"
|
||||||
|
---
|
4
exampleSite/content.he/sitemap/_index.md
Normal file
4
exampleSite/content.he/sitemap/_index.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Sitemap"
|
||||||
|
layout: "sitemap"
|
||||||
|
---
|
4
exampleSite/content.zh/sitemap/_index.md
Normal file
4
exampleSite/content.zh/sitemap/_index.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "Sitemap"
|
||||||
|
layout: "sitemap"
|
||||||
|
---
|
@ -36,6 +36,23 @@ enableGitInfo = true
|
|||||||
contentDir = 'content.he'
|
contentDir = 'content.he'
|
||||||
languageDirection = 'rtl'
|
languageDirection = 'rtl'
|
||||||
weight = 3
|
weight = 3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[[languages.en.menu.before]]
|
||||||
|
name = "Sitemap (EN)"
|
||||||
|
url = "/sitemap/"
|
||||||
|
weight = 10
|
||||||
|
|
||||||
|
[[languages.zh.menu.before]]
|
||||||
|
name = "Sitemap (ZH)"
|
||||||
|
url = "/zh/sitemap/"
|
||||||
|
weight = 10
|
||||||
|
|
||||||
|
[[languages.he.menu.before]]
|
||||||
|
name = "Sitemap (HE)"
|
||||||
|
url = "/he/sitemap/"
|
||||||
|
weight = 10
|
||||||
|
|
||||||
[menu]
|
[menu]
|
||||||
# [[menu.before]]
|
# [[menu.before]]
|
||||||
|
17
layouts/sitemap/list.html
Normal file
17
layouts/sitemap/list.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
<h1 class="text-3xl font-bold mb-4">Sitemap</h1>
|
||||||
|
<ul class="space-y-2">
|
||||||
|
{{ range sort .Site.RegularPages.ByDate.Reverse }}
|
||||||
|
{{ if eq .Lang $.Site.Language.Lang }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .RelPermalink }}" class="text-blue-600 hover:underline">
|
||||||
|
{{ .Title }}
|
||||||
|
</a>
|
||||||
|
<span class="text-gray-500 text-sm ml-2">
|
||||||
|
({{ .Date.Format "2006-01-02" }})
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
{{ end }}
|
Loading…
Reference in New Issue
Block a user