diff --git a/exampleSite/content.en/sitemap/_index.md b/exampleSite/content.en/sitemap/_index.md new file mode 100644 index 0000000..74240a7 --- /dev/null +++ b/exampleSite/content.en/sitemap/_index.md @@ -0,0 +1,4 @@ +--- +title: "Sitemap" +layout: "sitemap" +--- diff --git a/exampleSite/content.he/sitemap/_index.md b/exampleSite/content.he/sitemap/_index.md new file mode 100644 index 0000000..74240a7 --- /dev/null +++ b/exampleSite/content.he/sitemap/_index.md @@ -0,0 +1,4 @@ +--- +title: "Sitemap" +layout: "sitemap" +--- diff --git a/exampleSite/content.zh/sitemap/_index.md b/exampleSite/content.zh/sitemap/_index.md new file mode 100644 index 0000000..74240a7 --- /dev/null +++ b/exampleSite/content.zh/sitemap/_index.md @@ -0,0 +1,4 @@ +--- +title: "Sitemap" +layout: "sitemap" +--- diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 34af293..835deb1 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -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 diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 3fd0c40..3c780a3 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -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 diff --git a/layouts/posts/list.html b/layouts/posts/list.html index dd0d76d..f4fdc58 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -1,13 +1,29 @@ {{ define "main" }} + {{ $thumbCount := default 0 .Site.Params.thumbnailsPerPost }} + {{ range sort .Paginator.Pages }}

{{ partial "docs/title.html" . }}

{{ partial "docs/post-meta" . }} -
+ + {{ $images := where (.Resources.ByType "image") "MediaType.SubType" "!=" "svg+xml" }} + {{ if and (gt (len $images) 0) (gt $thumbCount 0) }} +
+ {{ range first $thumbCount $images }} + {{ $thumb := .Fit "200x200" }} + Thumbnail for {{ $.Title }} + {{ end }} +
+ {{ end }} + +

{{- .Summary -}} -

+ {{ if .Truncated }} + ... + {{ end }} +

{{ end }} diff --git a/layouts/sitemap/list.html b/layouts/sitemap/list.html new file mode 100644 index 0000000..67efbac --- /dev/null +++ b/layouts/sitemap/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} +

Sitemap

+ +{{ end }}