Can Hugo directly create content from remote without the use of extra scripts?

Continuing the discussion from Integration of Google Sheets API:

Hi there,

Since Hugo get data from remote can it be used in native Hugo to turn the data to content without the use of extra scripts or code?

the content I get is from google sheets in .csv format and each row is a house listing for sale/rent

Since Hugo gets this data can it just directly convert it to pages in the

content/listings/listing1/index.md
content/listings/listing2/index.md
content/listings/listing3/index.md

andeverytime I run Hugo the get.Remote simply check and update the content which already exist if changed. or it is not possible to do such things with native Hugo?

Thanks

Yes, but this is (currently) a somewhat advanced topic. There are a couple of approaches, but in my view this is the best approach:
https://www.thenewdynamic.com/article/toward-using-a-headless-cms-with-hugo-part-1

You run Hugo twice: once to create markdown files from data, then again to publish the site.

1 Like

Thanks agains @jmooring

This is a very nice post but since it was published 2 years ago when Hugo was on v0.101.0 I wonder if this is still the best way to do it?

It would be great if I can set in the site config something to import data such as:

Params:
 remotePages:
  url: https://remotedata.com/test.json
  directory: content/listings/

So that Hugo take the listings from the remote and create listing pages in content/listings/

Thanks

Yes.

You can, but you still need to use the approach described in the article.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.