about summary refs log tree commit diff stats
path: root/layouts
diff options
context:
space:
mode:
authorAlan Pearce2020-01-06 20:38:53 +0100
committerAlan Pearce2020-01-06 20:38:53 +0100
commit773e2d43f339e9216d7d71d0a21f38f1e36c3f44 (patch)
treefbb7b90665fe715e58b5ab27de3833dc220676a5 /layouts
parent791259ea0c7ad71cde6f464e63b1baf14218d7b9 (diff)
downloadhugo-xmin-773e2d43f339e9216d7d71d0a21f38f1e36c3f44.tar.lz
hugo-xmin-773e2d43f339e9216d7d71d0a21f38f1e36c3f44.tar.zst
hugo-xmin-773e2d43f339e9216d7d71d0a21f38f1e36c3f44.zip
Convert to block-based templates
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html4
-rw-r--r--layouts/_default/baseof.html29
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/single.html4
-rw-r--r--layouts/_default/terms.html4
5 files changed, 36 insertions, 7 deletions
diff --git a/layouts/404.html b/layouts/404.html
index c2e4e40..24a9633 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,5 +1,5 @@
-{{ partial "header.html" . }}
+{{ define "main" }}
 
 404 NOT FOUND
 
-{{ partial "footer.html" . }}
+{{- end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644
index 0000000..100293c
--- /dev/null
+++ b/layouts/_default/baseof.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+  <head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>{{ .Title }} | {{ .Site.Title }}</title>
+    <link rel="stylesheet" href="{{ "/css/style.css" | relURL }}" />
+  </head>
+
+  <body>
+    <nav>
+      <ul class="menu">
+        {{ range .Site.Menus.main }}
+        <li><a href="{{ .URL | relURL }}">{{ .Name }}</a></li>
+        {{ end }}
+      </ul>
+      <hr/>
+    </nav>
+
+    {{ block "main" . }}{{ end }}
+
+    <footer>
+      {{ with .Site.Params.footer }}
+      <hr/>
+      {{ . | markdownify }}
+      {{ end }}
+    </footer>
+  </body>
+</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 7ccfef6..bf0af50 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,4 +1,4 @@
-{{ partial "header.html" . }}
+{{ define "main" }}
 
 {{if not .IsHome }}
 <h1>{{ .Title | markdownify }}</h1>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 0372f1d..bde04ef 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,4 +1,4 @@
-{{ partial "header.html" . }}
+{{ define "main" }}
 <div class="article-meta">
 <h1><span class="title">{{ .Title | markdownify }}</span></h1>
 {{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
@@ -9,4 +9,4 @@
 {{ .Content }}
 </main>
 
-{{ partial "footer.html" . }}
+{{- end }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index 71f47e7..15de7a9 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -1,4 +1,4 @@
-{{ partial "header.html" . }}
+{{ define "main" }}
 
 <h1>{{ .Title }}</h1>
 
@@ -10,4 +10,4 @@
   {{ end }}
 </ul>
 
-{{ partial "footer.html" . }}
+{{- end }}