Add handler, page, template loading

This commit is contained in:
Matt Baer
2018-11-07 23:50:50 -05:00
parent 3afdd8c1b4
commit a30fc5b52b
9 changed files with 872 additions and 1 deletions

7
pages/404-general.tmpl Normal file
View File

@@ -0,0 +1,7 @@
{{define "head"}}<title>Page not found &mdash; {{.SiteName}}</title>{{end}}
{{define "content"}}
<div class="error-page">
<p class="msg">This page is missing.</p>
<p>Are you sure it was ever here?</p>
</div>
{{end}}

10
pages/404.tmpl Normal file
View File

@@ -0,0 +1,10 @@
{{define "head"}}<title>Post not found &mdash; {{.SiteName}}</title>{{end}}
{{define "content"}}
<div class="error-page" style="max-width:30em">
<p class="msg">Post not found.</p>
{{if and (not .SingleUser) .OpenRegistration}}
<p class="commentary" style="margin-top:2.5em">Why not share a thought of your own?</p>
<p><a href="/">Start a blog</a> and spread your ideas on <strong>{{.SiteName}}</strong>, a simple{{if .Federation}}, federated{{end}} blogging community.</p>
{{end}}
</div>
{{end}}

7
pages/410.tmpl Normal file
View File

@@ -0,0 +1,7 @@
{{define "head"}}<title>Unpublished &mdash; {{.SiteName}}</title>{{end}}
{{define "content"}}
<div class="error-page">
<p class="msg">{{if .Content}}{{.Content}}{{else}}Post was unpublished by the author.{{end}}</p>
<p class="commentary">It might be back some day.</p>
</div>
{{end}}

9
pages/500.tmpl Normal file
View File

@@ -0,0 +1,9 @@
{{define "head"}}<title>Server error &mdash; {{.SiteName}}</title>{{end}}
{{define "content"}}
<div class="error-page">
<p class="msg">Server error. &#x1F632; &#x1F635;</p>
<p>The humans have been alerted and reminded of their many shortcomings.</p>
<p style="margin-top:3em">On behalf of them, we apologize.</p>
<p>&ndash; The Write.as Bots</p>
</div>
{{end}}

2
pages/blank.tmpl Normal file
View File

@@ -0,0 +1,2 @@
{{define "head"}}<title>{{.Title}} &mdash; {{.SiteName}}</title>{{end}}
{{define "content"}}<div class="content-container">{{.Content}}</div>{{end}}