JSON feed from Wordpress + Webhooks/Websub = Display aggregated posts automatically?


#1

Hi,

Sorry if this question has already been asked or answered, I didn’t find in my research.

Until now, I use Hugo very basically : I push my markdown to my Gitlab CI which automatically publish my pages on my website.

But I miss something I use a lot with CMS, to aggregate the feeds of similar websites, and to list their last articles on the website, just the titles with follow links.A bit like a planet feed aggregator (https://en.wikipedia.org/wiki/Planet_(software))

I saw one guy who suggested to cron every 2 hours from a parsed rss feed downloaded with curl/wget or something like that.
Sweet idea, but I would actually like to be able to do it automagically with Webhooks/Websub(=PubSubHubbub).

So I was wondering, would it be possible that :

  • on a Wordpress website I control, I install Json Feed plugin
  • on this Wordpress website, I install a PubSubHub plugin too.
  • on my Git, thanks to PubSub/Webhooks or something, my Wordpress website inform my git server that a new article has been published, and BAM, it triggers a download of the new Json feed, and a build of Hugo which includes the new link

By the way, I don’t know either how to put in a specific section of my Hugo website the articles of the feed of the Wordpress website ?

I hope I was clear enough, and that my idea makes sense ^^
Wishing you a good night (it’s midnight here in France),

Yann


#2

Yeah, it’s possible. Unless you have a specific question about Hugo, we won’t be any help here. All those plugins and webhooks, you set those up and have better resources elsewhere to reference.

Is it possible to trigger rebuilds of Hugo to update content? Yes. All the ways. :slight_smile:


#3

Take a look at Data templates it has a section about data driven content

It basically allows hugo to call a url to get data from JSON or CSV files. Once you call the url Hugo can range through the nodes like you would markdown files for pages.

Currently Hugo isn’t able to generate pages from data sources but since you just want a list of URLs i think it’s perfect for your use case.

I have successfully used it to display information from a JSON feed. In my case it was a photo gallery on a different website.