URL's within JSON generated content

repo: https://github.com/CodyBontecou/mtgranks_hugo
data: https://mtgjson.com/json/AllSets.json

I am using the data linked above to generate a ton of links. The problem is, these links aren’t properly referencing the template I want them to (or any template for that matter).

How do I gain control of the URL routing for data generated content?

Hugo currently, as I type this, right now in spacetime, does not generate pages from data.

I can’t tell from looking at the repo what is happening. Is it supposed to create pages for each card? From the repo, there doesn’t look like many pages will be generated.

Hey Maiki,

Sorry, I should have been a bit more explicit. I have a local data directory that contains the AllSets.json file linked above at mtgjson.com. I didn’t want to include such a large file in my repo, so I decided to link to it instead. My hope is the actual data file is irrelevant, I’m more concerned about the routing and content creation that occurs when JSON data is provided.

Hugo currently, as I type this, right now in spacetime, does not generate pages from data.

Hugo won’t iterate over my JSON file and create HTML pages with the values requested? I’m confused, I thought this was a huge aspect of Hugo.

You can use Hugo’s commands in your template to:

  • generate lists of data, like a table, on a page,
  • pull specific values, indexing on some value, from your data and put that on a page

… but it does not create pages from the data. This has been requested for a while now but is not there yet.

Ah, interesting. Would a solution here be to convert the JSON to individual .md files?

Yeah, you could do that. I’m just gonna wait until Hugo does build pages from data. I’ve waited a couple years, I’m patient. :slight_smile: