This repository contains a Quarto Reveal.js slide deck: intro-to-git.qmd. A GitHub Actions workflow automatically renders and publishes the presentation to the gh-pages branch (for GitHub Pages hosting) whenever changes are pushed to the main branch (or the workflow is run manually).
- Intro to Git (Quarto Reveal.js Slides)
Edit the source file: intro-to-git.qmd.
Basic structure:
# Heading(level 1) starts a new slide## Subheading(level 2) can create nested (vertical) slides- Use standard Markdown: lists, bold/italic, images, fenced code blocks
- Incremental list example:
::: incremental
- Point 1
- Point 2
:::Reveal.js feature reference: https://quarto.org/docs/presentations/revealjs/
| Feature | How (example) |
|---|---|
| Speaker notes | Add ::: notes block inside a slide |
| Incremental lists | Wrap list in ::: incremental ... ::: |
| Slide background | # Title {background-image="img/bg.png" background-size=cover} |
| Fragments | Use incremental list or inline {.fragment} class |
| Columns | :::{.columns} then two ::: {.column} blocks |
The _quarto.yml file defines global settings:
project:
type: default
output-dir: docs
format:
revealjs:
theme: dark
slide-number: true
hash: true
controls: true
progress: true
overview: true
transition: slide
code-copy: trueKey points:
format.revealjsblock controls the presentation look & behavior.- Change
theme:(e.g.theme: [dark, solarized]or a custom SCSS file). hash: trueenables deep‑linking to individual slides.output-dir: docsis used for local renders; the publish Action ignores this and pushes rendered HTML directly togh-pages.
More options: https://quarto.org/docs/presentations/revealjs/
- Install Quarto (if not already): https://quarto.org/docs/get-started/
- From the repo root, live preview while editing:
quarto preview intro-to-git.qmdThis starts a local server with auto-reload.
- Produce a one-time render:
quarto render intro-to-git.qmdThe HTML output goes into docs/ (per _quarto.yml). Open the generated .html in a browser.
Tip: Commit only the source (.qmd) and config; the GitHub Action will produce the published output.
Workflow file: .github/workflows/publish.yml:
on:
workflow_dispatch:
push:
branches: [main]
name: Quarto Publish
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: quarto-dev/quarto-actions/setup@v2
- uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
path: intro-to-git.qmd
render: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}How it works:
- Trigger: push to
main. - Action checks out the repo and installs Quarto.
- It renders
intro-to-git.qmd(becauserender: true). - It publishes the rendered presentation to the special orphan branch
gh-pages. - GitHub Pages serves the site from that branch.
- In the repository on GitHub: Settings → Pages.
- Set Source =
Deploy from a branch. - Select branch:
gh-pages/ root. - Save. After the workflow runs, the site will be available at:
https://<org-or-user>.github.io/<repo>/
A .nojekyll file (already present) ensures GitHub Pages does not process the site with Jekyll.
- Edit
intro-to-git.qmd. - (Optional) Preview locally with
quarto preview. - Commit and push:
git add intro-to-git.qmd
git commit -m "Update slides: add branching section"
git pushWait for the GitHub Action (check Actions tab). When it finishes, refresh the published URL.
You can render locally exactly like the workflow does:
quarto render intro-to-git.qmd --to revealjsIf you need to replicate a clean environment, use a container or a GitHub Codespace.
- Keep commits focused; use descriptive messages.
- Use Pull Requests for review before publishing.
- Avoid committing rendered HTML (Action produces deployable output).
- Quarto Reveal.js docs: https://quarto.org/docs/presentations/revealjs/
- Quarto project basics: https://quarto.org/docs/projects/
- GitHub Actions for Quarto: https://github.com/quarto-dev/quarto-actions
| Task | Command |
|---|---|
| Live preview | quarto preview intro-to-git.qmd |
| Render once | quarto render intro-to-git.qmd |
| Publish (CI) | Push to main branch |
| Manual publish | Trigger workflow dispatch in Actions tab |