kaushalmodi / hugo-atom-feed

Hugo theme component for ATOM feed custom Output Format
GNU General Public License v3.0
39 stars 13 forks source link
atom-feed custom-output-format hugo hugo-theme-component

This is not a standalone theme. This is a Hugo theme component.

This component enables ATOM feeds for your site.

This update on switch to using Hugo Modules was last tested with Hugo v0.92.0.

+begin_src conf-toml

disable_feed = true

+end_src

+begin_example

Content-Type: application/atom+xml; charset=UTF-8

+end_example

Note that even though the feed file extension is ~.xml~, the [[https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types][MIME type]] here is slightly adjusted from ~application/xml~ to ~application/atom+xml~.

While this might not be important for many feed readers, it could still be a source of error. So it is a good idea to play safe. How you could achieve this depends on the type of web server software you are running your website on. * Specifying the correct ~Content-Type~ for Netlify You can specify the /Content-Type/ of ~atom.~ and ~*.atom~ files to be ~application/atom+xml; charset=UTF-8~ using the below in your site's ~netlify.toml~:

+begin_src conf-toml

[[headers]] for = "atom." [headers.values] Content-Type = "application/atom+xml; charset=UTF-8" [[headers]] for = ".atom" [headers.values] Content-Type = "application/atom+xml; charset=UTF-8"

+end_src

*** References