A fast and simple blog backend.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mediocre-blog/src/gmi/tpl/posts/index.gmi

30 lines
748 B

# mediocregopher's Posts
{{ $page := .GetQueryIntValue "page" 0 -}}
{{ if eq $page 0 -}}
Here you'll find an archive of all published posts. The content varies almost as
much as the quality!
{{ end -}}
{{ $getPostsRes := .GetPosts $page 20 -}}
{{ if gt $page 0 -}}
=> {{ BlogURL "posts" }}/?page={{ .Add $page -1 }} Previous Page
{{ end -}}
{{ range $getPostsRes.Posts -}}
=> {{ PostURL .ID }} {{ .PublishedAt.Format "2006-01-02" }} - {{ .Title }}
{{ end -}}
{{ if $getPostsRes.HasMore -}}
=> {{ BlogURL "posts" }}/?page={{ .Add $page 1 }} Next page
{{ end }}
================================================================================
=> {{ BlogURL "feed.xml" }} Subscribe to the RSS feed for updates
{{ template "footer.gmi" . }}