freeze: auto / true
For Quarto projects with many documents that include code, you probably won’t want to re-execute all of that code each time you render the project. The freeze
execution option is helpful for managing that.
For example, you might have a Quarto blog and when you render the website you wouldn’t want code from old blog posts to be re-rendered automatically, you would likely prefer to leave them as is as of the date they were published. Or you might be using Quarto for a course website and have slides, homework assignments, etc. in that website that you add as the semester progresses. You wouldn’t want to re-render all of those old documents each time you add new items to your website.
Managing execution for these purposes is straightforward with Quarto using the freeze
option in your _quarto.yml
file for your project, e.g.
execute:
freeze: true
You can set this option to true
or auto
. By default, it’s false
.
freeze: true
- Never re-render during project render. If you need the page/document to be re-rendered, you need to render that document individually.- This is the option I use for blogs as I want to make sure to avoid re-rendering old posts unless I explicitly do so.
freeze: auto
- Re-render only when source changes.- This is the option I use for my course websites – when I catch a mistake in earlier slide decks, and update the source code, I want those documents re-render next time I render my project, I don’t want to rely on remembering to re-render them myself.
Note that freeze
controls whether execution occurs during global project renders. If you do render a single document or a sub-directory in a Quarto project, then the code is always executed.