This commit is contained in:
wehrend 2025-06-29 11:31:44 +00:00 committed by GitHub
commit 0483db7221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 68 additions and 2 deletions

View File

@ -0,0 +1,4 @@
---
title: "Sitemap"
layout: "sitemap"
---

View File

@ -0,0 +1,4 @@
---
title: "Sitemap"
layout: "sitemap"
---

View File

@ -0,0 +1,4 @@
---
title: "Sitemap"
layout: "sitemap"
---

View File

@ -36,6 +36,23 @@ enableGitInfo = true
contentDir = 'content.he'
languageDirection = 'rtl'
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.before]]
@ -117,3 +134,5 @@ enableGitInfo = true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly = false
# count number of thumbnails that should be shown on posts, default 0
thumbnailsPerPost = 0

View File

@ -113,3 +113,5 @@ params:
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly: false
# count number of thumbnails that should be shown on posts, default 0
thumbnailsPerPost: 0

View File

@ -1,13 +1,29 @@
{{ define "main" }}
{{ $thumbCount := default 0 .Site.Params.thumbnailsPerPost }}
{{ range sort .Paginator.Pages }}
<article class="markdown book-post">
<h2>
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
</h2>
{{ partial "docs/post-meta" . }}
<div class="book-post-content">
{{ $images := where (.Resources.ByType "image") "MediaType.SubType" "!=" "svg+xml" }}
{{ if and (gt (len $images) 0) (gt $thumbCount 0) }}
<div class="thumbnails">
{{ range first $thumbCount $images }}
{{ $thumb := .Fit "200x200" }}
<img src="{{ $thumb.RelPermalink }}" alt="Thumbnail for {{ $.Title }}">
{{ end }}
</div>
{{ end }}
<p>
{{- .Summary -}}
</div>
{{ if .Truncated }}
<a href="{{ .RelPermalink }}">...</a>
{{ end }}
</p>
</article>
{{ end }}

17
layouts/sitemap/list.html Normal file
View 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 }}