Fill all Archetypes fields with `hugo new`

Hi, everybody.

Is it possible to submit all archetype fields using hugo new?

Thank you!

no. it wouldn’t know where to put anything, what to call it,

Thank you!

I wan’t to dinamically create a lot of MD files.

You’d do this by putting archetype templates in the archetypes/ folder of your site, corresponding to the “section” each page falls into. You can read more on archetypes in Hugo’s documentation.

Thank you, but it isn’t enough. The hugo new will not fill all front matter values.

I was considering to pass them as parameters on command line.

I’m starting with 95 items within a JSON. I don’t know the final number.

You can try importing them with some script. I use a ruby script for that.

then you just run it with ruby import.rb. You can adapt it to your needs.

require 'open-uri' let’s you retrieve info from a url.

1 Like

Thank you!

I gonna follow a NodeJS path, since it’s already a dependency of my project.


A dataContent folder could be really useful.

1 Like