diff options
| author | Arne Rief <riearn@proton.me> | 2026-01-09 12:24:05 +0100 |
|---|---|---|
| committer | Arne Rief <riearn@proton.me> | 2026-01-09 12:24:05 +0100 |
| commit | f8541ef965ca22e746b523eb418e47cb4f78f2d8 (patch) | |
| tree | 49e1540ed42595a44196817eadf97337587a2aea /layouts/_default | |
| parent | 038054b8206a9c25e84adeb0f0f355abd22d6143 (diff) | |
Upgrade to new template system from Hugo v0.146.0
Diffstat (limited to 'layouts/_default')
| -rw-r--r-- | layouts/_default/all-posts.html | 36 | ||||
| -rw-r--r-- | layouts/_default/baseof.html | 53 | ||||
| -rw-r--r-- | layouts/_default/home.html | 24 | ||||
| -rw-r--r-- | layouts/_default/list.html | 39 | ||||
| -rw-r--r-- | layouts/_default/search.html | 70 | ||||
| -rw-r--r-- | layouts/_default/single.html | 23 |
6 files changed, 0 insertions, 245 deletions
diff --git a/layouts/_default/all-posts.html b/layouts/_default/all-posts.html deleted file mode 100644 index 4a94ab6..0000000 --- a/layouts/_default/all-posts.html +++ /dev/null @@ -1,36 +0,0 @@ -{{ define "main" }} -<section class="search-page"> - <header class="all-posts__header"> - <h1 class="all-posts__heading"> - {{ .Title }} - </h1> - {{- with .Content }} - <div class="all-posts__description"> - {{ . }} - </div> - {{- else }} - {{- $description := or .Description (lang.Translate "posts_all_description" | default "All posts on this website, from newest to oldest.") }} - <p class="all-posts__description"> - {{ $description }} - </p> - {{- end }} - </header> - - {{ $allPosts := where site.RegularPages "Params.excludeFromLists" "!=" true }} - {{- if $allPosts }} - <div class="all-posts__content"> - <ul class="all-posts__list" role="list"> - {{- range $allPosts.ByDate.Reverse }} - <li class="all-posts__list-item"> - {{ partial "list/post-card.html" (dict "post" . "show_section" true) }} - </li> - {{- end }} - </ul> - </div> - {{ else }} - <p class="all-posts__empty-message"> - {{ lang.Translate "posts_empty" | default "This site does not have any posts yet." }} - </p> - {{- end }} -</section> -{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html deleted file mode 100644 index 99f09d9..0000000 --- a/layouts/_default/baseof.html +++ /dev/null @@ -1,53 +0,0 @@ -<!DOCTYPE html> -<html lang="{{ .Language.LanguageCode }}" dir="{{ .Language.LanguageDirection | default "ltr" }}"> - <head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>{{ block "title" . }}{{ if and (not .IsHome) .Title }}{{ .Title }} | {{ end }}{{ site.Title }}{{ end }}</title> - - {{- with .Description }} - <meta name="description" content="{{ . }}"> - {{- else }} - {{- if or .IsPage .IsSection}} - <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 }} - {{- end }} - - <meta name="generator" content="Hugo {{ hugo.Version }}"> - <link rel="canonical" href="{{ .Permalink }}"> - - {{- if .IsTranslated }} - {{- range .Translations }} - <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"> - {{- end }} - {{- end }} - - {{- with .OutputFormats.Get "rss" }} - {{- printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} - {{- end }} - - {{- partial "head/meta.html" . }} - {{- partial "head/seo.html" . }} - <!-- Prevent FOUC, default light mode --> - <script> - const storedTheme = localStorage.getItem("theme"); - const prefDarkmode = window.matchMedia("(prefers-color-scheme: dark)").matches; - document.documentElement.setAttribute("data-theme", storedTheme ?? (prefDarkmode ? "dark" : "light")); - </script> - {{- partialCached "head/css.html" . }} - {{ partialCached "head/js.html" . }} - </head> - - <body class="{{ .Type | default "page" }}"> - {{ partial "header.html" . }} - {{ partial "navmenu.html" (dict "menuID" "main" "page" .) }} - - <main id="main-content" class="site__main" role="main"> - {{ block "main" . }}{{ end }} - </main> - - {{ partial "footer.html" . }} - </body> -</html> diff --git a/layouts/_default/home.html b/layouts/_default/home.html deleted file mode 100644 index 880f124..0000000 --- a/layouts/_default/home.html +++ /dev/null @@ -1,24 +0,0 @@ -{{- define "main" }} -<div class="homepage"> - <header class="homepage__header"> - <h1 class="homepage__header-title"> - {{ with .Title }}{{ . }}{{ else }}{{ site.Title | default "Welcome to my Blog!" }}{{ end }} - </h1> - {{- with site.Params.author.portrait }} - <img src="{{ . }}" alt="{{ . }}" class="homepage__header-image" /> - {{- end }} - {{- with .Content }} - <div class="homepage__header-content"> - {{ . }} - </div> - {{- end }} - </header> - - {{- partial "list/recent-posts.html" (dict - "count" 5 - "title" (lang.Translate "posts_recent" | default "Recent Articles") - "show_view_all" true - ) - -}} -</div> -{{- end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html deleted file mode 100644 index f952e56..0000000 --- a/layouts/_default/list.html +++ /dev/null @@ -1,39 +0,0 @@ -{{- define "main" }} -<section class="list-page"> - <header class="list-page__header"> - <h1 class="list-page__headline"> - {{ .Title }} - </h1> - {{- with .Content }} - <div class="list-page__description"> - {{ . }} - </div> - {{- else }} - {{- $description := or .Description .Summary (lang.Translate "list_description" .Title | default (printf "All posts in %s" .Title)) }} - <p class="list-page__description"> - {{ $description }} - </p> - {{- end }} - </header> - - <section class="list-page__content" aria-label="{{ lang.Translate "posts" | default "Posts" }}"> - {{- /* 15 posts per site */ -}} - {{- $paginator := .Paginate .Pages 15 }} - {{- with $paginator.Pages }} - <ul class="list-page__posts-list"> - {{- range . }} - <li class="list-page__post"> - {{- partial "list/post-card.html" (dict "post" .) }} - </li> - {{- end }} - </ul> - {{ else }} - <p class="list-page__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/search.html b/layouts/_default/search.html deleted file mode 100644 index 6004f2e..0000000 --- a/layouts/_default/search.html +++ /dev/null @@ -1,70 +0,0 @@ -{{ define "main" }} -<section class="search-page"> - <header class="search-page__header"> - <h1 class="search-page__heading"> - {{ .Title }} - </h1> - {{- with .Content }} - <div class="search-page__description"> - {{ . }} - </div> - {{- else }} - {{- $description := or .Description (lang.Translate "search_description" | default "Find posts by search term.") }} - <p class="search-page__description"> - {{ $description }} - </p> - {{- end }} - </header> - - <section class="search-page__container" aria-label="{{ lang.Translate "search_label" | default "Search all posts" }}"> - <form id="search-form" class="search-form" role="search" autocomplete="off"> - <label for="search-input" class="search-form__label" hidden> - {{ lang.Translate "search_label" | default "Search all posts" }} - </label> - <div class="search-form__input-wrapper"> - <input - id="search-input" - class="search-form__input" - type="search" - data-index-url="{{ site.Home.RelPermalink }}index.json" - placeholder="{{ lang.Translate "search_placeholder" | default "Type to search..." }}" - /> - <button - id="search-reset" - type="button" - class="search-form__reset" - aria-label="{{ lang.Translate "search_reset" | default "Clear search" }}" - > - <span class="search-clear__icon" aria-hidden="true">×</span> - </button> - </div> - </form> - - </section> - - <div id="search-results" class="search-page__results" aria-live="polite"> - <p class="search-results__count" hidden> - <span id="search-results-number">0</span> - {{ lang.Translate "search_matches" | default "matches" }} - </p> - - <ul class="search-results__list" hidden></ul> - - {{- /* Hidden template, used for hydrating search results from index.json with JS */ -}} - <template id="search-result-template"> - {{- $mockPost := dict - "Title" "TEMPLATE_TITLE" - "RelPermalink" "TEMPLATE_URL" - "Section" "TEMPLATE_SECTION" - "Date" now - "Summary" "TEMPLATE_SUMMARY" - "Params" (dict "tags" (slice "TEMPLATE_TAG")) - -}} - <li class="search-results__list-item"> - {{- partial "list/post-card.html" (dict "post" $mockPost "show_section" true) }} - </li> - </template> - - </div> -</section> -{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html deleted file mode 100644 index e1728d3..0000000 --- a/layouts/_default/single.html +++ /dev/null @@ -1,23 +0,0 @@ -{{- define "main" }} -<article class="post"> - <header class="post__header"> - <h1 class="post__headline"> - {{ .Title }} - </h1> - {{- with .Date }} - <time datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}" class="post__publish-date"> - {{ . | time.Format ":date_medium" }} - </time> - {{- end }} - </header> - - <div class="post__content"> - {{ .Content }} - </div> - - <footer class="post__footer"> - {{ partial "single/tags" . }} - {{ partial "single/next-prev" . }} - </footer> -</article> -{{- end }} |
