diff options
author | Friedrich Beckmann <friedrich.beckmann@gmx.de> | 2025-06-14 13:48:40 +0200 |
---|---|---|
committer | Friedrich Beckmann <friedrich.beckmann@gmx.de> | 2025-06-14 13:48:40 +0200 |
commit | e4a8a804aa5353bcaa4403da291e02bd9fcd22db (patch) | |
tree | 140e3b62e66c10952392c6c1bb36104d40d4e24a /themes/fredo/layouts |
initial version
Diffstat (limited to 'themes/fredo/layouts')
-rw-r--r-- | themes/fredo/layouts/_markup/render-image.html | 12 | ||||
-rw-r--r-- | themes/fredo/layouts/_partials/nav.html | 20 | ||||
-rw-r--r-- | themes/fredo/layouts/_partials/post-short.html | 40 | ||||
-rw-r--r-- | themes/fredo/layouts/_shortcodes/audio.html | 10 | ||||
-rw-r--r-- | themes/fredo/layouts/_shortcodes/video.html | 6 | ||||
-rw-r--r-- | themes/fredo/layouts/baseof.html | 39 | ||||
-rw-r--r-- | themes/fredo/layouts/list.html | 12 | ||||
-rw-r--r-- | themes/fredo/layouts/single.html | 30 |
8 files changed, 169 insertions, 0 deletions
diff --git a/themes/fredo/layouts/_markup/render-image.html b/themes/fredo/layouts/_markup/render-image.html new file mode 100644 index 0000000..86891e7 --- /dev/null +++ b/themes/fredo/layouts/_markup/render-image.html @@ -0,0 +1,12 @@ +{{ $myimg := resources.Get .Destination }} +{{ if $myimg }} + {{ $myimg := $myimg.Resize "1024x" }} + <figure class="small-figure"> + <picture> + <img alt="{{ .PlainText }}" src="{{ $myimg.RelPermalink }}"> + </picture> + <figcaption class="gallery-caption">{{ .Title }}</figcaption> + </figure> +{{ else }} + {{ errorf "Can not find image: %s" .Destination }} +{{ end }}
\ No newline at end of file diff --git a/themes/fredo/layouts/_partials/nav.html b/themes/fredo/layouts/_partials/nav.html new file mode 100644 index 0000000..583eefe --- /dev/null +++ b/themes/fredo/layouts/_partials/nav.html @@ -0,0 +1,20 @@ +<div id="topbar"> + <div id="logo"> + <a href="/"> + <picture> + <img src="/favicon.png"></img> + </picture> + </a> + </div> + <nav id="nav"> + {{ $currentpage := . }} + {{ range site.Menus.main }} + {{ $url := relLangURL .URL }} + {{ $navlinkclass := "navlink" }} + {{- if or ( $currentpage.IsMenuCurrent "main" .) ( $currentpage.HasMenuCurrent "main" .) }} + {{ $navlinkclass = "navlink active" }} + {{ end }} + <a class={{ $navlinkclass }} href="{{ $url }}">{{ .Name }}</a> + {{ end }} + </nav> +</div> diff --git a/themes/fredo/layouts/_partials/post-short.html b/themes/fredo/layouts/_partials/post-short.html new file mode 100644 index 0000000..808297d --- /dev/null +++ b/themes/fredo/layouts/_partials/post-short.html @@ -0,0 +1,40 @@ +<article class="post"> + <div class="thumb"> + {{ if .Param "image" }} + {{ $imagename := .Param "image" }} + {{ $myimg := resources.Get $imagename }} + {{ if $myimg }} + {{ $myimg := $myimg.Resize "512x" }} + <a class="thumbnail" href="{{ .RelPermalink }}"> + <picture> + <source type="image/jpeg" srcset="{{ $myimg.RelPermalink }}"> + <img class="gallery-photo" alt="{{ .Title }}" src="{{ $myimg.RelPermalink }}"/> + </picture> + </a> + {{ else }} + {{ errorf "Can not find image: %s" $imagename }} + {{ end }} + {{ end }} + </div> + <div class="post-short"> + <section class="post-date"> + {{ $showdate := .Date }} + {{ if .Param "eventdate" }} + {{ $showdate = .Param "eventdate" }} + {{ end }} + <p> {{ $showdate | time.Format ":date_long" }}, + {{ range .Param "bands" }} + <a href="/posts/{{ . }}">{{ . }}</a> + {{ end }} + </p> + </section> + <header class="post-header"> + <h2 class="post-title"> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + </h2> + </header> + <section class="post-excerpt"> + <p>{{ .Param "summary" }}</p> + </section> + </div> +</article> diff --git a/themes/fredo/layouts/_shortcodes/audio.html b/themes/fredo/layouts/_shortcodes/audio.html new file mode 100644 index 0000000..d44de40 --- /dev/null +++ b/themes/fredo/layouts/_shortcodes/audio.html @@ -0,0 +1,10 @@ +<table> +<tr> +<td>{{- .Get "caption" -}}:</td> +<td> +<audio controls> + <source type="audio/mp4" src="{{- .Get "src" -}}"> +</audio> +</td> +</tr> +</table> diff --git a/themes/fredo/layouts/_shortcodes/video.html b/themes/fredo/layouts/_shortcodes/video.html new file mode 100644 index 0000000..debe1d4 --- /dev/null +++ b/themes/fredo/layouts/_shortcodes/video.html @@ -0,0 +1,6 @@ +<figure class="small-figure"> + <video controls> + <source type="video/mp4" src="{{ .Get "src" }}"> + </video> + <figcaption class="gallery-caption">{{ .Get "caption" }}</figcaption> +</figure>
\ No newline at end of file diff --git a/themes/fredo/layouts/baseof.html b/themes/fredo/layouts/baseof.html new file mode 100644 index 0000000..92c0ca3 --- /dev/null +++ b/themes/fredo/layouts/baseof.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html lang="{{ site.Language.LanguageCode }}"> + +<head> + <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <meta charset="utf-8"> + + {{ if .Title }} + <title>{{ site.Title }} | {{ .Title }}</title> + {{ else }} + <title>{{ site.Title }}</title> + {{ end }} + {{ $favicon := resources.Get "favicon.png" }} + <link rel="icon" type="image/png" href="{{ $favicon.Permalink }}" sizes="48x48"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <!-- css, font and favicon are in assets --> + {{ $css := resources.Get "style.css" }} + <link href="{{ $css.Permalink }}" media="screen, projection" rel="stylesheet" type="text/css"> + {{ $font := resources.Get "Iwona-Regular.otf" }} + <link rel="preload" href="{{ $font.Permalink }}" as="font" type="font/otf"> + + + <!-- This tag is necessary since the modern browsers, the pinnacle of human engineering, + trigger CSS transitions on page load without script tags present (Chromium issue 332189, same on FF), + This bug is present since 2012. --> + <script src="/doesnt_exist.js"></script> +</head> +<body> + {{ partial "nav.html" . }} + <main> + <div class="full"> + {{ block "main" . }}{{ end }} + </div> + </main> +</body> + +</html> diff --git a/themes/fredo/layouts/list.html b/themes/fredo/layouts/list.html new file mode 100644 index 0000000..d041c58 --- /dev/null +++ b/themes/fredo/layouts/list.html @@ -0,0 +1,12 @@ +{{ define "main" }} + {{ $pagelist := .RegularPagesRecursive.ByDate.Reverse }} + {{ if .IsHome }} + {{ $pagelist = where .RegularPagesRecursive.ByDate.Reverse "Section" "posts"}} + {{ end }} + {{ range $pagelist }} + {{ partial "post-short.html" . }} + {{ end }} + <article id="content"> + {{ .Content }} + </article> +{{ end }}
\ No newline at end of file diff --git a/themes/fredo/layouts/single.html b/themes/fredo/layouts/single.html new file mode 100644 index 0000000..11efc31 --- /dev/null +++ b/themes/fredo/layouts/single.html @@ -0,0 +1,30 @@ +{{ define "main" }} + <article id="content"> + {{ if eq .Type "posts" }} + <section class="post-date"> + <p> {{ time.Format ":date_long" .PublishDate }} </p> + </section> + {{ end }} + {{ if .Param "Image" }} + {{ $imagename := .Param "image" }} + {{ $myimg := resources.Get $imagename }} + {{ if $myimg }} + {{ $myimg := $myimg.Resize "1024x" }} + <figure class="small-figure"> + <picture> + <source type="image/jpeg" srcset="{{ $myimg.RelPermalink }}"> + <img class="gallery-photo" alt="{{ .Title }}" src="{{ $myimg.RelPermalink }}"/> + </picture> + <figcaption class="gallery-caption">{{ .Param "caption" }}</figcaption> + </figure> + {{ else }} + {{ errorf "Can not find image: %s" $imagename }} + {{ end }} + {{ end }} + + + <h1>{{ .Title }}</h1> + {{ .Content }} + </article> + +{{ end }}
\ No newline at end of file |