A Quarto website deployed on GitHub Pages.
- Quarto installed (comes with RStudio 2022.07+)
- R and RStudio
- Git
-
Clone your existing repo (if you haven't already):
git clone https://github.com/davidlaw0/davidlaw0.github.io.git cd davidlaw0.github.io -
Delete the old files (keep the
.gitfolder!):# On Mac/Linux: ls -A | grep -v '^.git$' | xargs rm -rf # On Windows (PowerShell): Get-ChildItem -Exclude .git | Remove-Item -Recurse -Force
-
Copy all the new template files into this folder. Your repo should now look like:
davidlaw0.github.io/ ├── _quarto.yml ├── styles.css ├── index.qmd ├── about.qmd ├── projects.qmd ├── resume.qmd └── projects/ ├── life-expectancy.qmd ├── sales-dashboard.qmd ├── lstm-text-gen.qmd └── r-analysis-template.qmd -
Update
_quarto.yml— change the output directory:project: type: website output-dir: docs # ← GitHub Pages will serve from this folder
-
Render the site:
quarto render
This creates a
docs/folder with the built HTML. -
Push to GitHub:
git add . git commit -m "Rebuild portfolio with new Quarto template" git push
-
Set GitHub Pages source (one-time setup):
- Go to your repo → Settings → Pages
- Under "Source", select Deploy from a branch
- Branch:
main, Folder:/docs - Click Save
- Your site will be live at
https://davidlaw0.github.ioin ~1 minute
If you'd rather not commit the docs/ folder and instead have GitHub build the site for you:
-
Change
_quarto.ymlto removeoutput-dir:project: type: website # no output-dir — GitHub Actions will handle it
-
Create
.github/workflows/publish.yml:on: push: branches: main name: Quarto Publish jobs: build-deploy: runs-on: ubuntu-latest permissions: contents: write steps: - name: Check out repository uses: actions/checkout@v4 - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 - name: Install R uses: r-lib/actions/setup-r@v2 with: r-version: '4.3.0' - name: Render and Publish uses: quarto-dev/quarto-actions/publish@v2 with: target: gh-pages env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
In GitHub repo Settings → Pages, set source to gh-pages branch.
Now every git push automatically renders and deploys your site.
-
Create a new
.qmdfile in theprojects/folder:cp projects/r-analysis-template.qmd projects/my-new-analysis.qmd
-
Write your analysis in RStudio — just like a regular notebook
-
Add a project card on
projects.qmd(copy an existing card block and update the title/description/link) -
Render and push:
quarto render git add . git commit -m "Add new analysis: my-new-analysis" git push
-
Your site updates within ~1 minute.
- Open your report in Power BI Service (app.powerbi.com)
- Go to File → Publish to web (for public) or File → Embed report (for private)
- Copy the
<iframe>embed code - Paste it inside the
.powerbi-containerdiv in your project's.qmdfile:
::: {.powerbi-container}
<iframe title="My Dashboard"
src="https://app.powerbi.com/reportEmbed?reportId=YOUR_ID..."
allowFullScreen="true">
</iframe>
:::- Theme: Change
theme: flatlyin_quarto.ymlto any Bootswatch theme (cosmo, lux, journal, etc.) - Colors: Edit the badge and card colors in
styles.css - Dark mode: Already enabled via
dark: darklyin_quarto.yml— users can toggle it - Favicon: Drop a
favicon.pngin theimages/folder