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

@ -1,3 +1,3 @@
# Voidcruiser Hugo theme
Hacked together based on the CSS I used before hugo andm a whole bunch of examples on the internet
Hacked together based on the CSS I used before hugo and a whole bunch of examples on the internet

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="{{ $.Site.Language }}">
<head>
{{ block "title" . }}
<title>{{ if .IsHome }}{{ $.Site.Title }}{{ else }}{{ .Title }} | {{ $.Site.Title }}{{ end }}</title>
{{ end }}
{{ partial "head.html" . }}
</head>
<body>
{{ partial "logo.html" . }}
{{ partial "menu.html" . }}
<h1 class="page-head">{{ .Title | markdownify }}</h1>
<main>
{{ block "main" . }}
{{ end }}
</main>
{{ block "footer" . }}
{{ partial "footer.html" . }}
{{ end }}
</body>
</html>

View file

@ -0,0 +1,53 @@
{{ define "main" }}
{{ .Content -}}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $PageContext := . }}
{{ if .IsHome }}
{{ $PageContext = .Site }}
{{ end }}
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
<article class="post on-list">
<div class="post-meta">
{{ if .Params.Date }}
<span>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<span> - </span>
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
{{ if $.Site.Params.showLastUpdated }}
{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }}
</span>
{{ end }}
{{ with .Params.Author }}
<span> - </span>
<span class="post-author">{{ . }}</span>
{{ end }}
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
<span class="post-reading-time">- {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
{{ end }}
</span>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</div>
</article>
{{ end }}
{{ partial "pagination.html" . }}
{{ partial "stickers.html" . }}
</div>
{{ end }}

View file

@ -1,13 +1,45 @@
{{ partial "header.html" . -}}
<h1 class="page-head">{{ .Title }}</h1>
<main>
{{ define "main" }}
{{ if .Content }}
<article>
{{ .Content -}}
<ul>
{{- range.Pages }}
<li><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006 Jan 02" }}</time> &ndash; <a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end -}}
</ul>
{{ .Content -}}
</article>
</main>
{{- partial "footer.html" . }}
{{ end }}
<div class="posts">
{{ range .Paginator.Pages }}
<div class="post-meta">
{{ if .Params.Date }}
<span>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<span> - </span>
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
{{ if $.Site.Params.showLastUpdated }}
{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }}
</span>
{{ end }}
{{ with .Params.Author }}
<span> - </span>
<span class="post-author">{{ . }}</span>
{{ end }}
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
<span class="post-reading-time">- {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
{{ end }}
</span>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}

View file

@ -1,26 +1,39 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- 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>{{ .Site.Title }}</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>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.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 }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{- .Content | html -}}</description>
</item>
{{ end }}
</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>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.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 }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

26
layouts/_default/rss2.xml Normal file
View file

@ -0,0 +1,26 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ .Site.Title }}</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>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.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 }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{- .Content | html -}}</description>
</item>
{{ end }}
</channel>
</rss>

View file

@ -1,6 +1,51 @@
{{ partial "header.html" . -}}
<h1 class="page-head">{{ .Title }}</h1>
<main>
{{ .Content -}}
</main>
{{ partial "footer.html" . }}
{{ define "main" }}
{{ if eq .Type $.Site.Params.contentTypeName }}
<div class="post-meta">
{{ if .Params.Date }}
<span>
<span class="post-date">
{{ .Date.Format "2006-01-02" }}
{{ if $.Site.Params.showLastUpdated }}
[{{or $.Site.Params.updatedDatePrefix "Updated"}}: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }}
</span>
{{ end }}
{{ with .Params.Author }}
<span> - </span>
<span class="post-author">{{ . }}</span>
{{ end }}
{{ if and (.Param "readingTime") (eq (.Param "readingTime") true) }}
<span class="post-reading-time">- {{ .ReadingTime }} min read ({{ .WordCount }} words)</span>
{{ end }}
</span>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
</div>
{{ end }}
{{ if (.Params.Toc | default .Site.Params.Toc) }}
<div class="table-of-contents">
<h2>
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
</h2>
{{ .TableOfContents }}
</div>
{{ end }}
<div class="post-content">
{{ .Content }}
</div>
{{ if eq .Type $.Site.Params.contentTypeName }}
{{ partial "posts_pagination.html" . }}
{{ end }}
</div>
{{ end }}

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 }}

View file

@ -1 +0,0 @@
<article>

View file

@ -0,0 +1 @@
<b class="gay">{{ .Get "content" }}</b>

View file

@ -0,0 +1 @@
<b class="gay"><i>{{ .Get "content" }}</i></b>

View file

@ -1 +0,0 @@
</article>

View file

@ -0,0 +1 @@
<span class="gay">{{ .Get "content" }}</span>

View file

@ -1,10 +0,0 @@
<details>
<summary>Click to reveal video.</summary>
<iframe src="{{ index .Params 0 }}"
loading="lazy"
sandbox="allow-same-origin allow-scripts allow-popups"
allowfullscreen frameborder="0"
class="embvid"
title="Embedded Video">
</iframe>
</details>

View file

@ -0,0 +1 @@
<i class="gay">{{ .Get "content" }}</i>

View file

@ -0,0 +1,4 @@
<noscript>
<hr />
<p class="gay">{{ .Get "content" }}</p>
</noscript>

View file

@ -1 +0,0 @@
{{ .TableOfContents }}

View file

@ -1,6 +0,0 @@
<iframe src="{{ index .Params 0 }}"
loading="lazy"
sandbox="allow-same-origin allow-scripts allow-popups"
allowfullscreen frameborder="0"
title="Embedded Video">
</iframe>

BIN
static/logoOptimised.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -16,6 +16,8 @@ a:hover::selection{ color: #f0c674; }
audio{ width: 100%; display: block; margin-top: 1em; }
main{ margin-left: 12em; margin-right: 1em; padding: 1em; border:1pt solid; margin-bottom: 1em;}
main h1{border-bottom: 1pt solid;}
main a h1 {border-bottom: transparent 0pt solid;}
li::marker{color: #b294bb;}
/*
article{
padding:1em;
@ -25,6 +27,7 @@ article{
nav{height: 100%;padding: 0.5em; float:left; background: #282a2e; border-right:solid 1pt; border-bottom: solid 1pt; width: 10em;}
nav li{list-style: none; list-style-position:outside;}
nav a{ display: block;}
nav{text-transform: capitalize;}
summary{cursor:pointer;}
summary:hover{ color: #1d1f21; background-color: #f0c674; }
footer{text-align:center; border-top:1pt solid; margin-top: 1em;}
@ -42,10 +45,11 @@ pre{ background: #282a2e; padding: 1em; border-radius: 1em;}
}
.logo a{
color: #eaeaea;
text-decoration: inherit;
text-decoration: none;
}
.logo a:hover{ color: #1d1f21; }
.about ul{list-style:none;}
.about img{height:10em; float:left;}
.about img{height:9em; float:left;}
header{text-transform: capitalize; text-align:center;border-bottom:2pt solid; font-weight:bold;}
.page-head{text-transform: capitalize; text-align:center;border-bottom:2pt solid; font-weight:bold;}
@media (max-width: 800px){
@ -64,6 +68,16 @@ header{text-transform: capitalize; text-align:center;border-bottom:2pt solid; fo
-moz-animation: gay 8s ease-in-out infinite;
-webkit-animation: gay 8s ease-in-out infinite;
}
.post-meta{margin-bottom: .5em; border-bottom: solid 1pt;}
.on-list{color:#c5c6c8;}
.post-meta{color: #c5c6c8; display:flex; justify-content: space-between; }
.post-tags a{text-decoration:none; color:inherit;}
.post-tags a:hover{text-decoration:none; color:#eaeaea; background:inherit;}
.button{padding:.3em;border-radius:.3em;}
.pagination__buttons{display:flex; justify-content:center;}
.pagination__buttons .next::after{content:" →";}
.pagination__buttons .prev::before{content:"← ";}
@keyframes gay {
0%{background-position: 0px 50%;}
50%{background-position: 100% 50%;}