I want to create a page that sends directly to a page in txt format, i.e. with a path like this: www.siteweb.fr/securite.txt
The problem is that when I create a new security page > _index.md, I have this front matter:
---
title: "Security"
featured_image: '...'
---
Text Text
Here I can't assign a txt page directly, like I can with html ().
I tried adding the "url" option in the front matter, but when I do that, I have the path with the txt file but there is an XML format that is done on the page. I don't know how to remedy this :
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Sécurité on blog</title>
<link>http://192.168.x.x/fr/securite.txt</link>
<description>Recent content in Sécurité on blog</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<atom:link href="http://192.168.x.x/securite.txt" rel="self" type="application/rss+xml" />
</channel>
</rss>
The below is a very loose/workable definition and you should check the docs, but it gives a sort of understanding:
But, what does it build, RSS, HTML, text?
One of the options/parameters Hugo uses to build is what is in your config, example:
This is my config, and states that my pages - output as html. Home outputs as HTML, RSS and JSON. Section outputs as HTML and RSS.
Now this is SITE WIDE.
So, with that orientation, see the below PAGE front matter to go in a specific page:
If you would like to check the docs: https://gohugo.io/variables/page/ https://gohugo.io/templates/output-formats/#customizing-output-formats
Particularly clarifying is: https://discourse.gohugo.io/t/custom-output-formats/33481/5 (If you try to get fancy that is).