mmmmd
August 9, 2021, 10:12am
1
Hey everyone,
I’m looking for a way to have the output format (in my case ical) named as the individual post. For example, blog.com/my-birthday-party.ics instead of blog.com/my-birthday-party/index.ics. I think this might be usefull for the user as nobody wants generic index.ics files in their download folders.
In the documentation I could only find:
[outputFormats]
[outputFormats.Calendar]
baseName = 'event'
But this would only rename it to blog.com/my-birthday-party/event.ics.
I have created the file single.ics under /events and also added outputs: ["HTML", "Calendar"] to each event.
Hopefully, that has not already been discussed here, as I couldn’t find anything related.
Thanks so much!
https://gohugo.io/templates/output-formats#configure-output-formats
noUgly
used to turn off ugly URLs If uglyURLs is set to true in your site. Default: false.
And, per:
https://gohugo.io/templates/output-formats#output-format-definitions
The defaut noUgly setting for the Calendar output formal is also false.
So we need to enable uglyURLs in the site configuration, and then disable it for the HTML output format:
config.toml
uglyURLs = true
[outputFormats.HTML]
noUgly = true
1 Like
mmmmd
August 11, 2021, 3:03pm
3
Thank you very much for you answer. I was searching with other terms and did not expect it to be named uglyURLs.
system
Closed
August 13, 2021, 3:04pm
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.