2019-01-01 19:41:03 +01:00
|
|
|
package initer
|
|
|
|
|
2023-03-05 14:04:02 +01:00
|
|
|
const defaultRSSTemplate string = `<?xml version="1.0" encoding="UTF-8"?>
|
2020-10-29 12:01:30 +01:00
|
|
|
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
|
|
|
<channel>
|
|
|
|
<title>YOUR TITLE</title>
|
|
|
|
<link>LINK TO YOUR BLOG</link>
|
|
|
|
<description>DESCRIPTION OF YOUR BLOG</description>
|
|
|
|
|
|
|
|
{{range $index, $post := .}}
|
|
|
|
{{- if (lt $index 10)}}
|
|
|
|
<item>
|
|
|
|
<title>{{$post.Meta.Title}}</title>
|
|
|
|
<content:encoded><![CDATA[ {{$post.Content}} ]]></content:encoded>
|
|
|
|
<link>BASE ADDRESS OF YOUR BLOG{{$post.Link}}</link>
|
|
|
|
<pubDate>{{$post.Meta.RFC1123Date}}</pubDate>
|
|
|
|
</item>
|
|
|
|
{{end}}
|
|
|
|
{{- end}}
|
|
|
|
|
|
|
|
</channel>
|
|
|
|
</rss>
|
|
|
|
`
|
|
|
|
|
2023-03-05 14:04:02 +01:00
|
|
|
const defaultTemplate string = `<!DOCTYPE html>
|
2019-01-01 19:41:03 +01:00
|
|
|
<html>
|
|
|
|
<head><title>{{.Title}}</title>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
|
|
|
<!-- Tell "smart" phones that they are as wide as they are wide... -->
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
|
2020-11-27 19:07:18 +01:00
|
|
|
{{if or .PostCollection .Blogpost}}
|
2020-10-29 12:11:08 +01:00
|
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="/{{.Blogdir}}/feed.rss">
|
2020-10-29 12:01:30 +01:00
|
|
|
{{end}}
|
2023-03-05 14:04:02 +01:00
|
|
|
<style>{{.Style}}</style>
|
|
|
|
<script>{{.Script}}</script>
|
2019-01-01 19:41:03 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
2023-03-05 14:04:02 +01:00
|
|
|
<div class="navigation" id="navigation">
|
2019-01-01 19:41:03 +01:00
|
|
|
<a href="/">home</a>
|
2020-05-28 21:52:50 +02:00
|
|
|
<a href="/blog/">blog</a>
|
2019-01-01 19:41:03 +01:00
|
|
|
<a href="/photos/pages/">photos</a>
|
2023-03-05 14:04:02 +01:00
|
|
|
<a href="javascript:void(0);" class="burger" onclick="retard()">☰</a>
|
2019-01-01 19:41:03 +01:00
|
|
|
</div>
|
2023-03-05 14:26:23 +01:00
|
|
|
<h1>{{if .Blogpost}}{{.Blogname}}: {{end}}{{.Title}}</h1>
|
|
|
|
|
2023-03-05 14:04:02 +01:00
|
|
|
{{if .Description}}<h3>{{.Description}}</h3>{{end}}
|
2019-01-01 19:41:03 +01:00
|
|
|
|
|
|
|
{{if .Subpages}}
|
|
|
|
<dl>
|
|
|
|
{{range $index, $subpage := .Subpages}}
|
|
|
|
<dt><a href="/{{$subpage.Path}}">[{{$subpage.Title}}]</a></dt><dd>{{$subpage.Description}}</dd>
|
|
|
|
{{end}}
|
|
|
|
</dl>
|
|
|
|
{{end}}
|
|
|
|
|
2019-05-26 17:53:05 +02:00
|
|
|
{{if .PostCollection}}
|
|
|
|
<h2><a href="/{{.Blogdir}}/categories.html">Categories</a> <a href="/{{.Blogdir}}/timeline.html">Timeline</a></h2>
|
|
|
|
|
2019-01-01 19:41:03 +01:00
|
|
|
{{range $index, $post := .PostCollection}}
|
|
|
|
<div class="blogpost">
|
|
|
|
<h1>
|
2022-07-09 22:37:52 +02:00
|
|
|
<a href ="{{$post.Link}}" class="linktopost">{{$post.Title}}</a>
|
2019-01-01 19:41:03 +01:00
|
|
|
</h1>
|
|
|
|
{{$post.Content}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2020-05-28 21:52:50 +02:00
|
|
|
|
|
|
|
|
2019-01-01 19:41:03 +01:00
|
|
|
<div class="content">
|
2020-05-28 21:52:50 +02:00
|
|
|
{{.Content}}
|
|
|
|
|
|
|
|
{{if .CategoryListings}}
|
|
|
|
<div class="categoryListing">
|
|
|
|
<dl style="padding-bottom:150em;">
|
|
|
|
{{range $i, $listing := .CategoryListings -}}
|
|
|
|
<dt><a name="{{$listing.ASCIIName}}" class="categoryListing">{{$listing.Name}}</a></dt>
|
|
|
|
{{range $j, $post := $listing.Posts -}}
|
|
|
|
<dd><a href="{{$post.Link}}">{{$post.Meta.Title}}</a></dd>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</dl>
|
2019-01-01 19:41:03 +01:00
|
|
|
</div>
|
2020-05-28 21:52:50 +02:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if .TimelineListing}}
|
|
|
|
<div class="timelineListing">
|
|
|
|
{{range $i, $post := .TimelineListing -}}
|
2020-10-19 10:11:50 +02:00
|
|
|
{{$post.Meta.FormattedDate}}: <a href="{{$post.Link}}" class="timelineListing">{{$post.Meta.Title}}</a><br>
|
2020-05-28 21:52:50 +02:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2019-01-01 19:41:03 +01:00
|
|
|
|
|
|
|
{{if .Categories}}
|
|
|
|
<div class="categories">
|
|
|
|
Posted in
|
|
|
|
{{range $index, $category := .Categories}}
|
|
|
|
<a href="{{$category.Path}}">{{$category.Name}}</a>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if .Time}}
|
|
|
|
<div class="time">
|
2020-10-29 13:16:18 +01:00
|
|
|
{{.Time}} UTC
|
2019-01-01 19:41:03 +01:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if or .Previous .Later}}
|
|
|
|
<div class="blognavigation">
|
|
|
|
{{if .Previous}}
|
2022-07-09 22:37:52 +02:00
|
|
|
<h2><a href="{{.Previous}}"><--Previous</a></h2>
|
2019-01-01 19:41:03 +01:00
|
|
|
{{end}}
|
|
|
|
{{if .Later}}
|
2022-07-09 22:37:52 +02:00
|
|
|
<h2><a href="{{.Later}}"><h2>Later--></a></h2>
|
2019-01-01 19:41:03 +01:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
`
|