aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2019-09-12 18:49:03 -0400
committerGitHub <noreply@github.com>2019-09-12 18:49:03 -0400
commit7a302eb69bfef1ecd0a17e16085bd4359a0ae717 (patch)
treefc6d777b3c4f2af57951f0921de8a334ad4cfee8 /templates
parent2007492c492be3c32b19fbfcc6b6c1a5cc5ef0e0 (diff)
downloadxesite-7a302eb69bfef1ecd0a17e16085bd4359a0ae717.tar.xz
xesite-7a302eb69bfef1ecd0a17e16085bd4359a0ae717.zip
Series and tags (#74)
* initial support for tags and series * tagging support * oops * Update main.go
Diffstat (limited to 'templates')
-rw-r--r--templates/blogindex.html2
-rw-r--r--templates/blogpost.html11
-rw-r--r--templates/series.html16
-rw-r--r--templates/serieslist.html16
4 files changed, 45 insertions, 0 deletions
diff --git a/templates/blogindex.html b/templates/blogindex.html
index 3e8159a..917eb39 100644
--- a/templates/blogindex.html
+++ b/templates/blogindex.html
@@ -7,6 +7,8 @@
<p>If you have a compatible reader, be sure to check out my <a href="/blog.rss">RSS Feed</a> for automatic updates. Also check out the <a href="/blog.json">JSONFeed</a>.</p>
+<p>For a breakdown by post series, see <a href="/blog/series">here</a>.</p>
+
<p>
<ul>
{{ range . }}
diff --git a/templates/blogpost.html b/templates/blogpost.html
index 61a4b38..00cd399 100644
--- a/templates/blogpost.html
+++ b/templates/blogpost.html
@@ -55,6 +55,14 @@
<p>This article was posted on {{ .Date }}. Facts and circumstances may have changed since publication. Please <a href="/contact">contact me</a> before jumping to conclusions if something seems wrong or unclear.</p>
+{{ if ne .Series "" }}
+<p>Series: <a href="/blog/series/{{ .Series }}">{{ .Series }}</a></p>
+{{ end }}
+
+{{ if ne .Tags "" }}
+<p>Tags:{{.Tags}}</p>
+{{ end }}
+
<script>
// The actual function. Set this as an onclick function for your "Share on Mastodon" button
@@ -91,6 +99,9 @@ function share_on_mastodon() {
// Hashtags
var hashtags = "#blogpost";
+ {{ if ne .Series "" }}hashtags += " #{{ .Series }}";{{ end }}
+ {{ if ne .Tags "" }}hashtags += "{{ .Tags }}";{{ end }}
+
// Tagging users, such as offical accounts or the author of the post
var author = "@cadey@mst3k.interlinked.me";
diff --git a/templates/series.html b/templates/series.html
new file mode 100644
index 0000000..8d2ed89
--- /dev/null
+++ b/templates/series.html
@@ -0,0 +1,16 @@
+{{ define "title" }}
+<title>Blog Series - Christine Dodrill</title>
+{{ end }}
+
+{{ define "content" }}
+<h1>Series</h1>
+
+<p>
+ <ul>
+ {{ range . }}
+ <li><a href="/blog/series/{{ . }}">{{ . }}</a></li>
+ {{ end }}
+ </ul>
+</p>
+
+{{ end }}
diff --git a/templates/serieslist.html b/templates/serieslist.html
new file mode 100644
index 0000000..d3d0ac2
--- /dev/null
+++ b/templates/serieslist.html
@@ -0,0 +1,16 @@
+{{ define "title" }}
+<title>Blog {{.Name}} - Christine Dodrill</title>
+{{ end }}
+
+{{ define "content" }}
+<h1>Series: {{ .Name }}</h1>
+
+<p>
+ <ul>
+ {{ range .Posts }}
+ <li>{{ .DateString }} - <a href="/{{ .Link }}">{{ .Title }}</a></li>
+ {{ end }}
+ </ul>
+</p>
+
+{{ end }}