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 |
initial version
Diffstat (limited to 'themes/fredo')
-rw-r--r-- | themes/fredo/assets/Iwona-Regular.otf | bin | 0 -> 151936 bytes | |||
-rw-r--r-- | themes/fredo/assets/favicon.png | bin | 0 -> 9927 bytes | |||
-rw-r--r-- | themes/fredo/assets/style.css | 190 | ||||
-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 |
11 files changed, 359 insertions, 0 deletions
diff --git a/themes/fredo/assets/Iwona-Regular.otf b/themes/fredo/assets/Iwona-Regular.otf Binary files differnew file mode 100644 index 0000000..418a664 --- /dev/null +++ b/themes/fredo/assets/Iwona-Regular.otf diff --git a/themes/fredo/assets/favicon.png b/themes/fredo/assets/favicon.png Binary files differnew file mode 100644 index 0000000..c17b537 --- /dev/null +++ b/themes/fredo/assets/favicon.png diff --git a/themes/fredo/assets/style.css b/themes/fredo/assets/style.css new file mode 100644 index 0000000..2238f88 --- /dev/null +++ b/themes/fredo/assets/style.css @@ -0,0 +1,190 @@ +@font-face { + font-family: 'Iwona'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: local('Iwona-Regular'), url('Iwona-Regular.otf'), format('opentype'); +} + +body { + height: 100%; + max-height: 100%; + font-family: "Iwona"; +/* letter-spacing: 0.01rem; + font-size: 1.8rem; + line-height: 1.75em; + margin: 0;*/ +} + +#logo { + float: left; +} + +#nav { + margin-left: 52px; + margin-top: 0.5rem; +} + +.navlink { + margin: 0.3rem; +} + +.navlink.active { + background-color: aquamarine; +} + + +#topbar { + display: inline-block; +} + + +/* Every post, on every page, gets this style on its <article> tag */ +.post { + /*position: relative;*/ + width: 95%; + max-width: 710px; + margin: 1rem; + margin-left:3rem; + padding-bottom: 1rem; + border-bottom: #000 2px solid; + word-wrap: break-word; + display: inline-block; +} + +.post-title a { + text-decoration: none; + font-size: 1.5rem; +} +.post-excerpt p { + font-size: 0.9em; + line-height: 1.7em; + margin-block-start: 0rem; + margin-block-end: 0rem; +} +.read-more { + text-decoration: none; +} +.post-meta { + display: block; + margin: 2rem 0 0 0; + font-size: 1.5rem; +} +.post-meta a { + text-decoration: none; +} +.post-date { + display: inline-block; + white-space: nowrap; + margin-block-start: 0rem; + margin-block-end: 0rem; +} + +.post-date p{ + margin-block-start: 0rem; + margin-block-end: 0rem; +} +.publish-meta { + position: absolute; + top: 0; + right: 0; + padding: 4.3rem 0 4rem 0; + text-align: right; +} +.publish-heading { + display: block; + font-weight: 700; +} +.publish-date { + display: block; + font-size: 1.4rem; + line-height: 1.5em; +} + +.thumb { + float: left; + width: 240px; +} + +.post-short { + margin-left: 250px; +} + +.post-header h2 { + font-size: 1.2rem; +} +.post-title { + margin-block-start: 0rem; + margin-block-end: 0rem; +} + +.post-excerpt { + margin-top: 0.5rem; + margin-block-start: 0rem; + margin-block-end: 0rem; +} + +.gallery-photo { + max-width: 100%; + object-fit: fill; +} + + +#content { + padding: 3em 4em; + position: relative; +} + +.full { + max-width: 50rem; +} +.full img { + width: 80%; +} + +.full video { + width: 80%; +} + + + +@media screen and (max-width: 600px) { +.thumb { + float: none; + width: 100%; + margin-left: 0rem; +} + +.post { + /*position: relative;*/ + width: 95%; + max-width: 710px; + margin: 1rem; + margin-left:0rem; + padding-bottom: 1rem; + border-bottom: #000 2px solid; + word-wrap: break-word; + display: inline-block; +} + +.post-short { + margin-left: 5px; +} + +#content { + padding: 0em; + position: relative; +} + +.full img { + width: 100%; +} + +.full video { + width: 100%; +} + +.small-figure { + margin: 0rem; +} +}
\ No newline at end of file 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 |