Skip to content

DavidLaw0/DavidLaw0.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

David Lawrence - Data Science Portfolio

A Quarto website deployed on GitHub Pages.

Quick Start

Prerequisites


How to Deploy This to Your Existing GitHub Pages Repo

Option A: Replace everything (clean start — recommended)

  1. Clone your existing repo (if you haven't already):

    git clone https://github.com/davidlaw0/davidlaw0.github.io.git
    cd davidlaw0.github.io
  2. Delete the old files (keep the .git folder!):

    # On Mac/Linux:
    ls -A | grep -v '^.git$' | xargs rm -rf
    
    # On Windows (PowerShell):
    Get-ChildItem -Exclude .git | Remove-Item -Recurse -Force
  3. 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
    
  4. Update _quarto.yml — change the output directory:

    project:
      type: website
      output-dir: docs    # ← GitHub Pages will serve from this folder
  5. Render the site:

    quarto render

    This creates a docs/ folder with the built HTML.

  6. Push to GitHub:

    git add .
    git commit -m "Rebuild portfolio with new Quarto template"
    git push
  7. 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.io in ~1 minute

Option B: Use GitHub Actions (auto-build on push)

If you'd rather not commit the docs/ folder and instead have GitHub build the site for you:

  1. Change _quarto.yml to remove output-dir:

    project:
      type: website
      # no output-dir — GitHub Actions will handle it
  2. 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 }}
  3. In GitHub repo Settings → Pages, set source to gh-pages branch.

Now every git push automatically renders and deploys your site.


Day-to-Day Workflow: Adding a New Project

  1. Create a new .qmd file in the projects/ folder:

    cp projects/r-analysis-template.qmd projects/my-new-analysis.qmd
  2. Write your analysis in RStudio — just like a regular notebook

  3. Add a project card on projects.qmd (copy an existing card block and update the title/description/link)

  4. Render and push:

    quarto render
    git add .
    git commit -m "Add new analysis: my-new-analysis"
    git push
  5. Your site updates within ~1 minute.


Embedding Power BI Reports

  1. Open your report in Power BI Service (app.powerbi.com)
  2. Go to File → Publish to web (for public) or File → Embed report (for private)
  3. Copy the <iframe> embed code
  4. Paste it inside the .powerbi-container div in your project's .qmd file:
::: {.powerbi-container}
<iframe title="My Dashboard"
  src="https://app.powerbi.com/reportEmbed?reportId=YOUR_ID..."
  allowFullScreen="true">
</iframe>
:::

Customization

  • Theme: Change theme: flatly in _quarto.yml to any Bootswatch theme (cosmo, lux, journal, etc.)
  • Colors: Edit the badge and card colors in styles.css
  • Dark mode: Already enabled via dark: darkly in _quarto.yml — users can toggle it
  • Favicon: Drop a favicon.png in the images/ folder

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages