aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2024-03-04 16:24:45 +0000
committerMartin Ashby <martin@ashbysoft.com>2024-03-10 22:03:45 +0000
commite12c0d23ad72ffa9389d90311453db535f57e450 (patch)
tree00e8caf78140dee2c9af4568d7d2fb083b80b906 /layouts
parent5ed483825a50cadb1d3d2dd55f9e4ebc52716660 (diff)
downloadmfashby.net-e12c0d23ad72ffa9389d90311453db535f57e450.tar.gz
mfashby.net-e12c0d23ad72ffa9389d90311453db535f57e450.tar.bz2
mfashby.net-e12c0d23ad72ffa9389d90311453db535f57e450.tar.xz
mfashby.net-e12c0d23ad72ffa9389d90311453db535f57e450.zip
Prepare to move to zine static site generator instead of hugo
https://zine-ssg.io/documentation/
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html5
-rw-r--r--layouts/list.html13
-rw-r--r--layouts/shortcodes/rawhtml.html3
-rw-r--r--layouts/single.html8
-rw-r--r--layouts/templates/main.html59
-rw-r--r--layouts/video.html (renamed from layouts/shortcodes/video.html)0
6 files changed, 85 insertions, 3 deletions
diff --git a/layouts/404.html b/layouts/404.html
new file mode 100644
index 0000000..c2e4e40
--- /dev/null
+++ b/layouts/404.html
@@ -0,0 +1,5 @@
+{{ partial "header.html" . }}
+
+404 NOT FOUND
+
+{{ partial "footer.html" . }}
diff --git a/layouts/list.html b/layouts/list.html
new file mode 100644
index 0000000..f0329d5
--- /dev/null
+++ b/layouts/list.html
@@ -0,0 +1,13 @@
+<extend template="main.html"/>
+<div id="main">
+ <h1 var="$page.title"></h1>
+
+ <p var="$page.content"></p>
+
+ <ul>
+ <li loop="$site.pages()">
+ <span class="date" var="$loop.it.date.format('02-Jan-2006')"></span>
+ <a href="$loop.it.permalink()" var="$loop.it.title"></a>
+ </li>
+ </ul>
+</div> \ No newline at end of file
diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html
deleted file mode 100644
index 14e0ee9..0000000
--- a/layouts/shortcodes/rawhtml.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- https://anaulin.org/blog/hugo-raw-html-shortcode/ -->
-<!-- raw html -->
-{{.Inner}} \ No newline at end of file
diff --git a/layouts/single.html b/layouts/single.html
new file mode 100644
index 0000000..4a8a12f
--- /dev/null
+++ b/layouts/single.html
@@ -0,0 +1,8 @@
+<extend template="main.html">
+<div id="main">
+ <div class="article-meta">
+ <h1><span class="title" var=$page.title></span></h1>
+ </div>
+ <main var="$page.content"></main>
+</div>
+<extend> \ No newline at end of file
diff --git a/layouts/templates/main.html b/layouts/templates/main.html
new file mode 100644
index 0000000..917bdce
--- /dev/null
+++ b/layouts/templates/main.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title var="$page.title.suffix('|', $site.title)"></title>
+ <link rel="stylesheet" href="/css/style.css"/>
+ <link rel="stylesheet" href="/css/fonts.css"/>
+ </head>
+
+ <body>
+ <nav>
+ <ul class="menu">
+ <li><a href="/">home</a></li>
+ <li><a href="/">about</a></li>
+ <li><a href="/">rss</a></li>
+ </ul>
+ <hr/>
+ </nav>
+
+ <div id="main">
+ <super/>
+ </div>
+
+ <footer>
+ {{ if or (.Params.author) (gt .Params.lastmod 0) }}
+ <div class="article-meta">
+ {{ with .Params.author }}Author <span class="author">{{ . }}</span><br/>{{ end }}
+ {{ if (gt .Params.lastmod 0) }}Updated <span class="date">{{ .Lastmod.Format "January 02, 2006" }}</span><br/>{{ end }}
+ </div>
+ {{ end }}
+
+ {{ if .Param "comments" }}
+ <h2>comments</h2>
+ <div style="visibility: hidden" id="comments">comments go here</div>
+ <div style="visibility: hidden" id="comment_form">comment form goes here</div>
+ <script>
+ let comments = document.getElementById("comments");
+ let urlParam = new URLSearchParams();
+ urlParam.append("url", document.location.href);
+ fetch(document.location.origin + "/api/comment?" + urlParam.toString())
+ .then((response) => response.text())
+ .then((data) => {
+ comments.innerHTML = data;
+ comments.style.visibility = "visible";
+ });
+ let form = document.getElementById("comment_form");
+ fetch(document.location.origin + "/api/form?" + urlParam.toString())
+ .then((response) => response.text())
+ .then((data) => {
+ form.innerHTML = data;
+ form.style.visibility = "visible";
+ });
+ </script>
+ <noscript>Comments disabled without javascript!</noscript>
+ {{ end }}
+ </footer>
+ </body>
+</html>
diff --git a/layouts/shortcodes/video.html b/layouts/video.html
index eba4d66..eba4d66 100644
--- a/layouts/shortcodes/video.html
+++ b/layouts/video.html