From a8e7ea6f710504a63c751b3bc574ff58ece0fbfe Mon Sep 17 00:00:00 2001 From: Duncan Mackenzie Date: Sat, 7 Dec 2024 17:04:49 -0800 Subject: [PATCH] Add a new markdown output to the blog --- config.toml | 9 ++++++++- themes/hello-friend-ng/layouts/_default/baseof.txt | 1 + themes/hello-friend-ng/layouts/_default/single.md | 3 +++ themes/hello-friend-ng/layouts/partials/head.html | 3 +++ themes/hello-friend-ng/layouts/posts/single.md | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 themes/hello-friend-ng/layouts/_default/baseof.txt create mode 100644 themes/hello-friend-ng/layouts/_default/single.md create mode 100644 themes/hello-friend-ng/layouts/posts/single.md diff --git a/config.toml b/config.toml index 99fefa8b..5e7512af 100644 --- a/config.toml +++ b/config.toml @@ -31,6 +31,7 @@ disableSitemap = false disable404 = false disableHugoGeneratorInject = false + [outputFormats] [outputFormats.purchase] name = "purchase" @@ -50,10 +51,16 @@ disableHugoGeneratorInject = false baseName = "oembed" mediaType = "application/json" isPlainText = true + [outputFormats.markdown] + name = "markdown" + baseName = "index" + mediaType = "text/markdown" + isPlainText = true + [outputs] home = ["HTML", "RSS", "JSON", "OEMBED", "IFRAME"] - page = ["HTML", "OEMBED", "IFRAME"] + page = ["HTML", "OEMBED", "IFRAME", "MARKDOWN"] [blackfriday] hrefTargetBlank = false diff --git a/themes/hello-friend-ng/layouts/_default/baseof.txt b/themes/hello-friend-ng/layouts/_default/baseof.txt new file mode 100644 index 00000000..df5fa0e0 --- /dev/null +++ b/themes/hello-friend-ng/layouts/_default/baseof.txt @@ -0,0 +1 @@ +{{ block "main" . }}{{ end }} diff --git a/themes/hello-friend-ng/layouts/_default/single.md b/themes/hello-friend-ng/layouts/_default/single.md new file mode 100644 index 00000000..da4f9197 --- /dev/null +++ b/themes/hello-friend-ng/layouts/_default/single.md @@ -0,0 +1,3 @@ +# {{ .Title }} + +{{ .RawContent }} diff --git a/themes/hello-friend-ng/layouts/partials/head.html b/themes/hello-friend-ng/layouts/partials/head.html index 017f860d..e0ac3147 100644 --- a/themes/hello-friend-ng/layouts/partials/head.html +++ b/themes/hello-friend-ng/layouts/partials/head.html @@ -10,6 +10,9 @@ {{ if .OutputFormats.Get "OEMBED" }} {{ end }} +{{ if .OutputFormats.Get "MARKDOWN" }} + +{{ end }} {{ if or (eq .Type "tags") (eq .Type "blog")}}{{ end }} {{ block "title" . }} diff --git a/themes/hello-friend-ng/layouts/posts/single.md b/themes/hello-friend-ng/layouts/posts/single.md new file mode 100644 index 00000000..da4f9197 --- /dev/null +++ b/themes/hello-friend-ng/layouts/posts/single.md @@ -0,0 +1,3 @@ +# {{ .Title }} + +{{ .RawContent }}