fix: fix usage of terms and taxonomies list templates (#330)

This commit is contained in:
Robert Kaussow 2022-02-07 11:53:45 +01:00 committed by GitHub
parent d2668b43f6
commit a901b3da36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 56 additions and 18 deletions

View File

@ -29,6 +29,10 @@ posts_read_time:
one: "Eine Minute Lesedauer"
other: "{{ . }} Minuten Lesedauer"
posts_update_prefix: Aktualisiert am
posts_count:
one: "Ein Artikel"
other: "{{ . }} Artikel"
posts_tagged_with: Alle Artikel mit dem Tag '{{ . }}'
footer_build_with: >
Entwickelt mit <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> und

View File

@ -29,6 +29,10 @@ posts_read_time:
one: "One minute to read"
other: "{{ . }} minutes to read"
posts_update_prefix: Updated on
posts_count:
one: "One post"
other: "{{ . }} posts"
posts_tagged_with: All posts tagged with '{{ . }}'
footer_build_with: >
Built with <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> and

View File

@ -1,14 +1,16 @@
{{ define "main" }}
{{ range .Paginator.Pages }}
<article class="gdoc-markdown gdoc-post">
<article class="gdoc-post">
<header class="gdoc-post__header">
<h1 class="gdoc-post__title">
<a href="{{ .RelPermalink }}">{{ partial "utils/title" . }}</a>
</h1>
</header>
<section>
<section class="gdoc-markdown">
{{ .Summary }}
</section>
<div class="gdoc-post__readmore">
{{ if .Truncated }}
<a
@ -37,7 +39,7 @@
<a
class="gdoc-button__link"
href="{{ .page.RelPermalink }}"
title="All posts tagged with '{{ .name }}'"
title="{{ i18n "posts_tagged_with" .name }}"
>
{{ .name }}
</a>

View File

@ -0,0 +1,31 @@
{{ define "main" }}
{{ range .Paginator.Pages.ByTitle }}
<article class="gdoc-post">
<header class="gdoc-post__header">
<h1 class="gdoc-post__title">
<a href="{{ .RelPermalink }}">{{ partial "utils/title" . }}</a>
</h1>
</header>
<footer class="gdoc-post__meta flex align-center">
<span class="flex align-center no-wrap">
{{ $pageCount := len .Pages }}
<svg class="icon gdoc_tag"><use xlink:href="#gdoc_tag"></use></svg>
<span class="gdoc-post__tag">
{{ i18n "posts_count" $pageCount }}
</span>
</span>
<span class="flex align-center no-wrap">
<svg class="icon gdoc_star"><use xlink:href="#gdoc_star"></use></svg>
<span>
{{ $latet := index .Pages.ByDate 0 }}
{{ with $latet }}
<a href="{{ .RelPermalink }}">{{ partial "utils/title" . }}</a>
{{ end }}
</span>
</span>
</footer>
</article>
{{ end }}
{{ end }}

View File

@ -38,17 +38,9 @@
<a
class="gdoc-button__link"
href="{{ .page.RelPermalink }}"
title="All posts tagged with '{{ .name }}'"
title="{{ i18n "posts_tagged_with" .name }}"
>
{{ .name }}
</a>
</span>
{{ end }}
{{ define "post-author" }}
<span class="gdoc-post__tag gdoc-button gdoc-button--regular">
<a class="gdoc-button__link" href="{{ .page.RelPermalink }}" title="All posts of this author">
{{ .name }}
</a>
</span>
{{ end }}

View File

@ -37,7 +37,7 @@
<a
class="gdoc-button__link"
href="{{ .page.RelPermalink }}"
title="All posts tagged with '{{ .name }}'"
title="{{ i18n "posts_tagged_with" .name }}"
>
{{ .name }}
</a>

5
src/icons/star.svg Normal file
View File

@ -0,0 +1,5 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 28 28">
<title>star</title>
<path d="M14 22.052l-8.676 5.258 2.3-9.859-7.624-6.638 10.056-0.854 3.944-9.267 3.944 9.267 10.056 0.854-7.624 6.638 2.3 9.859z"></path>
</svg>

After

Width:  |  Height:  |  Size: 295 B

5
src/icons/tag.svg Normal file
View File

@ -0,0 +1,5 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 28 28">
<title>tag</title>
<path d="M17.52 17.52v-7.041h-7.041v7.041h7.041zM28 10.479h-7.041v7.041h7.041v3.439h-7.041v7.041h-3.439v-7.041h-7.041v7.041h-3.439v-7.041h-7.041v-3.439h7.041v-7.041h-7.041v-3.439h7.041v-7.041h3.439v7.041h7.041v-7.041h3.439v7.041h7.041v3.439z"></path>
</svg>

After

Width:  |  Height:  |  Size: 408 B

View File

@ -1,5 +0,0 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 28 28">
<title>tags</title>
<path d="M6.606 7.549c0-1.047-0.84-1.887-1.887-1.887s-1.887 0.84-1.887 1.887 0.84 1.887 1.887 1.887 1.887-0.84 1.887-1.887zM22.338 16.042c0 0.501-0.206 0.988-0.546 1.327l-7.239 7.254c-0.354 0.339-0.84 0.546-1.342 0.546s-0.988-0.206-1.327-0.546l-10.542-10.557c-0.752-0.737-1.342-2.167-1.342-3.214v-6.134c0-1.032 0.855-1.887 1.887-1.887h6.134c1.047 0 2.477 0.59 3.229 1.342l10.542 10.527c0.339 0.354 0.546 0.84 0.546 1.342zM27.999 16.042c0 0.501-0.206 0.988-0.546 1.327l-7.239 7.254c-0.354 0.339-0.84 0.546-1.342 0.546-0.767 0-1.15-0.354-1.651-0.87l6.93-6.93c0.339-0.339 0.546-0.826 0.546-1.327s-0.206-0.988-0.546-1.342l-10.542-10.527c-0.752-0.752-2.182-1.342-3.229-1.342h3.303c1.047 0 2.477 0.59 3.229 1.342l10.542 10.527c0.339 0.354 0.546 0.84 0.546 1.342z"></path>
</svg>

Before

Width:  |  Height:  |  Size: 924 B