and so on. So, I want to generate a JSON file only for all the posts in section 3. How can I do that?
I tried adding section3 = ["HTML", "JSON"] in [outputs] in config.toml, but that didn’t work, or maybe I did something wrong. If this is correct, where exactly should I place the layout for this JSON file? At present, I have it at layouts/section3/single.json.
tryed it with XML sitemap, an empty template (zero bytes) will generate nothing, no file there.
Could be the solution - until hugo will dislike it any day.
Makes sense. So, to sum it up, I need a JSON file in layouts/single.json, which should be empty. And where would the section-specific one go, in the layouts/section/single.json?
Oops, sorry yeah, that’s what I meant. Sadly, that doesn’t seem to work. I can’t see any JSON file generated in my public/section3/post1/<file-name>.json. I’m trying using hugo server --renderToDisk.
as a shell script should do the trick. I have a shell script that runs before hugo and one for after hugo for these things. There is a lot hugo can’t and shouldn’t do that I delegate to these release scripts.
Edit: Ehm, I am on Ubuntu. There might be similar solutions for other OSses, but I won’t be dabbling there
Yeah, this seems to work fine! An individual JSON per song would have been better just to keep the JSON file size in control in case the number of songs gets too long. But, I suppose this can work for now.
Thanks a lot again.
EDIT: Seems like it works fine to generate one for individual song too. Great!