summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html9
-rw-r--r--layouts/_default/baseof.html18
-rw-r--r--layouts/_default/list.html33
-rw-r--r--layouts/_default/single.html19
-rw-r--r--layouts/index.html22
-rw-r--r--layouts/partials/footer.html4
-rw-r--r--layouts/partials/head/meta.html21
-rw-r--r--layouts/partials/head/seo.html86
-rw-r--r--layouts/partials/header.html6
-rw-r--r--layouts/partials/list/pagination.html28
-rw-r--r--layouts/partials/list/post-card.html45
-rw-r--r--layouts/partials/list/recent-posts.html50
-rw-r--r--layouts/partials/navmenu.html58
-rw-r--r--layouts/partials/single/next-prev.html30
-rw-r--r--layouts/partials/single/tags.html17
-rw-r--r--layouts/tags/list.html37
-rw-r--r--layouts/tags/term.html42
17 files changed, 431 insertions, 94 deletions
diff --git a/layouts/404.html b/layouts/404.html
new file mode 100644
index 0000000..9859cd3
--- /dev/null
+++ b/layouts/404.html
@@ -0,0 +1,9 @@
+{{- define "main" }}
+<h1>{{ lang.Translate "404.title" | default "Page not found" }}</h1>
+<p>{{ lang.Translate "404.description" | default "The requested page does not exist" }}</p>
+<p>
+ <a href="{{ site.Home.RelPermalink }}">
+ {{ lang.Translate "404.homepage" | default "Back to the homepage" }}
+ </a>
+</p>
+{{- end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 3ca9201..3c4865b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}">
+<html lang="{{ .Language.LanguageCode }}" dir="{{ .Language.LanguageDirection | default "ltr" }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -9,7 +9,7 @@
<meta name="description" content="{{ . }}">
{{- else }}
{{- if or .IsPage .IsSection}}
- <meta name="description" content="{{ .Summary | plainify | default (printf "%s - %s" .Title site.Title) }}">
+ <meta name="description" content="{{ .Summary | plainify | default (printf "%s | %s" .Title site.Title) }}">
{{- else }}
<meta name="description" content="{{ site.Params.description | default site.Title }}">
{{- end }}
@@ -19,20 +19,20 @@
<link rel="canonical" href="{{ .Permalink }}">
{{- if .IsTranslated }}
- {{ range .Translations }}
+ {{- range .Translations }}
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
- {{ end }}
+ {{- end }}
{{- end }}
- {{ partial "head/meta.html" . }}
- {{ partial "head/seo.html" . }}
- {{ partialCached "head/css.html" . }}
+ {{- partial "head/meta.html" . }}
+ {{- partial "head/seo.html" . }}
+ {{- partialCached "head/css.html" . }}
</head>
- <body class="{{ .Type | default "page" }} {{ .Lang }}">
+ <body class="{{ .Type | default "page" }}">
{{ partial "header.html" . }}
- <main id="main" role="main">
+ <main id="main-content" class="site__main" role="main">
{{ block "main" . }}{{ end }}
</main>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index e69de29..8ff9b18 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -0,0 +1,33 @@
+{{- define "main" }}
+<section class="section-list">
+ <header class="section-list__header">
+ <h1 class="section-list__headline">
+ {{ .Title }}
+ </h1>
+ {{- $description := or .Description .Summary (lang.Translate "list.default_description" .Title | default (printf "All posts in %s" .Title)) }}
+ <p class="section-list__description">
+ {{ $description }}
+ </p>
+ </header>
+
+ <section class="section-list__content" aria-label="{{ lang.Translate "posts.name" | default "Posts" }}">
+ {{- /* 20 posts per site */ -}}
+ {{- $paginator := .Paginate .Pages 20 }}
+ {{- with $paginator.Pages }}
+ <ul class="section-list__posts">
+ {{- range . }}
+ <li class="section-list__post">
+ {{- partial "list/post-card.html" . }}
+ </li>
+ {{- end }}
+ </ul>
+ {{- else }}
+ <p class="section-list__empty-message">
+ {{ lang.Translate "list.empty" | default "No posts found in this section." }}
+ </p>
+ {{- end }}
+ </section>
+
+ {{- partial "list/pagination.html" $paginator }}
+</section>
+{{- end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index e69de29..24bc5c9 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -0,0 +1,19 @@
+{{- define "main" }}
+<article class="post">
+ <header class="post__header">
+ <h1 class="post__headline">{{ .Title }}</h1>
+ <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" class="post__publish-date">
+ {{ .Date | time.Format ":date_medium" }}
+ </time>
+ </header>
+
+ <div class="post__content">
+ {{ .Content }}
+ </div>
+
+ <footer class="post__footer">
+ {{ partial "single/tags" . }}
+ {{ partial "single/next-prev" . }}
+ </footer>
+</article>
+{{- end }}
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644
index 0000000..127af83
--- /dev/null
+++ b/layouts/index.html
@@ -0,0 +1,22 @@
+{{- /* HOMEPAGE */ -}}
+{{- define "main" }}
+<div class="homepage">
+ <header class="homepage__hero">
+ <h1 class="homepage__title">
+ {{ with .Title }}{{ . }}{{ else }}{{ site.Title | default "Welcome to my Blog!" }}{{ end }}
+ </h1>
+ {{- with .Content }}
+ <div class="homepage__content">
+ {{ . }}
+ </div>
+ {{- end }}
+ </header>
+
+ {{- partial "list/recent-posts.html" (dict
+ "count" 10
+ "title" (lang.Translate "posts.recent" | default "Recent Articles")
+ "show_view_all" true
+ )
+ -}}
+</div>
+{{- end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index a74a6a4..a934e59 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,3 +1,3 @@
-<footer role="contentinfo">
- <p>&copy; {{ now.Year }} {{ site.Params.author.name }}</p>
+<footer class="site__footer" role="contentinfo">
+ <p>&copy; {{ now.Year }} {{ site.Params.author.name }}</p>
</footer>
diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html
index d0358a1..f739838 100644
--- a/layouts/partials/head/meta.html
+++ b/layouts/partials/head/meta.html
@@ -1,22 +1,27 @@
-<!-- Basic Meta -->
+{{- /* Basic Meta */ -}}
<meta name="author" content="{{ site.Params.author.name | default site.Title }}">
<meta name="robots" content="index, follow">
-<!-- Open Graph (OG) -->
+{{- /* Open Graph */ -}}
<meta property="og:title" content="{{ .Title | default site.Title }}">
<meta property="og:description" content="{{ .Description | default .Summary }}">
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="{{ site.Title }}">
-{{- with .Params.images }}
- <meta property="og:image" content="{{ (index . 0) | absURL }}">
+{{- with site.Params.logo }}
+ <meta property="og:image" content="{{ . | absURL }}">
+{{- end }}
+{{- if .IsPage }}
+ <meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
+ {{- with .Lastmod }}
+ <meta property="article:modified_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">
+ {{- end }}
{{- end }}
-<!-- Twitter Card -->
+{{- /* Twitter Card */ -}}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ .Title | default site.Title }}">
<meta name="twitter:description" content="{{ .Description | default .Summary }}">
-{{- with .Params.images }}
- <meta name="twitter:image" content="{{ (index . 0) | absURL }}">
+{{- with site.Params.logo }}
+ <meta name="twitter:image" content="{{ . | absURL }}">
{{- end }}
-
diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html
index 2c617e1..628ea2c 100644
--- a/layouts/partials/head/seo.html
+++ b/layouts/partials/head/seo.html
@@ -1,50 +1,46 @@
-{{ if .IsPage }}
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "Article",
- "headline": {{ printf "%q" .Title }},
+<script type="application/ld+json">
+{
+ "@context": "https://schema.org",
+ "@type": "{{ if .IsPage }}Article{{ else }}WebSite{{ end }}",
+ "url": {{ .Permalink }},
+ "name": {{ with .Title }}{{ . }}{{ else }}{{ site.Title }}{{ end }},
+ "headline": {{ with .Title }}{{ . }}{{ else }}{{ site.Title }}{{ end }},
+ "description": {{ with .Description }}{{ . }}{{ else }}{{ site.Params.description | default site.Title }}{{ end }},
+ {{- with .Params.images }}
+ "image": [
+ {{- range $i, $image := . }}
+ {{- if $i }},{{ end }}
+ "{{ $image | absURL }}"
+ {{- end }}
+ ],
+ {{- else }}
+ {{- with site.Params.logo }}
+ "image": ["{{ . | absURL }}"],
+ {{- end }}
+ {{- end }}
+ {{- if .IsPage }}
"datePublished": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
- {{ with .Lastmod }}
- "dateModified": "{{ .Format "2006-01-02T15:04:05Z07:00" }}",
- {{ end }}
- "author": {
- "@type": "Person",
- "name": {{ printf "%q" (site.Params.author.name | default site.Title) }}
- },
- "publisher": {
- "@type": "Person",
- "name": {{ printf "%q" site.Title }},
- "logo": {
- "@type": "ImageObject",
- "url": "{{ site.Params.logo | absURL }}"
- }
+ {{- with .Lastmod }}
+ "dateModified": "{{ .Format "2006-01-02T15:04:05Z07:00" }}",
+ {{- end }}
+ {{- end }}
+ "author": {
+ "@type": "Person",
+ "name": "{{ site.Params.author.name | default site.Title }}"
+ },
+ "publisher": {
+ "@type": "Organization",
+ "name": "{{ site.Title }}"
+ {{- with site.Params.logo }},
+ "logo": {
+ "@type": "ImageObject",
+ "url": "{{ . | absURL }}"
+ }
+ {{- end }}
},
"mainEntityOfPage": {
"@type": "WebPage",
- "@id": "{{ .Permalink }}"
- },
- "image": [
- {{ with .Params.images }}"{{ (index . 0) | absURL }}"{{ end }}
- ]
- }
- </script>
-{{ else if .IsHome }}
- <script type="application/ld+json">
- {
- "@context": "https://schema.org",
- "@type": "WebSite",
- "url": "{{ site.BaseURL }}",
- "name": {{ printf "%q" site.Title }},
- "author": {
- "@type": "Person",
- "name": {{ printf "%q" (site.Params.author.name | default site.Title) }}
- },
- "publisher": {
- "@type": "Person",
- "name": {{ printf "%q" site.Title }}
- }
+ "@id": {{ .Permalink }}
}
- </script>
-{{ end }}
-
+}
+</script>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index a496628..7b728a6 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,6 +1,6 @@
-<header role="banner">
- <a href="{{ site.Home.RelPermalink }}" rel="home" class="site-title">
- {{ site.Title }}
+<header class="site__header" role="banner">
+ <a href="{{ site.Home.RelPermalink }}" rel="home" class="site-{{ if site.Params.logo }}logo{{ else }}title{{ end }}">
+ {{ with site.Params.logo}}{{ . }}{{ else }}{{ site.Title }}{{end}}
</a>
{{ partial "navmenu.html" (dict "menuID" "main" "page" .) }}
diff --git a/layouts/partials/list/pagination.html b/layouts/partials/list/pagination.html
new file mode 100644
index 0000000..47d90ff
--- /dev/null
+++ b/layouts/partials/list/pagination.html
@@ -0,0 +1,28 @@
+{{- $paginator := . }}
+{{- if gt $paginator.TotalPages 1 }}
+<nav class="pagination" aria-label="{{ lang.Translate "pagination.label" | default "Page navigation" }}">
+ {{- if $paginator.HasPrev }}
+ <a href="{{ $paginator.Prev.URL }}"
+ class="pagination__link"
+ rel="prev"
+ aria-label="{{ lang.Translate "pagination.previous_page" | default "Previous page" }}"
+ >
+ ← {{ lang.Translate "common.previous" | default "Previous" }}
+ </a>
+ {{- end }}
+
+ <p class="pagination__current">
+ {{ lang.Translate "pagination.position" $paginator.PageNumber $paginator.TotalPages | default (printf "Page %d of %d" $paginator.PageNumber $paginator.TotalPages) }}
+ </p>
+
+ {{- if $paginator.HasNext }}
+ <a href="{{ $paginator.Next.URL }}"
+ class="pagination__link"
+ rel="next"
+ aria-label="{{ lang.Translate "pagination.next_page" | default "Next page" }}"
+ >
+ {{ lang.Translate "common.next" | default "Next" }} →
+ </a>
+ {{- end }}
+</nav>
+{{- end }}
diff --git a/layouts/partials/list/post-card.html b/layouts/partials/list/post-card.html
new file mode 100644
index 0000000..12eada4
--- /dev/null
+++ b/layouts/partials/list/post-card.html
@@ -0,0 +1,45 @@
+{{- $post := . }}
+<article class="post-card">
+ <header class="post-card__header">
+ <h3 class="post-card__title">
+ <a href="{{ $post.RelPermalink }}" class="post-card__link">
+ {{ $post.Title }}
+ </a>
+ </h3>
+ <div class="post-card__meta">
+ <time datetime="{{ $post.Date.Format "2006-01-02T15:04:05Z07:00" }}" class="post-card__date">
+ {{ $post.Date | time.Format ":date_medium" }}
+ </time>
+ {{- with $post.ReadingTime }}
+ <p class="post-card__reading-time">
+ {{ lang.Translate "list.reading_time" . | default (printf "Estimated reading time: %s min" .) }}
+ </p>
+ {{- end }}
+ </div>
+ </header>
+
+ {{- with $post.Summary }}
+ <div class="post-card__summary">
+ {{ . }}
+ </div>
+ {{- end }}
+
+ {{- with $post.Params.tags }}
+ <footer class="post-card__tags">
+ <ul class="post-card__tags-list">
+ {{- range first 3 . }}
+ <li class="post-card__tags-item">
+ #{{ . }}
+ </li>
+ {{- end }}
+ {{- if gt (len .) 3 }}
+ <li class="post-card__tags-item post-card__tags-more">
+ <span class="post-card__tags-more-count">
+ +{{ sub (len .) 3 }} {{ lang.Translate "common.more" | default "more" }}
+ </span>
+ </li>
+ {{- end }}
+ </ul>
+ </footer>
+ {{- end }}
+</article>
diff --git a/layouts/partials/list/recent-posts.html b/layouts/partials/list/recent-posts.html
new file mode 100644
index 0000000..c1075e2
--- /dev/null
+++ b/layouts/partials/list/recent-posts.html
@@ -0,0 +1,50 @@
+{{- /*
+List of Recent Posts. Accepts a dict with the following optional parameters:
+
+@context {int} count: Number of posts to display (default: 10).
+@context {string} title: Section title (default: "Recent Articles").
+@context {bool} show_view_all: Whether to show "View All Posts" link (default: true).
+
+@example: {{ partial "list/recent-posts.html" (dict "count" 20 "title" "Latest updates" "show_view_all" true) }}
+*/ -}}
+
+{{- $count := .count | default 10 -}}
+{{- $title := .title | default (lang.Translate "posts.recent" | default "Recent Articles") -}}
+{{- $showViewAll := .show_view_all | default true -}}
+
+<section class="recent-posts" aria-labelledby="recent-posts-heading">
+ <header class="recent-posts__header">
+ <h2 id="recent-posts-heading" class="recent-posts__title">
+ {{ $title }}
+ </h2>
+ </header>
+
+ {{- /* Get published 10 most recent posts */ -}}
+ {{- $recentPosts := where site.RegularPages "Date" "!=" nil }}
+ {{- $recentPosts = where $recentPosts ".Date" "le" now }}
+ {{- $recentPosts = first $count $recentPosts }}
+
+ {{- if $recentPosts }}
+ <div class="recent-posts__content">
+ <ul class="recent-posts__list" role="list">
+ {{- range $recentPosts }}
+ <li class="recent-posts__list-item">
+ {{- partial "list/post-card.html" . }}
+ </li>
+ {{- end }}
+ </ul>
+
+ {{- if $showViewAll }}
+ <a href="{{ with site.GetPage "/posts" }}{{ .RelPermalink }}{{ else }}/posts/{{ end }}" class="recent_posts__view-all-link">
+ {{ lang.Translate "posts.view_all" | default "View all posts" }}
+ </a>
+ {{- end }}
+ </div>
+ {{ else }}
+ <div class="recent-posts__empty">
+ <p class="recent_posts__empty-message">
+ {{ lang.Translate "list.empty" | default "No posts in this section." }}
+ </p>
+ </div>
+ {{- end }}
+</section>
diff --git a/layouts/partials/navmenu.html b/layouts/partials/navmenu.html
index 05fd64f..91e53b3 100644
--- a/layouts/partials/navmenu.html
+++ b/layouts/partials/navmenu.html
@@ -1,45 +1,49 @@
{{- /*
+Simplified version of the `hugo new template` menu.html default
Renders a menu for the given menu ID.
-@context {page} page The current page.
-@context {string} menuID The menu ID.
+@context {page} page: The current page.
+@context {string} menuID: The menu ID.
@example: {{ partial "navmenu.html" (dict "menuID" "main" "page" .) }}
*/}}
-{{- $page := .page }}
+{{- $currentPage := .page }}
{{- $menuID := .menuID }}
{{- with index site.Menus $menuID }}
- <nav role="navigation" aria-label="{{ i18n "mainNavigation" | default "Main navigation" }}">
- <ul>
- {{ range . }}
- {{- $attrs := dict "href" .URL }}
- {{- if $page.IsMenuCurrent .Menu . }}
- {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
- {{- else if $page.HasMenuCurrent .Menu .}}
- {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
- {{- end }}
- {{- $name := .Name }}
+<nav role="navigation" aria-label="{{ lang.Translate "header.navmenu" | default "Site navigation" }}" class="header__navigation">
+ <ul class="header__navigation-list">
+ {{- range . }}
+ {{- $isCurrentPage := $currentPage.IsMenuCurrent .Menu . }}
+ {{- $isAncestorPage := $currentPage.HasMenuCurrent .Menu . }}
+ {{- $isActive := or $isCurrentPage $isAncestorPage }}
+ {{- $menuItemName := .Name }}
+
+ {{- $attrs := dict "href" .URL }}
+ {{- if $currentPage.IsMenuCurrent .Menu . }}
+ {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
+ {{- else if $currentPage.HasMenuCurrent .Menu .}}
+ {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
+ {{- end }}
+
<!-- Translations -->
{{- with .Identifier }}
- {{- with T . }}
- {{- $name = . }}
+ {{- with lang.Translate . }}
+ {{- $menuItemName = . }}
{{- end }}
{{- end }}
- <li>
+
+ <li class="header__navigation--list-item">
<a
- {{- range $k, $v := $attrs }}
- {{- with $v }}
- {{- printf " %s=%q" $k $v | safeHTMLAttr }}
- {{- end }}
- {{- end -}}
+ href="{{ .URL }}"
+ class="header__navigation-link{{ if $isActive }} header__navigation-link--active{{ end }}"
+ aria-current="{{ if $isCurrentPage }}page{{ else if $isAncestorPage }}true{{ end }}"
>
- {{ $name }}
+ {{ $menuItemName }}
</a>
</li>
- {{- end }}
- </ul>
- </nav>
-{{- end }}
-
+ {{- end }}
+ </ul>
+</nav>
+{{- end -}}
diff --git a/layouts/partials/single/next-prev.html b/layouts/partials/single/next-prev.html
new file mode 100644
index 0000000..c938990
--- /dev/null
+++ b/layouts/partials/single/next-prev.html
@@ -0,0 +1,30 @@
+{{- /* Navigation for Next and Previous Post */ -}}
+<nav class="post__navigation" aria-label="{{ lang.Translate "post.navigation" | default "Post navigation" }}">
+ <ul class="post__navigation-list">
+ {{- with .PrevInSection }}
+ <li class="post__navigation-prev">
+ <a href="{{ .RelPermalink }}" class="post__navigation-link" rel="prev">
+ <span class="post__navigation-label">
+ {{ lang.Translate "post.previous" | default "Previous post:" }}
+ </span>
+ <span class="post__navigation-title">
+ {{ .Title }}
+ </span>
+ </a>
+ </li>
+ {{- end }}
+
+ {{- with .NextInSection }}
+ <li class="post__navigation-next">
+ <a href="{{ .RelPermalink }}" class="post__navigation-link" rel="next">
+ <span class="post__navigation-label">
+ {{ lang.Translate "post.next" | default "Next post:" }}
+ </span>
+ <span class="post__navigation-title">
+ {{ .Title }}
+ </span>
+ </a>
+ </li>
+ {{- end }}
+ </ul>
+</nav>
diff --git a/layouts/partials/single/tags.html b/layouts/partials/single/tags.html
new file mode 100644
index 0000000..e90b909
--- /dev/null
+++ b/layouts/partials/single/tags.html
@@ -0,0 +1,17 @@
+{{- with .GetTerms "tags" }}
+<section class="post__tags" aria-labelledby="tags-heading">
+ <h2 id="tags-heading" class="post__tags-heading">
+ {{ lang.Translate "tags.name" | default "Tags" }}
+ </h2>
+
+ <ul class="post__tags-list">
+ {{- range . }}
+ <li class="post__tags-item">
+ <a href="{{ .RelPermalink }}" class="post__tags-link" rel="tag">
+ {{ .Title }}
+ </a>
+ </li>
+ {{- end }}
+ </ul>
+</section>
+{{- end }}
diff --git a/layouts/tags/list.html b/layouts/tags/list.html
new file mode 100644
index 0000000..d3af0e4
--- /dev/null
+++ b/layouts/tags/list.html
@@ -0,0 +1,37 @@
+{{- /* List of All Tags */ -}}
+{{- define "main" }}
+<article class="tags-index">
+ <header class="tags-index__header">
+ <h1 class="tags-index__headline">
+ {{ lang.Translate "tags.all" | default "All Tags" }}
+ </h1>
+ <p class="tags-index__description">
+ {{ lang.Translate "tags.overview_all" | default "Overview of all topics covered on this site." }}
+ </p>
+ </header>
+
+ <section class="tags-index__content" aria-label="{{ lang.Translate "tags.all" | default "All Tags" }}">
+ {{- with site.Taxonomies.tags }}
+ {{ $tags := .Alphabetical }}
+ <ul class="tags-index__list">
+ {{- range $tags }}
+ <li class="tags-index__item">
+ <a href="{{ .Page.RelPermalink }}" class="tags-index__link" rel="tag">
+ <span class="tags-index__name">
+ {{ .Page.Title }}
+ </span>
+ <span class="tags-index__count" aria-label="{{ lang.Translate "tags.postcount_title" | default "Number of posts" }}">
+ ({{ .Count }})
+ </span>
+ </a>
+ </li>
+ {{- end }}
+ </ul>
+ {{- else }}
+ <p class="tags-index__empty">
+ {{ lang.Translate "tags.empty" | default "No tags found." }}
+ </p>
+ {{- end }}
+ </section>
+</article>
+{{- end }}
diff --git a/layouts/tags/term.html b/layouts/tags/term.html
new file mode 100644
index 0000000..e107123
--- /dev/null
+++ b/layouts/tags/term.html
@@ -0,0 +1,42 @@
+{{- /* List of All Articles for a Specific Tag */ -}}
+{{- define "main" }}
+<article class="tag-page">
+ <header class="tag-page__header">
+ <h1 class="tag-page__headline">
+ <span class="tag-page__label">
+ {{ lang.Translate "tags.tagged_with" | default "Tagged with:" }}
+ </span>
+ <span class="tag-page__name">
+ #{{ .Title }}
+ </span>
+ </h1>
+ <p class="tag-page__count">
+ {{ lang.Translate "tags.postcount_number" .Pages.Len | default (printf "%d posts found" .Pages.Len) }}
+ </p>
+ </header>
+
+ <section class="tag-page__content" aria-label="{{ lang.Translate "tags.posts_list" | default "Posts with this tag:" }}">
+ {{- with .Pages }}
+ <ul class="tag-page__posts">
+ {{- range . }}
+ <li class="tag-page__post">
+ {{- partial "list/post-card.html" . }}
+ </li>
+ {{- end }}
+ </ul>
+ {{- else }}
+ <p class="tag-page__empty">
+ {{ lang.Translate "tags.no_posts" | default "No posts found with this tag." }}
+ </p>
+ {{- end }}
+ </section>
+
+ <footer class="tag-page__footer">
+ <nav class="tag-page__navigation" aria-label="{{ lang.Translate "tags.navigation" | default "Tag navigation" }}">
+ <a href="{{ "/tags/" | relURL }}" class="tag-page__back-link">
+ ← {{ lang.Translate "tags.all_tags" | default "All tags" }}
+ </a>
+ </nav>
+ </footer>
+</article>
+{{- end }}