kaushalmodi · 2022-05-04 13:32
Hello all,
I am posting this here to start planning for solutions once the YAML front-matter option is removed.
## Why remove YAML?
I had a lot of loose code to support both TOML and YAML exports and it worked OK so far. But that implementation wasn't generic enough to support more planned features in ox-hugo.
I prefer TOML over YAML (but that's a discussion for another day) and so I decided to pick just that and develop a generic library that would convert Lisp data to TOML. That was roughly a week back when I wrote this post: https://scripter.co/defining-tomelr/.
Fast forward to today; I ended up creating `tomelr.el` and I wrote about it in https://scripter.co/presenting-tomelr/.
The end-user wouldn't typically care if the front-matter was in TOML or YAML because that front-matter is mainly for Hugo's consumption. But it would be more of a ox-hugo maintenance headache if I were to keep supporting both.
And so YAML support will be going away ..
## `ox-hugo` v0.11.0 Release
https://github.com/kaushalmodi/ox-hugo/releases/tag/v0.11.0
## Why am I posting this here?
If you are an ox-hugo user and set `org-hugo-front-matter-format` to `"yaml"`, try removing that customization (or set it to `"toml"`) and see if the latest version of ox-hugo causes any problem for you.
Theoretically, it should make no difference in the final website created by Hugo. But if you do see any issue, please report it on https://github.com/kaushalmodi/ox-hugo/issues.
takeonrules · 2022-05-04 13:58
Thank you for publicizing the notice. I use YAML so knowing about this will help me transition.
Fun_Republic_1882 · 2022-05-04 14:42
tbh yaml should be removed from existence
kaushalmodi · 2022-05-04 17:00
Thanks! Yes, this post is for users who set the front-matter format to YAML. So I'd like to know if switching to TOML breaks anything for you (it shouldn't unless you are using the Extra front-matter feature).
takeonrules · 2022-05-04 19:17
I am using the following properties:
- `#+HUGO_FRONT_MATTER_FORMAT`
- `#+HUGO_CUSTOM_FRONT_MATTER`
- `#+HUGO_BASE_DIR`
- `#+HUGO_SECTION`
I'm definitely prepared to do some work to map to the new application.
I have an export org to my site script that assembles the front-matter as I want it.
kaushalmodi · 2022-05-04 20:03
> `#+HUGO_FRONT_MATTER_FORMAT`
Can you try deleting this and see if anything breaks for you? Rest of the options can remain as-is.
> I'm definitely prepared to do some work to map to the new application.
What work will be needed here?
> I have an export org to my site script that assembles the front-matter as I want it.
Can you give an example? What does your site script do to the front-matter?
takeonrules · 2022-05-04 20:18
> What work will be needed here?
I don't know, but if I upgrade and things break for me, I'll fix it.
> Can you give an example?
https://github.com/jeremyf/dotemacs/blob/main/emacs.d/takeonrules.org#extending-the-ox
(Let me know if you need more context. I love ox-hugo and want to help how I can)
kaushalmodi · 2022-05-04 20:50
I briefly looked at your setup (you have quite an elaborate one!), and I think that even if you change the :default from "yaml" to "toml", things should just work as before /fingers_crossed!
> I love ox-hugo and want to help how I can
Thank you!
[deleted] · 2022-05-05 00:38
[deleted]
takeonrules · 2022-05-05 04:43
I have some "once it's in Hugo" scripts that assume Yaml. But TOML's something I could migrate towards. It'll be a bit of work, but also an opportunity to revisit that end of the build script.
kaushalmodi · 2022-05-05 13:02
>I have some "once it's in Hugo" scripts that assume Yaml.
Understood.
> But TOML's something I could migrate towards.
👍 Let me know if you need any help. I haven't tested this yet, but the custom front matter should now start supporting more complex nesting of data now that it's processed using tomelr.