Create multiple pages based on single content page

I’m trying to build out a theme that generates multiple pages from a single content file. I have a content file (example below) that contains metadata for a webinar.

banner_image = "/uploads/webinarXYZ.png"
publishdate = 2020-10-30T04:00:00Z
enable_registration = true
registration_form_id = "XYZ123456789"
title = "Learning how to build a Hugo Theme"
webinar_date = 2020-11-11T04:00:00Z
webinar_url = ""
description = "The webinar's description goes here."
host = "John Smith"


I want to generate 2 different static files from this single content file:

  1. A single page that contains the banner_image and a sign up form (uses registration_form_id with a 3rd party service – not important for this question):
  2. Another single page with the output url prefaced with “video-” that contains the embedded webinar_url link:

I can generate the first page using the single.html template just fine. In Hugo, is there a way to generate a 2nd page using a different page template based on the same content file?

Have a look at output formats.


For anyone else attempting this, I added outputs to the front matter for each of my content pages like this:

outputs = ["html", "webinar"]

Then I created a webinar template named single.webinar.html which contained the HTML template for the webinar viewing page.

Finally, I added an outputFormats section to my config.toml like so:

    baseName = "video"
    isPlainText = false
    isHTML = true
    permalinkable = true
    suffix = "html"
    mediaType = "text/html"

This generates the 2 HTML files that I needed: and

Good enough for production. Thanks again @pointyfar!

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