Render alternative output format outside of leaf bundle subdirectory

I have created a template single.markdown.md which is just set up to output the raw markdown content (so I can make a download link):

{{ with .File -}}
  {{ with (.Path | readFile) -}}
    {{ . -}}
  {{ else -}}
    {{ errorf "file not found: %s" .Path -}}
  {{ end -}}
{{ else -}}
  {{ errorf "no file available for markdown template?" -}}
{{ end -}}

This creates a file at, for example, https://bbaovanc.com/blog/swapfile-guide/index.md. Is there a way I can instead have it output at https://bbaovanc.com/blog/swapfile-guide.md?

What you want to do will be easier once this is implemented:
https://github.com/gohugoio/hugo/issues/8927

In the interim, set uglyURLs to true in your site configuration, and then set noUgly to true for the HTML output format.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.