2 Html files from 1 markdown

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?

1 Like

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.


mediaType = "text/html"
baseName = "index-title-only"

page = ['HTML','title-only']


{{ define "main" }}
  <h1>{{ .Title }}</h1>
{{ end }}

publish directory

ā”œā”€ā”€ post/
ā”‚   ā”œā”€ā”€ test/
ā”‚   ā”‚   ā”œā”€ā”€ index.html
ā”‚   ā”‚   ā””ā”€ā”€ index-title-only.html
ā”‚   ā””ā”€ā”€ index.html
ā””ā”€ā”€ index.html

Thank You man!
This worked

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