-
DescriptionHello all, I am interested in moving a hobby website from a bunch of glued together R scripts to Quarto. The website tracks union election information (you can view it here and the github here). The pages are generated by pulling data from the NLRB, process it using some R code and then using some other R code to fill in some details on markdown pages which are then fed through Hugo. I'd like to move this over to Quarto as I think it will be easier for me to to maintain/expand in the future this way. I also built this as a bit of an experiment, and I think I know better now how to not make it an absolute mess of code. What I'm wondering about is if anyone has any advice on ways to best set this up. In my head I have one template page for what a state page should look like, and then I have a list of states somewhere that is fed into that template to create each unique state page. I could obviously create an R script that does this, as I do now, but I was hoping there might be some sort of native way to do it. Any advice and thoughts would be appreciated. I hope this is an alright place to post this. Thanks, Kevin |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There are many ways to do this. Though not exactly what you seek this one is easy: Use the |
Beta Was this translation helpful? Give feedback.
-
You can use a pre-render script to create Quarto documents which will only contain YAML frontmatter and since you are using R/knitr, use |
Beta Was this translation helpful? Give feedback.
You can use a pre-render script to create Quarto documents which will only contain YAML frontmatter and since you are using R/knitr, use
params
to set custom elements, then have an include shortcode to include the content from an external Quarto document.This way you can create a bunch of small documents while keeping only one source for the content.
Note that currently, this will need two rendering for the first time: Quarto won't know about the generated documents at the first render as it "scans" before pre-render script.