How might I display custom metadata fields in individual pages on my blog? #8155
Replies: 1 comment 2 replies
-
Note that EJS templating is for now only available to users for custom listings. Take a look at other websites: https://github.com/mcanouil/awesome-quarto#websites-formats The discussions you shared are exactly what you want to do. |
Beta Was this translation helpful? Give feedback.
-
Description
In my frontmatter for each blog post I have a special key,
usefulness
, e.g.How can I best implement some custom display logic for this field (e.g. maybe I want to display a number of stars equal to the usefulness value, for every blog post?
Templates for individual pages seem not be be obvious; AFAICT the default HTML page for a single post is quarto-cli/src/resources/formats/html/templates/quarto-html.ejs.
Possibly a better way of doing stuff is altering the
template-partials
which seems to be able to override some bits of the complicated master-template (?), although it seems to use some pandoc templating system distinct from the EJS system used by other parts of the website building toolchain. I think? the template-partials documentation is not terribly clear to me.There are a few related questions about
template-partials
:As such, I suspect that the answer might be simply "try to work it out by trial and error for now" and maybe "please submit a documentation pull request if you succeed". If no-one has a great answer for this, I will work it out by trial and error and answer my own question eventually; but if people have hints that will save time I'd love to hear them
Beta Was this translation helpful? Give feedback.
All reactions