diff options
author | User Mms <mms@voyager.local> | 2024-10-13 21:57:58 +0200 |
---|---|---|
committer | User Mms <mms@voyager.local> | 2024-10-13 21:57:58 +0200 |
commit | 87992468e1dedcc8a5d765f87738f18dce671845 (patch) | |
tree | f4d9e4d62f10600d663c128ce5c60a716a186128 /themes/24-unification/layouts | |
parent | 4b42bc22ff8dc4eb3a13fab32441f091f431fb99 (diff) |
feat: more of new site
Diffstat (limited to 'themes/24-unification/layouts')
-rw-r--r-- | themes/24-unification/layouts/_default/baseof.html | 297 | ||||
-rw-r--r-- | themes/24-unification/layouts/_default/list.html | 38 | ||||
-rw-r--r-- | themes/24-unification/layouts/_default/rss.xml | 81 | ||||
-rw-r--r-- | themes/24-unification/layouts/_default/single.html | 4 |
4 files changed, 420 insertions, 0 deletions
diff --git a/themes/24-unification/layouts/_default/baseof.html b/themes/24-unification/layouts/_default/baseof.html new file mode 100644 index 0000000..c484d92 --- /dev/null +++ b/themes/24-unification/layouts/_default/baseof.html @@ -0,0 +1,297 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta charset="utf-8"> + <title> {{ .Page.Title }} </title> + + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <meta property="fediverse:creator" content="@mms@emacs.ch"> + <link rel="me" href="https://emacs.ch/@mms"> + + {{- $header_rect := resources.Get "blog/logo/right.png" }} + {{- $header_rect_180 := $header_rect.Resize "180x webp q90"}} + <link rel="apple-touch-icon" sizes="180x180" href="{{ $header_rect_180.Permalink }}"> + + {{- $header_rect_32 := $header_rect.Resize "32x webp q90"}} + <link rel="icon" type="image/png" sizes="32x32" href="{{ $header_rect_32.Permalink }}"> + + {{- $header_rect_16 := $header_rect.Resize "16x webp q90"}} + <link rel="icon" type="image/png" sizes="16x16" href="{{ $header_rect_16.Permalink }}"> + + <meta name="description" content="{{ .Params.Abstract | default .Site.Params.DefaultDescription}}"> + + <meta property="og:title" content="{{ .Page.Title }}"> + <meta property="og:type" content="website"> + <meta property="og:url" content="{{ .Permalink }}"> + + {{- $imageUrl := default "blog/logo/right.png" .Params.image }} + {{- $image := resources.Get $imageUrl }} + <meta property="og:image" content="{{ $image.Permalink }}"> + + + <meta property="og:description" content="{{ .Params.Abstract | default .Site.Params.DefaultDescription}}"> + + <link rel="canonical" href="{{ .Permalink }}"> + <link rel='alternate' type='application/rss+xml' title="Feed with all changes" href='/index.xml'> + <link rel='alternate' type='application/rss+xml' title="Feed with Unix History changes" href='/unix-history/index.xml'> + <meta name="robots" content="index, follow"> + + <link rel="webmention" href="https://webmention.io/d-s.sh/webmention"> + <link rel="pingback" href="https://webmention.io/d-s.sh/xmlrpc"> + + <style> + :root { + --bg-color: #738276; + --panel-color: #DBD7D2; + --panel-meta-color: #C2BFBC; + --text-color: #000; + --cool-border: 5px groove #000; + + --bg-nav-section: #AAA6A1; + --bg-active-nav-section: #000; + + --button-emph-bg: #807B75; + + --breakpoint: 800px; + } + body { + width: 1000px; + margin-left: auto; + margin-right: auto; + margin-top: 20px; + background-color: var(--bg-color); + background-image: linear-gradient(0deg, #738276 25%, #4a524b 25%, #4a524b 50%, #738276 50%, #738276 75%, #4a524b 75%, #4a524b 100%); + background-size: 8.00px 8.00px; + color: var(--text-color); + background-attachment: fixed; + max-width: 98%; + font-family: serif; + font-size: 1.0em; + display: flex; + flex-direction: row; + } + + @media only screen and (max-width: 800px) { + body { + flex-direction: column; + } + } + + a { + color: var(--text-color); + } + + /* Left navigation */ + + .nav { + flex-shrink: 0; + flex-grow: 0; + width: 200px; + + .nav-box { + border: var(--cool-border); + } + .logo { + width: 100%; + background-color: var(--panel-color); + border-bottom: var(--cool-border); + text-align: center; + padding-bottom: 10px; + padding-top: 10px; + box-sizing: border-box; + } + .name { + background-color: var(--panel-color); + border-bottom: var(--cool-border); + text-align: center; + padding-bottom: 5px; + padding-top: 5px; + background-size: 30px; + + a { + border: 0!important; + } + } + + ol { + list-style: none; + margin: 0; + padding: 0; + } + + li { + box-sizing: border-box; + background-color: var(--bg-nav-section); + } + + ol.section { + li a{ + border-bottom: var(--cool-border); + border-left: 0; + border-right: 0; + border-top: 0; + display: block; + width: 192px; + padding: 5px; + box-sizing: border-box; + } + > li:hover { + background-color: var(--button-emph-bg); + } + li:last-child a{ + border-bottom: 0; + } + } + + ol.subsection { + background-color: var(--panel-color); + box-sizing: border-box; + padding-left: 20px; + border-bottom: var(--cool-border); + li { + background-color: var(--panel-color); + border: 0; + padding: 3px; + } + + + li a { + border: 0; + } + } + + .webbuttons { + text-align: center; + margin-top: 20px; + } + } + + @media only screen and (max-width: 800px) { + .logo { + display: none; + } + + .nav { + width: 100%; + padding-bottom: 20px;; + + .nav-box { + width: 100%; + border: 0; + } + + ol.section { + display: flex; + flex-direction: row; + flex-wrap: wrap; + } + + ol.subsection { + display: none; + } + + li { + flex-shrink: 1; + border: var(--cool-border)!important; + padding: 5px; + + a { + width: 100%!important; + border: 0!important; + } + } + } + + .webbuttons { + display: none; + } + + } + + main { + padding-left: 20px; + box-sizing: border-box; + + article { + background-color: var(--panel-color); + margin-bottom: 20px; + border: var(--cool-border); + padding: 20px; + } + + img { + max-width: 100%; + height: auto; + + } + } + + @media only screen and (max-width: 800px) { + main { + padding: 0; + } + } + </style> + </head> + + <body> + + <nav class="nav"> + +<div class="nav-box"> + <div class="logo"> + {{ partial "blog/face-game.html" . }} + </div> + + + {{- with index site.Menus "sections" }} + <ol class="section"> + <li class="name"><a href="/"><b>CRYS</b>SITE</a></li> + + {{- range . }} +{{ . }} + <li><a href="{{ .URL }}">{{ .Name }}</a> + {{- with index site.Menus .Params.submenu }} + <ol class="subsection"> + {{- range .}} + <li><a href="{{ .URL}}">{{ .Name }}</a></li> + {{- end}} + </ol> + + {{- end}} + </li> + + {{- end}} + </ol> + {{- end}} + + <!-- <li class="active"><a href="/blog">Blog</a> --> + <!-- <ol class="subsection"> --> + <!-- <li>Archive --> + <!-- <ol> --> + <!-- <li><a href="/blog/2024">2024</a></li> --> + <!-- <li><a href="/blog/2024">2024</a></li> --> + <!-- <li><a href="/blog/2024">2024</a></li> --> + <!-- </ol> --> + <!-- </ol> --> + <!-- </li> --> + +</div> + + <div class="webbuttons"> + {{ partial "button-31" (dict "file" "rss.gif" "alt" "RSS Feed" "href" "https://michal.sapka.me/blog/index.xml") }} + {{ partial "button-31" (dict "file" "openbsd.gif" "alt" "RSS Feed" "href" "https://michal.sapka.me/blog/index.xml") }} + {{ partial "button-31" (dict "file" "openbsd.gif" "alt" "RSS Feed" "href" "https://michal.sapka.me/blog/index.xml") }} + {{ partial "button-31" (dict "file" "openbsd.gif" "alt" "RSS Feed" "href" "https://michal.sapka.me/blog/index.xml") }} + </div> + + </nav> + + <main> + {{ block "main" . }} + {{ end }} + </main> +</body> + diff --git a/themes/24-unification/layouts/_default/list.html b/themes/24-unification/layouts/_default/list.html new file mode 100644 index 0000000..58cb880 --- /dev/null +++ b/themes/24-unification/layouts/_default/list.html @@ -0,0 +1,38 @@ +{{ define "main" }} + +{{if .Page.Content}} +<article> + {{ .Page.Content }} + </article> +{{ else }} +{{ $paginator := .Paginate .Site.RegularPages.ByDate.Reverse 10 }} + +{{ range $paginator.Pages }} +{{ if eq .Section "blog" }} +{{ partial "partials/blog/full-post.html" . }} +{{ else }} +{{ partial "partials/blog/cross-site-post.html" . }} +{{ end }} +{{ end }} + +<nav class="blog-pages-list"> + Pages: + {{ if $paginator.HasPrev }} + <span>[ <a href="{{ $paginator.Prev.URL}}">previous</a> ]</span> + {{ end }} + + {{ range seq $paginator.TotalPages }} + {{ if eq . $paginator.PageNumber }} + <span class="current"> {{. }} </span> + {{ else }} + <a href="/blog/page/{{ . }}/">{{ . }}</a> + {{ end }} + {{ end }} + + {{ if $paginator.HasNext }} + <span>[ <a href="{{ $paginator.Next.URL}}">Next</a> ]</span> + {{ end }} +</nav> + +{{end}} +{{end}} diff --git a/themes/24-unification/layouts/_default/rss.xml b/themes/24-unification/layouts/_default/rss.xml new file mode 100644 index 0000000..fa34bd5 --- /dev/null +++ b/themes/24-unification/layouts/_default/rss.xml @@ -0,0 +1,81 @@ +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if $.IsHome }} +{{- $pages = $pctx.RegularPages}} +{{- else if $.IsSection }} +{{- $pages = $pctx.RegularPagesRecursive}} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator> + <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }} + <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }} + <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }} + <copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }} + <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages.ByPublishDate.Reverse}} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }} + <guid>{{ crypto.MD5 .Date }}</guid> + <description> + {{ if in .Page.Params.Categories "blog" }} + {{ safeHTML "<![CDATA[" }}{{ replace .Content "\n\n" "\n" | safeHTML }} + <hr><p style="font-style:italic">Reply via <a href="https://michal.sapka.me/me/contact/">email</a></p>]]> + {{ else }} + {{ safeHTML "<![CDATA[" }}{{ partial "external_link" . }} + <hr><p style="font-style:italic">Reply via <a href="https://michal.sapka.me/me/contact/">email</a></p>]]> + {{ end }} + </description> + </item> + {{- end }} + </channel> +</rss> diff --git a/themes/24-unification/layouts/_default/single.html b/themes/24-unification/layouts/_default/single.html new file mode 100644 index 0000000..fdfcdd4 --- /dev/null +++ b/themes/24-unification/layouts/_default/single.html @@ -0,0 +1,4 @@ +{{ define "main" }} +{{ partial "partials/blog/full-post.html" . }} + +{{- end }} |