Proper theme basis

This commit is contained in:
Nox Sluijtman 2022-08-18 14:17:23 +02:00
parent f474eb76e0
commit 9b0b8dfcf1
27 changed files with 318 additions and 102 deletions

View file

@ -0,0 +1,24 @@
{{- $cover := false -}}
{{- $autoCover := default $.Site.Params.autoCover false }}
{{- if index .Params "cover" -}}
{{- if .Resources.GetMatch .Params.Cover }}
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
{{- else -}}
{{- $cover = absURL .Params.Cover -}}
{{- end -}}
{{- else if $.Site.Params.AutoCover -}}
{{- if (not .Params.Cover) -}}
{{- if .Resources.GetMatch "cover.*" -}}
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{if $cover -}}
<!-- Cover image found -->
<img src="{{ $cover }}"
class="post-cover"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
{{- end }}

View file

@ -1,5 +1,3 @@
<!--{{ partial "nextprev.html" . -}}
{{ partial "taglist.html" . -}}-->
<footer>
<div class="mirror">[<a href="http://fxawfamgojpoxxgzmmjiro4wx4eycempujmryk6miz4a64ljl6sz7dqd.onion">onion</a>|<a href="http://lmwr2pugnmv4pkkxlneeepi4oysfly33zfuj7x25s6hfydysnpfq.b32.i2p">i2p</a>|<a href="http://[201:e2aa:7c70:666b:9a28:6406:be7f:bf0d]">yggdrasil</a>]
<a rel="lisence" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="CC BY-SA 4.0" src="/stickers/cc4.png"></a>
@ -7,5 +5,3 @@
<!--<a href="/index.xml"><img src="/rss.svg" style="max-height:1em" alt="RSS Feed" title="Subscribe via RSS for updates."></a>-->
</div>
</footer>
</body>
</html>

View file

@ -1,8 +1,4 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language }}">
<head>
<title>{{ if not .IsHome }}{{ .Title | title }} | {{ end }}{{ .Site.Title }}</title>
<!--<title>{{ .Title }} | {{ .Site.Title }}</title>-->
<link rel="canonical" href="{{ .Site.BaseURL }}">
<link rel='alternate' type='application/rss+xml' title="{{ .Site.Title }} RSS" href='/index.xml'>
<link rel='stylesheet' type='text/css' href='/style.css'>
@ -15,7 +11,3 @@
<meta name="robots" content="index, follow">
<meta charset="utf-8">
</head>
<body>
{{ partial "logo.html" . }}
<!--<h1 class="logo" id="{{ .Site.Title }}">{{ .Site.Title | title }}</h1>-->
{{ partial "menu.html" . }}

View file

@ -1,8 +1,14 @@
<nav class="menu">
<a href="/">Home</a>
<a href="/">home </a>
{{ range $.Site.Menus.main }}
{{ if not .HasChildren }}
<a href="{{ .URL }}">{{ .Name }}</a>
<a href="{{ .URL }}">{{ .Name }} </a>
{{ end }}
{{ end }}
<hr />
{{ range $.Site.Menus.services }}
{{ if not .HasChildren }}
<a href="{{ .URL }}">{{ .Name }} </a>
{{ end }}
{{ end }}
</nav>

View file

@ -1,13 +0,0 @@
<nav>
<details open="">
<summary>Nav</summary>
<a href="/">Home</a>
{{- $sec := .Page.Section }}{{ $file := .File.TranslationBaseName -}}
{{ range.Site.Menus.main.ByWeight }}{{ $base := path.Base .URL }}
<li><a {{ if or ( eq $sec $base ) ( eq $file $base ) ( and (eq $sec "") ( eq $file "_index") (eq $base "/") ) }}class="menuactive" {{ end }}href="{{ .URL }}"><span class=pre>{{ .Pre }}</span><span class=menuname>{{ .Name }}</span></a></li>
{{- end }}
{{ range .Site.RegularPages }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ end }}
</details>
</nav>

View file

@ -0,0 +1,20 @@
<div class="pagination">
<div class="pagination__buttons">
{{ if .Paginator.HasPrev }}
<span class="button prev">
<a href="{{ .Paginator.Prev.URL }}">
<span class="button__icon"></span>
<span class="button__text">{{ $.Site.Params.newerPosts | default "Newer posts" }}</span>
</a>
</span>
{{ end }}
{{ if .Paginator.HasNext }}
<span class="button next">
<a href="{{ .Paginator.Next.URL }}">
<span class="button__text">{{ $.Site.Params.olderPosts | default "Older posts" }}</span>
<span class="button__icon"></span>
</a>
</span>
{{ end }}
</div>
</div>

View file

@ -0,0 +1,10 @@
{{ if or .NextInSection .PrevInSection }}
<div class="pagination__buttons">
{{ if .NextInSection }}
<a class="button prev" href="{{ .NextInSection.Permalink }}">{{ .NextInSection.Title }}</a>
{{ end }}
{{ if .PrevInSection }}
<a class="button next" href="{{ .PrevInSection.Permalink }}">{{ .PrevInSection.Title }}</a>
{{ end }}
</div>
{{ end }}

View file

@ -1,13 +0,0 @@
{{- if isset .Params "tags" -}}
{{- $tagsLen := len .Params.tags -}}
{{- if gt $tagsLen 0 -}}
<div style="clear:both" class=taglist>
{{- with .Site.Params.relatedtext }}{{ . }}<br>{{ end -}}
{{- range $k, $v := .Params.tags -}}
{{- $url := printf "tags/%s" (. | urlize | lower) -}}
<a id="tag_{{ . | lower }}" href="{{ $url | absURL }}">{{ . | title }}</a>
{{- if lt $k (sub $tagsLen 1) }} &middot; {{ end -}}
{{- end -}}
</div>
{{- end -}}
{{- end }}