Open utterances-bot opened 2 years ago
Is there a way to have 'last updated date' appear for pages created using quarto?
Hmm, not sure. With quarto, the footer is set in the _quarto.yml
file using the page-footer
option.
Off the top of my head, one hack that might work is to write a function that updates a _variables.yml
file with the current date, and then call that variable in the _quarto.yml
file, something like this:
page-footer:
center:
- text: 'Last updated on {{< var update_date >}}
For this to work, you would need a _variables.yml
file in your project root with the update_date
variable defined, something like:
update_date: "2022-08-04"
Like I said, it's sort of hacky, but if you wrote a simple function that over-writes the update_date
variable every time the site is rendered, it might work.
Oh this sounds promising! As of now, I just put Sys.time()
at the end of the .qmd
files. So while rendering, it automatically gives the output time at which it got rendered. Not very elegant but does the job. Your idea seems more elegant, I will try to see if I can get it working. Thanks!
Yeah I'd prefer to have a solution where I don't have to edit things on each qmd file. The footer should be a "global" thing that's the same on each page, so preferably it should be a sort of "set it and forget it" thing.
jhelvy.com: Customizing distill with {htmltools} and CSS
https://www.jhelvy.com/posts/2021-03-25-customizing-distill-with-htmltools-and-css/