Hello folks,
My question is in the same vein as Fill all Archetypes fields with hugo new
, but I just want to double check. Didn’t find an answer in docs or discourse posts.
I have an archetype with some custom fields that I denote with <<fieldname>>
. The <<
and >>
merely serve as visual reminders to manually replace those values when filling out the content file. I’d rather set them when calling hugo new.
Here’s an example archetype:
---
title: Project <<phase>> | <<aspect>>
weight: 1
description: "Infor for <<aspect>> of phase <<phase>>"
phase: <<phase>>
aspect: <<aspect>>
ccfooter: {{ .Site.Params.footer_cc_by_nyc_4_0 }}
date: {{ .Date }}
draft: true
---
I’d like to set <<phase>>
and <<aspect>>
when invoking hugo new, like:
hugo new foo/bar/mycontent.md --archvar phase=Early --archvar aspect="Completion Time"
Of course, --archvar is not a valid parameter and is only for expressing my wish.
If not possible, I suppose chaining script or sed string substitution call after hugo new would do the trick.
Oh, and thanks for the hard work on Hugo. The more I use Hugo, the more I love it.
Mike