This repository demonstrates how to keep your main Quarto website repository lightweight by storing generated figures in a separate git submodule.
├── _quarto.yml # Site configuration
├── index.qmd # Homepage
├── posts/ # Blog posts
│ └── welcome/
│ └── index.qmd
└── figures/ # Git submodule (external repository)
└── post-figures/
├── plot1.png
└── plot2.png
This repository is designed to be used as the main repository of a Quarto website/blog project. Figures are automatically generated by Quarto documents when they are rendered with proper fig.path
configuration into the figures/
submodule.
You need to clone the repository with its submodule to ensure the figures/
directory is included.
# Clone including the figures submodule
git clone --recursive https://github.com/coatless-tutorials/demo-figure-quarto-website.git
# Or if already cloned
git submodule update --init --recursive
You can view the Quarto website locally using the following commands:
# Preview the website
quarto preview
# Render the site
quarto render
The figures/
directory is a git submodule pointing to a separate repository. When you generate figures with Quarto, they're stored in the external figures repository, keeping this main repository lean and fast to clone.
Implementation guide: Stop Bloating Your Quarto Repository with Figure Files