136 lines
3.1 KiB
Go
136 lines
3.1 KiB
Go
package initer
|
|
|
|
const defaultRSSTemplate string = `<?xml version="1.0" encoding="UTF-8"?>
|
|
<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>
|
|
`
|
|
|
|
const defaultTemplate string = `<!DOCTYPE html>
|
|
<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=">
|
|
{{if or .PostCollection .Blogpost}}
|
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="/{{.Blogdir}}/feed.rss">
|
|
{{end}}
|
|
<style>{{.Style}}</style>
|
|
<script>{{.Script}}</script>
|
|
</head>
|
|
<body>
|
|
<div class="navigation" id="navigation">
|
|
<a href="/">home</a>
|
|
<a href="/blog/">blog</a>
|
|
<a href="/photos/pages/">photos</a>
|
|
<a href="javascript:void(0);" class="burger" onclick="retard()">☰</a>
|
|
</div>
|
|
<h1>{{if .Blogpost}}{{.Blogname}}: {{end}}{{.Title}}</h1>
|
|
|
|
{{if .Description}}<h3>{{.Description}}</h3>{{end}}
|
|
|
|
{{if .Subpages}}
|
|
<dl>
|
|
{{range $index, $subpage := .Subpages}}
|
|
<dt><a href="/{{$subpage.Path}}">[{{$subpage.Title}}]</a></dt><dd>{{$subpage.Description}}</dd>
|
|
{{end}}
|
|
</dl>
|
|
{{end}}
|
|
|
|
{{if .PostCollection}}
|
|
<h2><a href="/{{.Blogdir}}/categories.html">Categories</a> <a href="/{{.Blogdir}}/timeline.html">Timeline</a></h2>
|
|
|
|
{{range $index, $post := .PostCollection}}
|
|
<div class="blogpost">
|
|
<h1>
|
|
<a href ="{{$post.Link}}" class="linktopost">{{$post.Title}}</a>
|
|
</h1>
|
|
{{$post.Content}}
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
|
|
|
|
|
|
<div class="content">
|
|
|
|
|
|
{{.Content}}
|
|
|
|
{{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">
|
|
{{.Time}} UTC
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .CategoryListings}}
|
|
{{if .Blogpost}}
|
|
<div class="relatedListing">
|
|
Related posts:
|
|
{{else}}
|
|
<div class="categoryListing">
|
|
{{end}}
|
|
<dl>
|
|
{{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>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{if .TimelineListing}}
|
|
<div class="timelineListing">
|
|
{{range $i, $post := .TimelineListing -}}
|
|
{{$post.Meta.FormattedDate}}: <a href="{{$post.Link}}" class="timelineListing">{{$post.Meta.Title}}</a><br>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{if or .Previous .Later}}
|
|
<div class="blognavigation">
|
|
{{if .Previous}}
|
|
<h2><a href="{{.Previous}}"><--Previous</a></h2>
|
|
{{end}}
|
|
{{if .Later}}
|
|
<h2><a href="{{.Later}}"><h2>Later--></a></h2>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</body>
|
|
</html>
|
|
`
|