summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicksphere.ch>2022-04-28 00:00:00 +0000
committerNicholas Johnson <nick@nicksphere.ch>2022-04-28 00:00:00 +0000
commitb1efd00585f84abc397a040852b67c31d36d177d44367a7581afd3e4389b6fd2 (patch)
tree20ff16d4b8db72a0f387faf722fc1534440678d8cd6663111ec052bde04718d4 /layouts
Initial commit
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html11
-rw-r--r--layouts/_default/single.html8
-rw-r--r--layouts/index.atom.xml33
-rw-r--r--layouts/index.html14
-rw-r--r--layouts/partials/footer.html4
-rw-r--r--layouts/partials/head.html9
-rw-r--r--layouts/partials/header.html3
-rw-r--r--layouts/partials/metadata.html9
8 files changed, 91 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..7bfd004
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ {{ partial "head.html" . }}
+ <body>
+ {{ partial "header.html" . }}
+ <content>
+ {{ block "main" . }}{{ end }}
+ </content>
+ {{ partial "footer.html" . }}
+ </body>
+</html>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..7c58c1a
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,8 @@
+{{ define "main" }}
+<nav>
+<p><a href="/" rel="noreferrer">Return to homepage</a></p>
+</nav>
+<content>
+ {{ .Content }}
+</content>
+{{ end }}
diff --git a/layouts/index.atom.xml b/layouts/index.atom.xml
new file mode 100644
index 0000000..7cb8ae6
--- /dev/null
+++ b/layouts/index.atom.xml
@@ -0,0 +1,33 @@
+{{ $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 -}}
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
+ <link href="{{ .Permalink }}atom.xml" rel="self"/>
+ <link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
+ <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
+ <id>{{ .Permalink }}</id>
+ <author>
+ <name>{{ $.Site.Author.name }}</name>
+ <email>{{ $.Site.Author.email }}</email>
+ </author>
+ <generator>Hugo -- gohugo.io</generator>{{ range $pages }}
+ <entry>
+ {{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
+ <link href="{{ .Permalink }}"/>
+ <id>{{ .Permalink }}</id>
+ <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
+ {{- if .Content }}
+ {{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>
+ {{- end }}
+ </entry>{{ end }}
+</feed>
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644
index 0000000..38c3c81
--- /dev/null
+++ b/layouts/index.html
@@ -0,0 +1,14 @@
+{{ define "main" }}
+<h1>{{ .Site.Params.indexTitle }}</h1>
+<p>{{ .Site.Params.indexIntro }}</p>
+<h2>Navigation Links</h2>
+<nav>
+ <p>
+ {{- range .Site.Menus.main }}
+ <a href="{{ .URL }}" rel="noreferrer">{{ .Name }}</a><br>
+ {{- end }}
+ </p>
+</nav>
+<h2>Journal Entries</h2>
+{{ partial "metadata.html" . }}
+{{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..673e170
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,4 @@
+<footer>
+ <p>Unless otherwise noted, the writing in this journal is licensed under {{ $.Site.Copyright }}<br>
+Copyright {{ .Site.Params.beginCopyrightYear }}-{{ now.Format "2006" }} {{ $.Site.Author.name }}</p>
+</footer>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..2e5db26
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,9 @@
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" content="{{ $.Site.Params.description }}">
+ <meta name="keywords" content="{{ $.Site.Params.keywords }}">
+ <meta name="theme-color" content="#000">
+ <link rel="stylesheet" type="text/css" href="/css/style.css">
+ <title>{{ $.Site.Title }}</title>
+</head>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..391a013
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,3 @@
+<header>
+ <pre>{{ $.Site.Params.logo }}</pre>
+</header>
diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html
new file mode 100644
index 0000000..36ae6fb
--- /dev/null
+++ b/layouts/partials/metadata.html
@@ -0,0 +1,9 @@
+{{ range (where .Site.RegularPages.ByTitle "Section" "post").ByPublishDate.Reverse }}
+{{ $dateFormat := .Site.Params.dateFormat | default "2 Jan 2006" }}
+<article>
+ <header>
+ <p>{{ .PublishDate.Format $dateFormat }} - {{ .ReadingTime }} minute read<br>
+ <a href="{{ .RelPermalink }}" rel="noreferrer">{{ .Title }}</a></p>
+ </header>
+</article>
+{{ end }}