To enable search on my blog, I’d like to create json files containing, for instance, post titles and URLs. Nothing complicated but I think it’s impossible right now.
A good feature, I think, would be to create custom templates like the RSS or sitemap which are in Hugo core. That way, I could define an output specific to my need and I guess it could be useful for other needs too.
Let me know if you need more information about this suggestion.
Indeed, I read the whole topic with great interested and was thinking of doing this hack. But I think a way to create any template you want would be nice.
Well, I spoke to quickly : it does work to generate a JSON file, but now I have many problems with my blog. Every other post are not rendered the way they should, I guess it’s a type problem, but I have tried everything I could think of :
add post as the default type in config file
add an explicit post type to all my posts
even duplicate the single.html template in a “post” subfolder.
Nothing works, as you can see here : http://futur.voiretmanger.fr I have only the cover image and the title is deviated from the URL. I don’t understand why…
Lets say it like this: I have not idea, and the above mentioned method is experimental and unsupported (hehe) … Hugo will eventual come with something clever.
I understand. I’ll check on the other post to see if there is a fix for me. If not, I guess I’ll follow the Grunt path, but I’d like to do everything with Hugo.
Let’s hope we’ll have something clever some day, then…
To give more credit to my initial idea : I guess this ability to create custom templates could enable a sorte of infinite scrolling, or at least use AJAX to load pages when listing posts.
If you could define the pagination pages with a custom template instead of a standard one (so in my example, with just the list, no header or footer), I think it would be easy.