aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2024-03-25 21:36:21 +0000
committerMartin Ashby <martin@ashbysoft.com>2024-03-25 21:36:21 +0000
commit92787c159262a57fa20b2eb05ed710e1e6cfca96 (patch)
tree508cab2af110a063767564571a98d157926bfb05 /layouts
parente12c0d23ad72ffa9389d90311453db535f57e450 (diff)
downloadmfashby.net-92787c159262a57fa20b2eb05ed710e1e6cfca96.tar.gz
mfashby.net-92787c159262a57fa20b2eb05ed710e1e6cfca96.tar.bz2
mfashby.net-92787c159262a57fa20b2eb05ed710e1e6cfca96.tar.xz
mfashby.net-92787c159262a57fa20b2eb05ed710e1e6cfca96.zip
Final conversion to Zine
Diffstat (limited to 'layouts')
-rw-r--r--layouts/list.html6
-rw-r--r--layouts/rss.xml20
-rw-r--r--layouts/single.html16
-rw-r--r--layouts/templates/main.html19
4 files changed, 41 insertions, 20 deletions
diff --git a/layouts/list.html b/layouts/list.html
index f0329d5..ce3b64e 100644
--- a/layouts/list.html
+++ b/layouts/list.html
@@ -4,9 +4,9 @@
<p var="$page.content"></p>
- <ul>
- <li loop="$site.pages()">
- <span class="date" var="$loop.it.date.format('02-Jan-2006')"></span>
+ <ul loop="$page.subpages()">
+ <li>
+ <span class="date" var="$loop.it.date.format('2006/01/02')"></span>
<a href="$loop.it.permalink()" var="$loop.it.title"></a>
</li>
</ul>
diff --git a/layouts/rss.xml b/layouts/rss.xml
new file mode 100644
index 0000000..349f8f0
--- /dev/null
+++ b/layouts/rss.xml
@@ -0,0 +1,20 @@
+<rss version="2.0"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/">
+ <channel>
+ <title>Home on mfashby.net</title>
+ <link>https://mfashby.net/</link>
+ <description>Recent content in Home on mfashby.net</description>
+ <language>en-gb</language>
+ <lastBuildDate>Sun, 03 Mar 2024 19:31:27 +0000</lastBuildDate>
+ <atom:link href="https://mfashby.net/index.xml" rel="self" type="application/rss+xml"/>
+ <item inline-loop="$page.subpages()">
+ <title var="$loop.it.title"></title>
+ <link var="$loop.it.permalink()"></link>
+ <pubDate var="$loop.it.date.formatHTTP()"></pubDate>
+ <guid isPermaLink="true" var="$loop.it.permalink()"></guid>
+ <description var="$loop.it.description"></description>
+ <content:encoded var="$loop.it.content"></content:encoded> <!-- This doesn't work, an empty tag is emitted -->
+ </item>
+ </channel>
+</rss> \ No newline at end of file
diff --git a/layouts/single.html b/layouts/single.html
index 4a8a12f..971b664 100644
--- a/layouts/single.html
+++ b/layouts/single.html
@@ -1,8 +1,16 @@
-<extend template="main.html">
+<extend template="main.html"/>
<div id="main">
<div class="article-meta">
- <h1><span class="title" var=$page.title></span></h1>
+ <h1><span class="title" var="$page.title"></span></h1>
</div>
+
<main var="$page.content"></main>
-</div>
-<extend> \ No newline at end of file
+
+ <footer>
+ <div class="article-meta">
+ <span class="author">Author <span var="$page.author"></span></span><br/>
+ <span>Updated <span class="date" var="$page.date.format('2006/01/02')"></span></span><br/>
+ </div>
+ </footer>
+
+</div> \ No newline at end of file
diff --git a/layouts/templates/main.html b/layouts/templates/main.html
index 917bdce..5a4dd1f 100644
--- a/layouts/templates/main.html
+++ b/layouts/templates/main.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode }}">
+<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -11,9 +11,9 @@
<body>
<nav>
<ul class="menu">
- <li><a href="/">home</a></li>
- <li><a href="/">about</a></li>
- <li><a href="/">rss</a></li>
+ <li><a href="/posts">home</a></li>
+ <li><a href="/about">about</a></li>
+ <li><a href="/index.xml">rss</a></li>
</ul>
<hr/>
</nav>
@@ -23,14 +23,7 @@
</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" }}
+ <div if="$page.custom.get('comments', false)">
<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>
@@ -53,7 +46,7 @@
});
</script>
<noscript>Comments disabled without javascript!</noscript>
- {{ end }}
+ </div>
</footer>
</body>
</html>