From 4f01edb9230f58ff84b0dd892c931ec8ac9aad55 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 13 Sep 2022 12:56:08 +0200 Subject: move src out of srv, clean up default.nix and Makefile --- src/http/tpl/admin.html | 18 +++++ src/http/tpl/assets.html | 57 +++++++++++++++ src/http/tpl/base.html | 28 ++++++++ src/http/tpl/draft-posts.html | 50 +++++++++++++ src/http/tpl/edit-post.html | 142 +++++++++++++++++++++++++++++++++++++ src/http/tpl/finalize.html | 45 ++++++++++++ src/http/tpl/follow.html | 160 ++++++++++++++++++++++++++++++++++++++++++ src/http/tpl/image.html | 5 ++ src/http/tpl/index.html | 37 ++++++++++ src/http/tpl/post.html | 44 ++++++++++++ src/http/tpl/posts.html | 47 +++++++++++++ src/http/tpl/redirect.html | 9 +++ src/http/tpl/unsubscribe.html | 44 ++++++++++++ 13 files changed, 686 insertions(+) create mode 100644 src/http/tpl/admin.html create mode 100644 src/http/tpl/assets.html create mode 100644 src/http/tpl/base.html create mode 100644 src/http/tpl/draft-posts.html create mode 100644 src/http/tpl/edit-post.html create mode 100644 src/http/tpl/finalize.html create mode 100644 src/http/tpl/follow.html create mode 100644 src/http/tpl/image.html create mode 100644 src/http/tpl/index.html create mode 100644 src/http/tpl/post.html create mode 100644 src/http/tpl/posts.html create mode 100644 src/http/tpl/redirect.html create mode 100644 src/http/tpl/unsubscribe.html (limited to 'src/http/tpl') diff --git a/src/http/tpl/admin.html b/src/http/tpl/admin.html new file mode 100644 index 0000000..f2ba4d6 --- /dev/null +++ b/src/http/tpl/admin.html @@ -0,0 +1,18 @@ +{{ define "body" }} + +

Admin

+ +This is a directory of pages which are used for managing blog content. They are +mostly left open to inspection, but you will not able to change +anything without providing credentials. + + + +{{ end }} + +{{ template "base.html" . }} + diff --git a/src/http/tpl/assets.html b/src/http/tpl/assets.html new file mode 100644 index 0000000..f21717a --- /dev/null +++ b/src/http/tpl/assets.html @@ -0,0 +1,57 @@ +{{ define "body" }} + +

+ Back to Admin +

+ +

Assets

+ +

Upload Asset

+ +

+ If the given ID is the same as an existing asset's ID, then that asset will be + overwritten. +

+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +{{ if gt (len .Payload.IDs) 0 }} + +

Existing Assets

+ + + + {{ range .Payload.IDs }} + + + + + {{ end }} + +
{{ . }} +
+ +
+
+ +{{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/base.html b/src/http/tpl/base.html new file mode 100644 index 0000000..f286222 --- /dev/null +++ b/src/http/tpl/base.html @@ -0,0 +1,28 @@ + + + + + + + + + + +
+ Mediocre Blog + by + mediocregopher +    //    + Follow +  /  + RSS +  /  + License +
+ + {{ template "body" . }} + + + + + diff --git a/src/http/tpl/draft-posts.html b/src/http/tpl/draft-posts.html new file mode 100644 index 0000000..53261b9 --- /dev/null +++ b/src/http/tpl/draft-posts.html @@ -0,0 +1,50 @@ +{{ define "body" }} + +

+ Back to Admin +

+ +

Drafts

+ +

+ New Draft +

+ + {{ if ge .Payload.PrevPage 0 }} +

+ < < Previous Page +

+ {{ end }} + + + + {{ range .Payload.Posts }} + + + + + + {{ end }} + +
{{ .Title }} + + Edit + + +
+ +
+
+ + {{ if ge .Payload.NextPage 0 }} +

+ Next Page > > +

+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/edit-post.html b/src/http/tpl/edit-post.html new file mode 100644 index 0000000..f8e2730 --- /dev/null +++ b/src/http/tpl/edit-post.html @@ -0,0 +1,142 @@ +{{ define "body" }} + +

+ {{ if .Payload.IsDraft }} + + Back to Drafts + + {{ else }} + + Back to Posts + + {{ end }} +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Unique ID + + {{ if eq .Payload.Post.ID "" }} + + {{ else if .Payload.IsDraft }} + {{ .Payload.Post.ID }} + + {{ else }} + {{ .Payload.Post.ID }} + + {{ end }} +
Tags (space separated) + + + {{ if gt (len .Payload.Tags) 0 }} + + Existing tags: + {{ range $i, $tag := .Payload.Tags }} + {{ if ne $i 0 }} {{ end }}{{ $tag }} + {{ end }} + + {{ end }} +
Series + +
Title + +
Description + +
+ +

+ +

+ +

+ + + + {{ if .Payload.IsDraft }} + + + + + + + + + {{ else }} + + {{ end }} + +

+ +
+ +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/finalize.html b/src/http/tpl/finalize.html new file mode 100644 index 0000000..8bdfceb --- /dev/null +++ b/src/http/tpl/finalize.html @@ -0,0 +1,45 @@ +{{ define "body" }} + + + + + + + + + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/follow.html b/src/http/tpl/follow.html new file mode 100644 index 0000000..23c30a6 --- /dev/null +++ b/src/http/tpl/follow.html @@ -0,0 +1,160 @@ +{{ define "body" }} + + + +

+ Here's your options for receiving updates about new blog posts: +

+ +

Option 1: Email

+ +

+ Email is by far my preferred option for notifying followers of new posts. +

+ +

+ The entire email list system for this blog, from storing subscriber email + addresses to the email server which sends the notifications out, has been + designed from scratch and is completely self-hosted in my living room. +

+ +

+ I solemnly swear that: +

+ + + +

+ With all that said, if you'd like to receive an email everytime a new blog + post is published then input your email below and smash that subscribe button! + You will need to verify your email, so be sure to check your spam folder to + complete the process if you don't immediately see anything in your inbox. +

+ +

+ Unfortunately Google considers all emails from my mail server to be spam. I'm + tired of seeing the bounce errors on my side, so I'm disabling the ability to + sign up for the mailing list with a GMail address. Sorry (not sorry). +

+ + + +
+ + + +
+ + + +

Option 2: RSS

+ +

+ RSS is the classic way to follow any blog. It comes from a time before + aggregators like reddit and twitter stole the show, when people felt capable + to manage their own content feeds. We should use it again. +

+ +

+ To follow over RSS give any RSS reader the following URL... +

+ +

+ {{ BlogURL "feed.xml" }} +

+ +

+ ...and posts from this blog will show up in your RSS feed as soon as they are + published. There are literally thousands of RSS readers out there. Here's some + recommendations: +

+ + + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/image.html b/src/http/tpl/image.html new file mode 100644 index 0000000..ba9b75d --- /dev/null +++ b/src/http/tpl/image.html @@ -0,0 +1,5 @@ +
+ + + +
diff --git a/src/http/tpl/index.html b/src/http/tpl/index.html new file mode 100644 index 0000000..ce5f264 --- /dev/null +++ b/src/http/tpl/index.html @@ -0,0 +1,37 @@ +{{ define "body" }} + + {{ if ge .Payload.PrevPage 0 }} +

+ < < Previous Page +

+ {{ else }} +

+ Welcome to the Mediocre Blog! Posts are listed in chronological order. If + you aren't sure of where to start I recommend picking at random. +

+ {{ end }} + + + + + + + + {{ range .Payload.Posts }} + + + + + + {{ end }} +
{{ DateTimeFormat .PublishedAt }}{{ .Title }}{{ .Description }}
+ + {{ if ge .Payload.NextPage 0 }} +

+ Next Page > > +

+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/post.html b/src/http/tpl/post.html new file mode 100644 index 0000000..23500eb --- /dev/null +++ b/src/http/tpl/post.html @@ -0,0 +1,44 @@ +{{ define "body" }} + +

+ {{ .Payload.Title }} +

+ +

+ - {{ .Payload.Description }} +

+ +
+ +{{ .Payload.Body }} + +

+ Published {{ DateTimeFormat .Payload.PublishedAt }} + {{ if not .Payload.LastUpdatedAt.IsZero }} +
Last updated {{ DateTimeFormat .Payload.LastUpdatedAt }} + {{ end }} +

+ +{{ if (or .Payload.SeriesPrevious .Payload.SeriesNext) }} +
+

+ This post is part of a series.
+ + {{ if .Payload.SeriesPrevious }} + Previously: {{ .Payload.SeriesPrevious.Title }} + {{ end }} + + {{ if (and .Payload.SeriesNext .Payload.SeriesPrevious) }} +
+ {{ end }} + + {{ if .Payload.SeriesNext }} + Next: {{ .Payload.SeriesNext.Title }}
+ {{ end }} + +

+{{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/posts.html b/src/http/tpl/posts.html new file mode 100644 index 0000000..fbeaa41 --- /dev/null +++ b/src/http/tpl/posts.html @@ -0,0 +1,47 @@ +{{ define "body" }} + +

+ Back to Admin +

+ +

Posts

+ + {{ if ge .Payload.PrevPage 0 }} +

+ < < Previous Page +

+ {{ end }} + + + + {{ range .Payload.Posts }} + + + + + + + {{ end }} + +
{{ .PublishedAt.Local.Format "2006-01-02 15:04:05 MST" }}{{ .Title }} + + Edit + + +
+ +
+
+ + {{ if ge .Payload.NextPage 0 }} +

+ Next Page > > +

+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/src/http/tpl/redirect.html b/src/http/tpl/redirect.html new file mode 100644 index 0000000..a50b324 --- /dev/null +++ b/src/http/tpl/redirect.html @@ -0,0 +1,9 @@ + + + + + + +

Redirecting...

+ + diff --git a/src/http/tpl/unsubscribe.html b/src/http/tpl/unsubscribe.html new file mode 100644 index 0000000..ad01735 --- /dev/null +++ b/src/http/tpl/unsubscribe.html @@ -0,0 +1,44 @@ +{{ define "body" }} + + + + + + + + + +{{ end }} + +{{ template "base.html" . }} -- cgit v1.2.3