From 09acb111a2b22f5794541fac175b024dd0f9100e Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 20 May 2022 11:17:31 -0600 Subject: Rename api package to http --- srv/src/http/tpl/assets.html | 51 ++++++++++++++ srv/src/http/tpl/base.html | 66 +++++++++++++++++ srv/src/http/tpl/edit-post.html | 101 ++++++++++++++++++++++++++ srv/src/http/tpl/follow.html | 152 ++++++++++++++++++++++++++++++++++++++++ srv/src/http/tpl/index.html | 36 ++++++++++ srv/src/http/tpl/post.html | 48 +++++++++++++ srv/src/http/tpl/posts.html | 61 ++++++++++++++++ srv/src/http/tpl/redirect.html | 9 +++ 8 files changed, 524 insertions(+) create mode 100644 srv/src/http/tpl/assets.html create mode 100644 srv/src/http/tpl/base.html create mode 100644 srv/src/http/tpl/edit-post.html create mode 100644 srv/src/http/tpl/follow.html create mode 100644 srv/src/http/tpl/index.html create mode 100644 srv/src/http/tpl/post.html create mode 100644 srv/src/http/tpl/posts.html create mode 100644 srv/src/http/tpl/redirect.html (limited to 'srv/src/http/tpl') diff --git a/srv/src/http/tpl/assets.html b/srv/src/http/tpl/assets.html new file mode 100644 index 0000000..aa5e422 --- /dev/null +++ b/srv/src/http/tpl/assets.html @@ -0,0 +1,51 @@ +{{ define "body" }} + +{{ $csrfFormInput := .CSRFFormInput }} + +

Upload Asset

+ +

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

+ +
+ {{ $csrfFormInput }} +
+
+ +
+
+
+
+
+ +
+
+
+ +

Existing Assets

+ + + + {{ range .Payload.IDs }} + + + + + {{ end }} + +
{{ . }} +
+ {{ $csrfFormInput }} + +
+
+ +{{ end }} + +{{ template "base.html" . }} diff --git a/srv/src/http/tpl/base.html b/srv/src/http/tpl/base.html new file mode 100644 index 0000000..6031919 --- /dev/null +++ b/srv/src/http/tpl/base.html @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ + + + {{ template "body" . }} + +
+

+ Unless otherwised specified, all works are licensed under the + WTFPL. +

+
+ +
+ + + + + diff --git a/srv/src/http/tpl/edit-post.html b/srv/src/http/tpl/edit-post.html new file mode 100644 index 0000000..9ccfa2a --- /dev/null +++ b/srv/src/http/tpl/edit-post.html @@ -0,0 +1,101 @@ +{{ define "body" }} + +
+ + {{ .CSRFFormInput }} + +
+ +
+ + {{ if eq .Payload.ID "" }} + + {{ else }} + {{ .Payload.ID }} + + {{ end }} +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ +
+
+ + + + + + + + + +
+ +{{ end }} + +{{ template "base.html" . }} diff --git a/srv/src/http/tpl/follow.html b/srv/src/http/tpl/follow.html new file mode 100644 index 0000000..8cf9dc6 --- /dev/null +++ b/srv/src/http/tpl/follow.html @@ -0,0 +1,152 @@ +{{ 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. +

+ + + + + + + + + +

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/srv/src/http/tpl/index.html b/srv/src/http/tpl/index.html new file mode 100644 index 0000000..e27cbef --- /dev/null +++ b/srv/src/http/tpl/index.html @@ -0,0 +1,36 @@ +{{ define "body" }} + + + + {{ if or (ge .Payload.PrevPage 0) (ge .Payload.NextPage 0) }} +
+ + {{ if ge .Payload.PrevPage 0 }} + Newer + {{ end }} + + {{ if ge .Payload.NextPage 0 }} + Older + {{ end }} + +
+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/srv/src/http/tpl/post.html b/srv/src/http/tpl/post.html new file mode 100644 index 0000000..474d7c2 --- /dev/null +++ b/srv/src/http/tpl/post.html @@ -0,0 +1,48 @@ +{{ define "body" }} + +
+

+ {{ .Payload.Title }} +

+
+ {{ DateTimeFormat .Payload.PublishedAt }} +  •  + {{ if not .Payload.LastUpdatedAt.IsZero }} + (Updated {{ DateTimeFormat .Payload.LastUpdatedAt }}) +  •  + {{ end }} + {{ .Payload.Description }} +
+
+ +{{ if (or .Payload.SeriesPrevious .Payload.SeriesNext) }} +

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

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

+ If you liked this post, consider checking out other posts in the series:
+ {{ if .Payload.SeriesPrevious }} + Previously: {{ .Payload.SeriesPrevious.Title }}
+ {{ end }} + {{ if .Payload.SeriesNext }} + Next: {{ .Payload.SeriesNext.Title }}
+ {{ end }} +

+{{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/srv/src/http/tpl/posts.html b/srv/src/http/tpl/posts.html new file mode 100644 index 0000000..714cf07 --- /dev/null +++ b/srv/src/http/tpl/posts.html @@ -0,0 +1,61 @@ +{{ define "posts-nextprev" }} + + {{ if or (ge .Payload.PrevPage 0) (ge .Payload.NextPage 0) }} +
+ + {{ if ge .Payload.PrevPage 0 }} + Newer + {{ end }} + + {{ if ge .Payload.NextPage 0 }} + Older + {{ end }} + +
+ {{ end }} + +{{ end }} + +{{ define "body" }} + + {{ $csrfFormInput := .CSRFFormInput }} + + +

+ + + +

+ + {{ template "posts-nextprev" . }} + + + + {{ range .Payload.Posts }} + + + + + + + {{ end }} + +
{{ .PublishedAt }}{{ .Title }} + + + + +
+ {{ $csrfFormInput }} + +
+
+ + {{ template "posts-nextprev" . }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/srv/src/http/tpl/redirect.html b/srv/src/http/tpl/redirect.html new file mode 100644 index 0000000..ed12a2e --- /dev/null +++ b/srv/src/http/tpl/redirect.html @@ -0,0 +1,9 @@ + + + + + + +

Redirecting...

+ + -- cgit v1.2.3