Hugo can output content in multiple formats, including calendar events, e-book formats, Google AMP, and JSON search indexes, or any custom text format.
I’m trying to make Hugo build my markdown into “any other text format”, and here is the situation:
I defined the following configuration in config.toml:
I created a markdown file as a source at content/data.md.
And I’m stuck at the step of creating a template. As far as I understood the docs, I am to create a set of template files, say at the layouts/_default folder.
But what should I write into the template files to have a non-html output? If I write, say {{ .Content }}, the output is HTML, and I can’t find any ways to customize it.
We have a static documentation bundle we need to render for multiple environments and to multiple formats. One of the formats we need for output - is markdown. A simple markdown, but with resolved Hugo shortcodes. What actually I’m trying to do - is to make Hugo take_source_markdown -> do_the_usual_hugo_transforms -> output_markdown.
You can generate different text files with templates and partials. There are some limits with the builtin functions of hugo - it is not a complete programming language. I used json for exporting page information. Sometimes it is better to change the importing system ;-).