diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 11 | ||||
-rw-r--r-- | layouts/_default/single.html | 8 | ||||
-rw-r--r-- | layouts/index.atom.xml | 33 | ||||
-rw-r--r-- | layouts/index.html | 14 | ||||
-rw-r--r-- | layouts/partials/footer.html | 4 | ||||
-rw-r--r-- | layouts/partials/head.html | 9 | ||||
-rw-r--r-- | layouts/partials/header.html | 3 | ||||
-rw-r--r-- | layouts/partials/metadata.html | 9 |
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 }} |