Hi,
Is there any way to create 2 HTML files from 1 MD file?
I would Like to generate my posts like normal and another file with just the Page Title.
Any way to do that?
Have a look at Output Formats: Custom Output Formats | Hugo
with outputFormats you have to use different file extensions, ex. html and htm to use different templates for generation
I needed different JSON and XML outputs , compare my theme config
and the different template names
I think the outputFormats require multiple file types.
But what I need is HTML outputs at 2 locations.
config.toml
[outputFormats.title-only]
mediaType = "text/html"
baseName = "index-title-only"
[outputs]
page = ['HTML','title-only']
layouts/_default/single.title-only.html
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ end }}
publish directory
public/
āāā post/
ā āāā test/
ā ā āāā index.html
ā ā āāā index-title-only.html
ā āāā index.html
āāā index.html
3 Likes
Thank You man!
This worked
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.