The development of the Custom Output Feature is mostly done (there are still lots of smaller TODOs flying around), but it would be nice to get some feedback on this now. It is easier to change it now before people start to use it.
For background, see https://github.com/spf13/hugo/pull/3122
To illustrate (and test) the core functionality, I added some more output types to my site bepsays.com. This commit shows all the changes:
Don't mock my AMP design skill!
The above commits have the following new items:
- Output format definitions in both site and page config
- A crude AMP version + JSON for the English home page.
- Enhanced template handling, including base handling per output format.
- Use of the
AlternativeOutputFormats to create a list of "link rel" to alternative representations. Note that there is also an
OutputFormats list that lists all, and a
Get method to get a specific format by name.
To see it in "action", go to
http://bepsays.com/en/ and see the "link rels" in the source header to the different represenations.
- The home page http://bepsays.com/ has no content page, and gets its output definitions from the site config (and hence no JSON output).
I'm pretty happy to see how compact the change set to my site above is, considering the amount of sweat I poured into the Hugo source code to get there ...
But even if this may be clear and correct to me, it may not be so to you. So comments and corrections are appreciated.