Publishing by hand means the same four steps every time: render, check, commit, push. publish.sh does them in one line.
Daily Use
./publish.sh posts/my-new-post.qmd # one post
./publish.sh posts/a.qmd posts/b.qmd # several posts
./publish.sh --all # whole site
./publish.sh -m "Add the tags post" posts/tags.qmd # custom commit message
./publish.sh --no-push posts/draft.qmd # render and commit, look firstWith no arguments it skips rendering and just refreshes the data file, then commits and pushes whatever is pending.
What the Script Does
- Finds the Quarto project (the folder with
_quarto.yml). - Renders each file you name.
quarto rendertakes one file per call, so the script loops. - Stages the project folder only, so unrelated changes elsewhere in the repository are left alone.
- Stops if a render fails, and skips the commit when nothing changed.
- Runs
git pull --rebase --autostashand thengit push.
Why One Post Is Enough
Blogkit rebuilds its data file on every render, even of a single post. The archive, tags and related posts on all other pages read from that file in the browser, so you never have to re-render the whole site after adding one post. A full --all render is only needed after you change the theme, the stylesheet’s structure or _quarto.yml.
Setting Up GitHub Pages
The sample project builds into docs/. In your repository go to Settings, Pages, choose the main branch and the /docs folder. Because the built HTML is committed, GitHub needs no build step and Quarto does not have to be installed there.
Preview Before You Push
cd docs
python3 -m http.server 8000 # then open http://localhost:8000Use a hard refresh so the browser does not show stale files. If you like changing things first and publishing later, see Customising the Theme.