summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2019-04-29 00:13:49 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2019-04-29 00:13:49 +0100
commit49f746f1ee9205c4028bdc8f18aa888367eb3ddb (patch)
tree8d8b86c72e335a0ebea08e8ed29fb5c7ab439b25 /layouts
parent6de514f5ff850ab90495e3230417cf0883940985 (diff)
Initial site layout
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/baseof.html11
-rw-r--r--layouts/_default/home.html4
-rw-r--r--layouts/_default/posts.html9
-rw-r--r--layouts/_default/shows.html22
-rw-r--r--layouts/_default/single.html21
-rw-r--r--layouts/partials/footer.html2
-rw-r--r--layouts/partials/head.html11
-rw-r--r--layouts/partials/header.html1
-rw-r--r--layouts/partials/nav.html8
-rw-r--r--layouts/shortcodes/posts/recent.html6
-rw-r--r--layouts/shortcodes/shows/recent_episodes.html6
-rw-r--r--layouts/shortcodes/youtube/playlist_url.html1
12 files changed, 102 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..8b980fa
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html lang="en">
+ <head>{{ partial "head.html" . }}</head>
+ <body>
+ <header>{{ partial "header.html" . }}</header>
+ <nav>{{ partial "nav.html" . }}</nav>
+ <main>{{ block "main" . }}{{ end }}</main>
+ <footer>{{ partial "footer.html" . }}</footer>
+ </body>
+</html>
+
diff --git a/layouts/_default/home.html b/layouts/_default/home.html
new file mode 100644
index 0000000..d70be7e
--- /dev/null
+++ b/layouts/_default/home.html
@@ -0,0 +1,4 @@
+{{ define "main" }}
+ {{ .Content }}
+{{ end }}
+
diff --git a/layouts/_default/posts.html b/layouts/_default/posts.html
new file mode 100644
index 0000000..dc0587a
--- /dev/null
+++ b/layouts/_default/posts.html
@@ -0,0 +1,9 @@
+{{ define "main" }}
+ <p>I write posts about programming and Linux topics that are of interest to me.</p>
+ <p>Subscribe to the blog by using this <a href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}">RSS link</a>.</p>
+ <ul>
+ {{ range (where .Data.Pages "Type" "posts") }}
+ <li>{{ .Date.Format "2006-01-01" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+ </ul>
+{{ end }}
diff --git a/layouts/_default/shows.html b/layouts/_default/shows.html
new file mode 100644
index 0000000..404ebc3
--- /dev/null
+++ b/layouts/_default/shows.html
@@ -0,0 +1,22 @@
+{{ define "main" }}
+ {{ if .Sections }}
+ <h2>YouTube Shows</h2>
+ <p>I make and host YouTube shows about programming and Linux.</p>
+ <ul>
+ {{ range sort .Sections "Title" "asc" }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+ </ul>
+ {{ else }}
+ <h2>{{ .Title }}</h2>
+ <p>{{ .Params.Summary }}</p>
+ <p>The YouTube playlist can be found <a href="https://www.youtube.com/playlist?list={{ .Params.PlaylistId }}">here</a>.</p>
+ <p>Subscribe to the show posts by using this <a href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}">RSS link</a>.</p>
+ <h3>Episodes</h3>
+ <ul>
+ {{ range (where .Data.Pages "Type" "shows") }}
+ <li>{{ .Date.Format "2006-01-01" }} - {{ .Title }}. <a href="https://www.youtube.com/watch?v={{ .Params.VideoId }}">Video</a> | <a href="{{ .RelPermalink }}">Post</a></li>
+ {{ end }}
+ </ul>
+ {{ end }}
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..4fc7064
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,21 @@
+{{ define "main" }}
+ <article>
+ <h1>{{ .Title }}</h1>
+ {{ .Content }}
+ </article>
+ {{ if or .NextInSection .PrevInSection }}
+ <nav class="pagination">
+ <hr/>
+ <p>More Episodes</p>
+ <ul>
+ {{ if .PrevInSection }}
+ <li class="prev"><a href="{{ .PrevInSection.Permalink }}">« {{ .PrevInSection.Title }}</a></li>
+ {{ end }}
+ {{ if .NextInSection }}
+ <li class="next"><a href="{{ .NextInSection.Permalink }}">{{ .NextInSection.Title }} »</a></li>
+ {{ end }}
+ </ul>
+ <hr/>
+ </nav>
+ {{ end }}
+{{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..b7245aa
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,2 @@
+© {{ now.Year }} David T. Sadler. Theme adapted from <a href="https://github.com/panr/hugo-theme-terminal/" target="_blank">hugo-theme-terminal</a>.
+
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..1114b12
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,11 @@
+<meta charset="utf-8">
+<title>{{ .Title }} · {{ .Site.Title }}</title>
+<meta name="description" content="{{ .Description }}">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link rel="shortcut icon" href="/img/green.png">
+<link rel="canonical" href="{{ .Permalink }}">
+{{ with .OutputFormats.Get "rss" -}}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+{{ end -}}
+<link rel="stylesheet" href="/css/style.css">
+<link rel="stylesheet" href="/css/syntax.css">
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..0a5998a
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1 @@
+<div><a href="{{ $.Site.BaseURL }}">{{ .Site.Params.Name }}</a></div>
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
new file mode 100644
index 0000000..17e4e8d
--- /dev/null
+++ b/layouts/partials/nav.html
@@ -0,0 +1,8 @@
+<nav>
+ <ul>
+ {{ range .Site.Menus.main }}
+ <li><a href="{{ .URL | relURL }}" title="{{ .Title}}">{{ .Name }}</a></li>
+ {{ end }}
+ </ul>
+</nav>
+
diff --git a/layouts/shortcodes/posts/recent.html b/layouts/shortcodes/posts/recent.html
new file mode 100644
index 0000000..f4b28ca
--- /dev/null
+++ b/layouts/shortcodes/posts/recent.html
@@ -0,0 +1,6 @@
+<ul>
+ {{ range first 5 (where .Site.RegularPages "Section" "posts") }}
+ <li>{{ .Date.Format "2006-01-02" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+</ul>
+
diff --git a/layouts/shortcodes/shows/recent_episodes.html b/layouts/shortcodes/shows/recent_episodes.html
new file mode 100644
index 0000000..fc01a57
--- /dev/null
+++ b/layouts/shortcodes/shows/recent_episodes.html
@@ -0,0 +1,6 @@
+<ul>
+ {{ range first 5 (where (where .Site.RegularPages "Section" "shows") ".Parent.Title" (.Get 0)) }}
+ <li>{{ .Date.Format "2006-01-01" }} - {{ .Title }}. <a href="https://www.youtube.com/watch?v={{ .Params.VideoId }}">Video</a> | <a href="{{ .RelPermalink }}">Post</a></li>
+ {{ end }}
+</ul>
+
diff --git a/layouts/shortcodes/youtube/playlist_url.html b/layouts/shortcodes/youtube/playlist_url.html
new file mode 100644
index 0000000..cfdcf05
--- /dev/null
+++ b/layouts/shortcodes/youtube/playlist_url.html
@@ -0,0 +1 @@
+https://www.youtube.com/playlist?list={{ .Get 0 }}