I wanted content files to render as per specified layout (which they do) and in specific extension (here md).
What I tried:
1.config.toml
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
uglyurls = true
# Change the suffix of the HTML output format from html (default) to md
[mediaTypes]
[mediaTypes."text/html"]
suffixes = ["md"]
# Redefine HTML to update its media type.
[outputFormats]
[outputFormats.HTML]
mediaType = "text/html"
2.config.toml
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
uglyurls = true
# There was a note on https://gohugo.io/templates/output-formats saying:
# Note that for the above to work, you also need to add an outputs definition in your site config.
# Didn't understand it properly, but I think this is what it meant.
# Please correct me if wrong.
[outputs]
page = ["HTML"]
# Change the suffix of the HTML output format from html (default) to md
[mediaTypes]
[mediaTypes."text/html"]
suffixes = ["md"]
# Redefine HTML to update its media type.
[outputFormats]
[outputFormats.HTML]
mediaType = "text/html"
3.config.toml
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
uglyurls = true
Expected result:
Files appear in public directory (in proper subfolder) with extension .md
Actual result as per What I tried, in respective manner:
No files (or pages) appear other than taxonomy pages (and folder)
No files (or pages) appear other than taxonomy pages (and folder)
Files appear with extension .html (though it is not what I wanted, it is working as it should)
@pointyfar Thanks for the input. But when I adjust config file as per your suggestion, in output files (pages) have the .html extension.
If Iām understanding you correctly
What I am trying to do is to have the generated pages to have .md extension.
@ju52 Thanks for the help. I had actually gone through the link you provided (from where I have quoted the note in point 2 of what I have tried).
What I am trying to do is to have generated pages to have .md extension. How may I declare output formats in config file? I think I should be concentrating on page in:
# quoted from https://github.com/gj52/HugoSample/blob/master/config/_default/config.toml
# on line no. 137 (at commit https://github.com/gj52/HugoSample/commit/0231cb59be80b8d70273ee1a09e297ed94f91539,
# just in case file changes in future)
[outputs]
home = [ "HTML", "ATOM", "JSON", "FEED", "MANIFEST", "SITEMAP"]
section = [ "HTML", "SITEMAP" ]
page = [ "HTML" ]
taxonomy = [ "HTML" ]
taxonomyTerm = [ "HTML" ]