diff --git a/config.toml b/config.toml index 51ac9cee..e6d2eb99 100644 --- a/config.toml +++ b/config.toml @@ -94,6 +94,8 @@ enableGitInfo = true [mediaTypes] [mediaTypes."text/gemini"] suffixes = ["gmi"] + [mediaTypes."application/atom"] + suffixes = ["xml"] [outputFormats] [outputFormats.GEMINI] @@ -104,7 +106,16 @@ enableGitInfo = true protocol = "gemini://" permalinkable = true path = "gemini/" + [outputFormats.ATOM] + name = "ATOM" + isPlainText = false + isHTML = true + protocol = "gemini://" + path = "gemini/" + permalinkable = true + mediaType = "application/atom" + baseName = "atom" [outputs] - home = ["HTML", "RSS", "GEMINI"] + home = ["HTML", "RSS", "ATOM", "GEMINI"] page = ["HTML", "GEMINI"] diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index 775d7d8a..696cab62 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -9,7 +9,8 @@ {{ $content := $content | replaceRE `\sgemini://(\S*)` " [gemini://$1](gemini://$1)" -}} {{ $content := $content | replaceRE `{{< audio "(.+?)" >}}` "=> https://brainbaking.com/$1 Embedded Audio link - $1" -}} {{ $content := $content | replaceRE `{{< video "(.+?)" >}}` "=> https://brainbaking.com/$1 Embedded Video link - $1" -}} -{{ $content := $content | replaceRE `{{< youtube (.+?) >}}` "=> https://www.youtube.com/watch?v=$1 YouTube link to $1" -}} +{{ $content := $content | replaceRE `{{< youtube (.+?) >}}` "=> https://www.youtube.com/watch?v=$1 YouTube Video link to $1" -}} +{{ $content := $content | replaceRE `{{< vimeo (.+?) >}}` "=> https://vimeo.com/$1 Vimeo Video link to $1" -}} {{ $content := $content | replaceRE "([^`])<.*?>([^`])" "$1$2" -}} {{ $content := $content | replaceRE `\n\n!\[.*\]\((.+?) \"(.+?)\"\)` "\n\n=> $1 Image: $2" -}} {{ $content := $content | replaceRE `\n\n!\[.*]\((.+?)\)` "\n\n=> $1 Embedded Image: $1" -}} diff --git a/layouts/index.gmi b/layouts/index.gmi index fc7f4b97..77d74831 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -28,9 +28,9 @@ If you found my bakings amusing and/or helpful, you can buy me a coffee - if you ## Freshly Baked Thoughts: The Gemlog -Behold my freshly baked thoughts for you to enjoy. If you'd like, you can subscribe to the RSS feeds. I hear they're lovely in your favorite RSS client. +Behold my freshly baked thoughts for you to enjoy. If you'd like, you can subscribe to the Atom feeds. I hear they're lovely in your favorite Gemini client. -=> https://brainbaking.com/post/index.xml RSS Feeds (HTTPS) +=> /atom.xml Gemini Atom Feed {{ range (where (where (where .Site.Pages "Section" "in" (slice "post")) ".Params.type" "ne" "archive") ".Params.concept" "ne" "true").GroupByDate "2006" "desc" }}{{ $year := .Key -}} {{ range .Pages.GroupByDate "January" }} ### {{ .Key }} {{ $year }} diff --git a/themes/brainbaking-minimal/layouts/_default/index.atom.xml b/themes/brainbaking-minimal/layouts/_default/index.atom.xml new file mode 100644 index 00000000..af07b708 --- /dev/null +++ b/themes/brainbaking-minimal/layouts/_default/index.atom.xml @@ -0,0 +1,38 @@ +{{- $allowedRssSections := (slice "post" "notes") -}} +{{- $baseurl := .Site.BaseURL -}} +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + {{ .Site.Title }} + + + {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} + + {{ .Site.Author.name }} + {{ .Site.BaseURL | replaceRE `https?://(.+?)` "gemini://$1" }} + + {{ .Permalink }} + {{ range $pages }} + {{ if in $allowedRssSections .Section }} + + {{ .Title }} + + {{ .Permalink | replaceRE `https?://(.+?)` "gemini://$1" }} + {{ .Date.Format "2006-01-02T15:04:05-0700" | safeHTML }} + {{ .Lastmod.Format "2006-01-02T15:04:05-0700" | safeHTML }} + {{ if isset .Params "subtitle" }}{{ .Params.subtitle }}{{ else }}{{ .Summary | html }}{{ end }} + + {{ end }} + {{ end }} +