Add gopher pages

This commit is contained in:
Dominic Reich 2025-02-09 10:03:05 +01:00
parent 8632656034
commit 24868e6a39
Signed by: dominic
GPG key ID: 0B5787DB23049C45
5 changed files with 39 additions and 5 deletions

View file

@ -68,6 +68,12 @@ disableKinds = ["RSS"] # kick out RSS
baseName = "index" baseName = "index"
NoUgly = true NoUgly = true
[outputFormats.gopher]
MediaType = "text/plain"
BaseName = "gophermap"
isPlainText = true
Protocol = "gopher://"
noUgly = false
[outputFormats.ATOM] [outputFormats.ATOM]
MediaType = "application/atom+xml" MediaType = "application/atom+xml"
@ -101,10 +107,10 @@ isHTML = true
notAlternative = true notAlternative = true
[outputs] [outputs]
home = [ "HTML", "ATOM", "JSON", "HumansTXT", "Tootpick"] home = [ "HTML", "gopher", "ATOM", "JSON", "HumansTXT", "Tootpick"]
section = [ "HTML", ] section = [ "HTML", "gopher" ]
page = [ "HTML" ] page = [ "HTML", "gopher" ]
taxonomy = [ "HTML" ] taxonomy = [ "HTML", "gopher" ]
#taxonomyTerm = [ "HTML" ] #taxonomyTerm = [ "HTML" ]
[related] [related]

View file

@ -0,0 +1,7 @@
!{{ .Title }}
{{ .RawContent }}
{{ range .Pages.ByPublishDate.Reverse }}
0{{ .Title }} {{ with .OutputFormats.Get "gopher" -}}{{ .RelPermalink }} {{ $.Site.Params.hostname}} 70 {{ end }}
{{ end }}

View file

@ -0,0 +1,8 @@
# {{ .Title }}
{{ .Date.Format (.Site.Params.dateform | default "January 2006") }} · {{ .ReadingTime }} minute read
{{ if .Params.tags }}
Posted in: {{ range .Params.tags }}{{ . }} {{ end }}
{{ end }}
{{ .RawContent }}

13
layouts/index.gopher.txt Normal file
View file

@ -0,0 +1,13 @@
!{{ .Title }}
{{ .RawContent }}
Site sections:
{{ range .Site.Menus.main }}
1{{ .Name }} {{ .Identifier }} {{ $.Site.Params.hostname }} 70
{{ end }}
Most recent articles
{{ range first 3 .Pages.ByPublishDate.Reverse }}
0{{ .Title }} {{ with .OutputFormats.Get "gopher" -}}{{ .RelPermalink }} {{ $.Site.Params.hostname }} 70 {{ end }}
{{ end }}

View file

@ -3,7 +3,7 @@
"indices" (slice "tags") "indices" (slice "tags")
}} }}
{{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }} {{ $related := .Site.RegularPages.Related . | first 5 }} {{ with $related }}
<h3>Related Posts</h3> <h2>Related Posts</h2>
<ul> <ul>
{{ range . }} {{ range . }}
{{ if and (eq .Section "posts") .IsPage }} {{ if and (eq .Section "posts") .IsPage }}