summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2021-12-15 10:45:58 +0100
committerPatrick Spek <p.spek@tyil.nl>2021-12-15 10:45:58 +0100
commit5c086bc52fa3a226bcf706b1f420a5d98ea377dd (patch)
treeda5b28238542247efbe36c49cbc6cfd4e49f3e36 /layouts
parent64e0495846f8b680288280920cba6bcb28e4092f (diff)
Redo most of the blog in Hugo
Missing posts will have to be added later
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html47
-rw-r--r--layouts/_default/section.html19
-rw-r--r--layouts/_default/term.html19
-rw-r--r--layouts/home.html21
-rw-r--r--layouts/posts/list.html20
-rw-r--r--layouts/posts/single.html20
-rw-r--r--layouts/shortcodes/admonition.html8
-rw-r--r--layouts/shortcodes/quote.html10
8 files changed, 164 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..a3478ab
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,47 @@
+{{- $cssMain := resources.Get "theme/main.scss" | resources.ToCSS | fingerprint -}}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <link rel="stylesheet" type="text/css" href="{{ $cssMain.Permalink }}">
+
+ {{ range .AlternativeOutputFormats -}}
+ <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" title="{{ $.Site.Title }}" href="{{ .Permalink }}">
+ {{ end }}
+
+ <title>{{ .Page.Title }} - {{ .Site.Title }}</title>
+ </head>
+ <body>
+ {{ block "body" . }}
+ <header id="site-header">
+ <div class="container">
+ <nav>
+ <a href="/" class="brand-name">{{ .Site.Title }}</a>
+ <a href="/posts/">Blog</a>
+ </nav>
+ </div>
+ </header>
+ <main id="site-main">
+ <div class="container">
+ {{ block "main" . }}{{ end }}
+ </div>
+ </main>
+ <footer id="site-footer">
+ <div class="container">
+ <hr>
+ <p>&copy; 2016 - {{ now.Year }} &ndash; Patrick "tyil" Spek</p>
+ <p>
+ All content is licensed as per the license shown below
+ that content. All other sources (html, css, ...) are
+ released under the terms of the <a
+ href="https://www.gnu.org/licenses/gpl-3.0.txt">GNU GPL,
+ version 3</a> or later.
+ </p>
+ </div>
+ </footer>
+ {{ end }}
+ </body>
+</html>
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
new file mode 100644
index 0000000..144b79a
--- /dev/null
+++ b/layouts/_default/section.html
@@ -0,0 +1,19 @@
+{{ define "main" }}
+<h1>{{ .Title }}</h1>
+{{ .Content }}
+<ul>
+ {{ range .Paginator.Pages }}
+ <li>
+ <a href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ <small>
+ {{ .Date | dateFormat "2006-01-02" }}
+ {{- range .Params.tags }}
+ <a href="/tags/{{ . | lower }}">#{{ . }}</a>
+ {{- end }}
+ </small>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/_default/term.html b/layouts/_default/term.html
new file mode 100644
index 0000000..ee63c70
--- /dev/null
+++ b/layouts/_default/term.html
@@ -0,0 +1,19 @@
+{{ define "main" }}
+<h1>Posts tagged with #{{ .Title }}</h1>
+{{ .Content }}
+<ul>
+ {{ range .Paginator.Pages }}
+ <li>
+ <a href="{{ .Permalink }}">
+ {{ .Title }}
+ </a>
+ <small>
+ {{ .Date | dateFormat "2006-01-02" }}
+ {{- range .Params.tags }}
+ <a href="/tags/{{ . | lower }}">#{{ . }}</a>
+ {{- end }}
+ </small>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/home.html b/layouts/home.html
new file mode 100644
index 0000000..aa5df28
--- /dev/null
+++ b/layouts/home.html
@@ -0,0 +1,21 @@
+{{ define "main" }}
+<article>
+ <header>
+ <h1>
+ {{ .Page.Title }}
+ </h1>
+ <small>
+ </small>
+ </header>
+ <main>
+ {{ .Content }}
+ </main>
+ <footer>
+ <p class="text-center">
+ <a class="image-link" rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
+ <img alt="Creative Commons License" style="border-width:0" src="/img/cc-by-sa.png" />
+ </a>
+ </p>
+ </footer>
+</article>
+{{ end }}
diff --git a/layouts/posts/list.html b/layouts/posts/list.html
new file mode 100644
index 0000000..1bacf24
--- /dev/null
+++ b/layouts/posts/list.html
@@ -0,0 +1,20 @@
+{{ define "main" }}
+<h1>{{ .Title }}</h1>
+{{ .Content }}
+{{ range .Sections }}
+ <h2>{{ .Title }}</h2>
+ <ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <small>
+ {{ .Date | dateFormat "2006-01-02" }}
+ {{- range .Params.tags }}
+ <a href="/tags/{{ . | lower }}">#{{ . }}</a>
+ {{- end }}
+ </small>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
+{{ end }}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
new file mode 100644
index 0000000..cb63cbf
--- /dev/null
+++ b/layouts/posts/single.html
@@ -0,0 +1,20 @@
+{{ define "main" }}
+<article>
+ <header>
+ <h1>{{ .Title }}</h1>
+ {{- range .Params.tags }}
+ <a href="/tags/{{ . | lower }}">#{{ . }}</a>
+ {{- end }}
+ </header>
+ <main>
+ {{ .Content }}
+ </main>
+ <footer>
+ <p class="text-center">
+ <a class="image-link" rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
+ <img alt="Creative Commons License" style="border-width:0" src="/img/cc-by-sa.png">
+ </a>
+ </p>
+ </footer>
+</article>
+{{ end }}
diff --git a/layouts/shortcodes/admonition.html b/layouts/shortcodes/admonition.html
new file mode 100644
index 0000000..f25b9ff
--- /dev/null
+++ b/layouts/shortcodes/admonition.html
@@ -0,0 +1,8 @@
+<section class="admonition">
+ <div class="admonition-title">
+ {{ .Get "title" }}
+ </div>
+ <div class="admonition-content">
+ {{ .Inner | .Page.RenderString }}
+ </div>
+</section>
diff --git a/layouts/shortcodes/quote.html b/layouts/shortcodes/quote.html
new file mode 100644
index 0000000..f2d9c4c
--- /dev/null
+++ b/layouts/shortcodes/quote.html
@@ -0,0 +1,10 @@
+<div class="quoteblock">
+ <blockquote>
+ <div class="paragraph">
+ {{ .Inner | .Page.RenderString }}
+ </div>
+ </blockquote>
+ <div class="attribution">
+ — {{ .Get "attribution" }}
+ </div>
+</div>