[question] Is it possible to pass parameters from the frontmatter to an HTML template?

Message ID
DKIM signature
Download raw message

In Jekyll it is possible to pass parameters from the frontmatter to
Liquid templates. In particular I am very interested in doing the
following through gmnitohtml:


title: Foo
  description: bar


<meta name="description" content="{{ .Params.description }}" />

if this is already possible, could you be so kind as to tell me how to
do it?

Best regards.
«Si no puedo seguir el ritmo de todo lo que me vaya llegando, voy a
tratar de mantenerme al día de todo lo que pueda. Si no puedo responder
a todos los mensajes que deseo responder, responderé únicamente
algunos, a medida que me vayan llegando.»

Fingerprint: 026D B8BE 3F5C 1533 FF9D 4CC2 DBB4 A5B9 17E5 72DE
Message ID
<20210518100839.053456cb@shaka> (view parent)
DKIM signature
Download raw message
This should already be possible using the exact method you posted,
though it requires the use of HTML templates.

I assume you are using gmnitohtml as a postprocess command. Instead,
you can use it as a preprocess command and use kiln to layout the
content in a template, where you can then access the .Params field.

Your configuration could look something like:

	input = [".gmi"]
	output = ".html"
	template = ".html"
	preprocess.gmi = "gmnitohtml"
	output_dir = "public/https"

And then you can rename your HTML template to base.html. You might also
need to create the page.html and index.html templates for pages and
indexes to be rendered, but you can leave them empty to use the
base.html template unchanged. Eventually you shouldn't need to create
these templates for the base template to be used.
Reply to thread Export thread (mbox)