From 91994df9101b2c2ab01895dc046a9472a5962569 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 21 Oct 2023 21:46:52 -0500 Subject: [PATCH] Create markdown output template Further progress is blocked by Hugo feature requests: - https://discourse.gohugo.io/t/render-alternative-output-format-outside-of-leaf-bundle-subdirectory/46968 - https://github.com/gohugoio/hugo/issues/8927 --- exampleSite/hugo.yaml | 3 +++ hugo.yaml | 5 +++++ layouts/_default/single.markdown.md | 9 +++++++++ 3 files changed, 17 insertions(+) create mode 100644 layouts/_default/single.markdown.md diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 41a4565..72fe519 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -15,6 +15,9 @@ taxonomies: markup: # this just keeps the bobatheme markup styling _merge: deep +outputs: + _merge: deep + params: author: name: bbaovanc diff --git a/hugo.yaml b/hugo.yaml index f24c261..388022c 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -12,6 +12,11 @@ taxonomies: author: authors series: series +outputs: + page: + - html + - markdown + privacy: googleAnalytics: disable: true diff --git a/layouts/_default/single.markdown.md b/layouts/_default/single.markdown.md new file mode 100644 index 0000000..d8f8dd7 --- /dev/null +++ b/layouts/_default/single.markdown.md @@ -0,0 +1,9 @@ +{{ with .File -}} + {{ with (.Path | readFile) -}} + {{ . -}} + {{ else -}} + {{ errorf "file not found: %s" .Path -}} + {{ end -}} +{{ else -}} + {{ errorf "no file available for markdown template?" -}} +{{ end -}}