summaryrefslogtreecommitdiffstats
path: root/themes
diff options
context:
space:
mode:
Diffstat (limited to 'themes')
-rw-r--r--themes/aoidh/assets/aoidh.css183
-rw-r--r--themes/aoidh/hugo.toml4
-rw-r--r--themes/aoidh/layouts/_partials/footer.html17
-rw-r--r--themes/aoidh/layouts/_partials/head.html6
-rw-r--r--themes/aoidh/layouts/_partials/header.html1
-rw-r--r--themes/aoidh/layouts/_partials/menu.html40
-rw-r--r--themes/aoidh/layouts/_partials/terms.html23
7 files changed, 274 insertions, 0 deletions
diff --git a/themes/aoidh/assets/aoidh.css b/themes/aoidh/assets/aoidh.css
new file mode 100644
index 0000000..51571f5
--- /dev/null
+++ b/themes/aoidh/assets/aoidh.css
@@ -0,0 +1,183 @@
+:root {
+ --paper-color: #ffffea;
+ --light-yellow: #eeee9e;
+ --dark-yellow: #99994c;
+ --light-blue: #eaffff;
+ --dark-blue: #8888cc;
+ --light-gray: #eee;
+ --dark-gray: #888;
+
+ --parspace: .6em;
+}
+
+html {
+ background: var(--light-gray);
+}
+
+body {
+ margin: 1rem auto;
+ padding: .5rem 1rem .25rem;
+ max-width: 60rem;
+ border: 1px solid var(--dark-yellow);
+ box-shadow: 2px 2px var(--dark-yellow);
+}
+
+body {
+ line-height: 1.35em;
+ font-family: serif;
+ text-rendering: optimizeLegibility;
+ color: #000;
+ background: #fff;
+}
+
+.content {
+ margin-left: auto;
+ margin-right: auto;
+ max-width: 45rem;
+}
+
+header {
+ margin-bottom: 2rem;
+}
+
+nav ul {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
+ gap: .4rem .8rem;
+ padding: 0;
+}
+
+nav li {
+ display: inline-block;
+}
+
+nav a {
+ display: inline-block;
+ width: 100%;
+ text-align: center;
+ vertical-align: middle;
+ white-space: nowrap;
+ color: #000;
+ border: .1rem solid var(--dark-blue);
+ box-shadow: .1rem .1rem var(--dark-blue);
+}
+
+li.nav-active a {
+ font-weight: bold;
+ box-shadow: .2rem .2rem var(--dark-yellow);
+}
+
+li.nav-ancestor a {
+ font-weight: bold;
+}
+
+nav a:active {
+ box-shadow: 0 0;
+}
+
+p {
+ text-align: justify;
+ hyphens: auto;
+ text-justify: inter-word;
+ margin-top: 0;
+ margin-bottom: var(--parspace);
+}
+
+a {
+ text-decoration: none;
+ border: 1px solid transparent;
+}
+
+a:hover {
+ text-decoration: none;
+ color: #000;
+ background: var(--light-blue);
+}
+
+a:active {
+ text-decoration: none;
+ color: #000;
+ background: var(--light-blue);
+ border: 1px solid var(--dark-blue);
+}
+
+.title {
+ font-size: 1.4rem;
+}
+
+h1 {
+ font-size: 1.3rem;
+}
+
+h2 {
+ font-size: 1.2rem;
+}
+
+h3 {
+ font-size: 1.1rem;
+}
+
+h1, h2, h3 {
+ margin-block-end: .4em; /* above */
+ margin-block-start: .8em; /* below */
+}
+
+table {
+ border-collapse: collapse;
+ text-align: left;
+ margin-bottom: 1rem;
+}
+
+thead tr {
+ border: 1px solid #000;
+ background: var(--light-blue);
+}
+
+tbody tr {
+ border: 1px solid var(--dark-gray);
+}
+
+th, td {
+ padding: .15rem .6rem .15rem;
+ vertical-align: middle;
+}
+
+footer hr {
+ margin-top: 2rem;
+ margin-bottom: .4rem;
+}
+
+footer p {
+ font-size: 90%;
+ text-align: left;
+}
+
+hr {
+ border-top: .1rem solid #000;
+}
+
+blockquote {
+ width: 80%;
+ margin: 0 auto var(--parspace) auto;
+}
+
+cite {
+ display: block;
+ text-align: right
+}
+
+img {
+ display: block;
+ margin: auto;
+}
+
+div {
+ margin-bottom: var(--parspace);
+}
+
+ul {
+ margin: 0;
+ margin-block: 0 var(--parspace);
+ padding: 0;
+ padding-inline-start: 2em;
+}
diff --git a/themes/aoidh/hugo.toml b/themes/aoidh/hugo.toml
new file mode 100644
index 0000000..1410ef9
--- /dev/null
+++ b/themes/aoidh/hugo.toml
@@ -0,0 +1,4 @@
+[module]
+ [module.hugoVersion]
+ extended = false
+ min = '0.146.0'
diff --git a/themes/aoidh/layouts/_partials/footer.html b/themes/aoidh/layouts/_partials/footer.html
new file mode 100644
index 0000000..91d4a34
--- /dev/null
+++ b/themes/aoidh/layouts/_partials/footer.html
@@ -0,0 +1,17 @@
+<hr>
+<p>
+{{- with index (sort .Site.RegularPages "Date" "asc") 0 -}}
+ {{ $epoch := .Date }}
+ {{- with index (sort .Site.Pages "Lastmod" "desc") 0 -}}
+ {{ $lastMod := .Lastmod }}
+ {{- if gt $lastMod.Year $epoch.Year -}}
+ Copyright {{ $epoch.Year -}}&ndash;{{- $lastMod.Year -}}
+ {{- else -}}
+ Copyright {{ $epoch.Year -}}
+ {{- end -}}
+ {{- end -}}
+{{- end -}}
+{{- with .Site.Params.author.name -}}
+ , {{ . }}
+{{- end -}}
+. All rights reserved.</p>
diff --git a/themes/aoidh/layouts/_partials/head.html b/themes/aoidh/layouts/_partials/head.html
new file mode 100644
index 0000000..c72c8c5
--- /dev/null
+++ b/themes/aoidh/layouts/_partials/head.html
@@ -0,0 +1,6 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width">
+<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
+{{- with resources.Get "aoidh.css" }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+{{- end }}
diff --git a/themes/aoidh/layouts/_partials/header.html b/themes/aoidh/layouts/_partials/header.html
new file mode 100644
index 0000000..8995308
--- /dev/null
+++ b/themes/aoidh/layouts/_partials/header.html
@@ -0,0 +1 @@
+{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
diff --git a/themes/aoidh/layouts/_partials/menu.html b/themes/aoidh/layouts/_partials/menu.html
new file mode 100644
index 0000000..ba80749
--- /dev/null
+++ b/themes/aoidh/layouts/_partials/menu.html
@@ -0,0 +1,40 @@
+{{- /*
+Renders a menu for the given menu ID.
+
+@context {page} page The current page.
+@context {string} menuID The menu ID.
+
+@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
+*/}}
+
+{{- $page := .page }}
+{{- $menuID := .menuID }}
+
+{{- with index site.Menus $menuID }}
+ <nav>
+ <ul>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ </nav>
+{{- end }}
+
+{{- define "_partials/inline/menu/walk.html" }}
+ {{- $page := .page }}
+ {{- range .menuEntries }}
+ <li
+ {{- if $page.IsMenuCurrent .Menu . -}}
+ {{- printf " class=%q" "nav-active" | safeHTMLAttr -}}
+ {{- else if $page.HasMenuCurrent .Menu . -}}
+ {{- printf " class=%q" "nav-ancestor" | safeHTMLAttr -}}
+ {{- end -}}>
+ <a
+ {{ printf "href=%q" .URL | safeHTMLAttr }}
+ >{{ .Name }}</a>
+ {{- with .Children }}
+ <ul>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ {{- end }}
+ </li>
+ {{- end }}
+{{- end }}
diff --git a/themes/aoidh/layouts/_partials/terms.html b/themes/aoidh/layouts/_partials/terms.html
new file mode 100644
index 0000000..8a6ebec
--- /dev/null
+++ b/themes/aoidh/layouts/_partials/terms.html
@@ -0,0 +1,23 @@
+{{- /*
+For a given taxonomy, renders a list of terms assigned to the page.
+
+@context {page} page The current page.
+@context {string} taxonomy The taxonomy.
+
+@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+*/}}
+
+{{- $page := .page }}
+{{- $taxonomy := .taxonomy }}
+
+{{- with $page.GetTerms $taxonomy }}
+ {{- $label := (index . 0).Parent.LinkTitle }}
+ <div>
+ <div>{{ $label }}:</div>
+ <ul>
+ {{- range . }}
+ <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
+ {{- end }}
+ </ul>
+ </div>
+{{- end }}