README, Feeds, Post(meta): Redesign post list, add atom feed

This commit is contained in:
hedy 2022-05-15 18:26:12 +08:00
parent aeb98aa31c
commit 629ba7431a
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
10 changed files with 88 additions and 26 deletions

View File

@ -21,8 +21,13 @@ css](https://simplecss.org) and sometimes [seirdy's site](https://seirdy.one).
## todo
- [ ] let gemini version also have a post page at /posts/index.gmi
- [ ] post-index.md and gmi for content put after the posts list
- [ ] rethink on the post slugs. currently `/posts/file-name-or-slug/` but I
might put the date or something in there idk
- [ ] minify images and use WebP
- [x] provide atom feed for www
- [x] show post description in list
- [ ] content improvements
- [ ] about
- [ ] projects
- [ ] syntax hilite post
- [ ] gemini post
- [ ] proper reply via email link

View File

@ -94,8 +94,15 @@ isHTML = false
noUgly = false
permalinkable = false
# https://gist.github.com/lpar/7ded35d8f52fef7490a5be92e6cd6937
[outputFormats.ATOM]
name = "ATOM"
mediaType = "application/atom"
baseName = "atom"
isPlainText = false
[outputs]
section = ["HTML", "RSS", "GEMATOM"]
section = ["HTML", "RSS", "GEMATOM", "ATOM"]
[webmentions]
newDir = "public"

View File

@ -2,6 +2,7 @@
title: "Hello"
date: 2021-02-05T01:44:15Z
draft: false
description: "I'm alive!"
tags:
- test
outputs:

View File

@ -8,7 +8,7 @@ outputs:
- html
- gemtext
slug: "on-rants-gemini"
description: "A Discussion about some of the complaints of the Gemini Protocol recently"
description: "A discussion about Gemini and addressing some of the complaints of the Gemini Protocol seen on the internet recently."
---

View File

@ -10,7 +10,7 @@ date: 2021-06-16T23:50:00Z
draft: false
slug: "multiple-emails-git"
highlight: true
description: "How to have different git configs depending on the computer and have it tracked with dotfiles"
description: "How to have different git author configurations depending on the computer and have it tracked with dotfiles."
---

View File

@ -1,7 +1,7 @@
---
title: "Another Test"
date: 2021-06-20T21:33:27+08:00
draft: false
draft: true
outputs:
- html
- gemtext

View File

@ -9,7 +9,7 @@ outputs:
slug: hugo-syntax-highlighting
tags:
- howto
description: "How I've set up syntax highlighting for hugo, powered by chroma."
description: "How I've set up syntax highlighting for my website with dark mode support."
---

View File

@ -0,0 +1,33 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
<feed xmlns="http://www.w3.org/2005/Atom">
<title>hedy's blog</title>
<link href="{{ .Permalink }}"/>
<updated>{{ .Date.Format "2006-01-02" | safeHTML }}T12:00:00Z</updated>
<id>{{ .Permalink }}</id>
<author>
<name>{{ $.Site.Author.name }}</name>
<email>{{ $.Site.Author.email }}</email>
</author>
{{- range where .Site.Pages "Kind" "page" }}
{{- if or (eq .Section "posts") (eq .Section "post") }}
<entry>
<title>{{ .Title }}</title>
{{ printf `<link rel="alternate" href="%s" />` .Permalink | safeHTML }}
<id>{{ .Permalink }}</id>
<updated>{{ .Date.Format "2006-01-02" }}T12:00:00Z</updated>
<author>
<name>{{ $.Site.Author.name }}</name>
<email>{{ $.Site.Author.email }}</email>
</author>
</entry>
{{- end }}
{{- end }}
</feed>

View File

@ -12,13 +12,13 @@
<link href="{{ .Site.Params.geminiRoot }}"/>
<updated>{{ .Date.Format "2006-01-02" | safeHTML }}T12:00:00Z</updated>
<id>{{ .Site.Params.geminiRoot }}</id>
{{- range (where .Site.RegularPages "Section" "posts") -}}
{{- $p := . -}}
{{- with .OutputFormats.Get "gemtext" }}
<author>
<name>{{ $.Site.Author.name }}</name>
<email>{{ $.Site.Author.email }}</email>
</author>
{{- range (where .Site.RegularPages "Section" "posts") -}}
{{- $p := . -}}
{{- with .OutputFormats.Get "gemtext" }}
<entry>
{{- $perm := replace (replace .Permalink "/gemini" "" 1) "/index.gmi" ".gmi" 1 }}
<title>{{ $p.Title }}</title>

View File

@ -1,20 +1,36 @@
{{ $outerRel := .RelPermalink }}
{{ $outerRel := .RelPermalink -}}
{{ if in $outerRel "posts" -}}
<h1>Posts</h1>
{{ else -}}
<h2>Posts</h2>
{{ end -}}
<p class="meta"><a href="{{ .Site.BaseURL }}tags/">All tags</a> | <a href="{{ .Site.BaseURL }}posts/index.xml">RSS feed</a></p>
<ul class="unstyled-list">
{{ range (where .Site.RegularPages "Section" "posts") }}
<li>
<p>
<time datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
<a href="{{ .Permalink }}">
{{- .Title -}}
</a>
</p>
</li>
{{- end }}
<p class="meta">
<a href="{{ .Site.BaseURL }}tags/">Tags</a> |
<a href="{{ .Site.BaseURL }}posts/index.xml">RSS feed</a> |
<a href="{{ .Site.BaseURL }}posts/atom.xml">Atom feed</a>
</p>
<ul class="post-list">
{{- range (where .Site.RegularPages "Section" "posts") }}
<li>
{{ if in $outerRel "posts" -}}
<h2>
{{ else -}}
<h3>
{{ end -}}
<a href="{{ .Permalink }}">
{{- .Title -}}
</a>
{{ if in $outerRel "posts" -}}
</h2>
{{ else -}}
</h3>
{{ end -}}
<p>Posted:
<time datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
{{ partial "lastmod.html" . }}
</p>
<p class="desc">{{ .Description }}</p>
</li>
{{- end }}
</ul>