Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What this is

Jacob Dawang's personal website and blog at [jacobdawang.com](https://www.jacobdawang.com), built with [Quarto](https://quarto.org/). Blog posts are data analysis pieces focused on Edmonton housing, zoning, and transit, written in R using Quarto documents (`.qmd`).

## Build commands

```bash
# Preview site locally (live reload)
quarto preview

# Render the full site
quarto render
```

Always render a single post from within the post's directory. This allows for the post to be rendered within its own environment. For example:
```bash
# Render a single post (from post directory)
cd blog/2026/nodes-corridors
quarto render blog/2026/nodes-corridors/index.qmd
```

Deployment is automatic via GitHub Actions on push to `main`: renders with Quarto and deploys to Cloudflare Pages. Deployment to a preview url is automatic via GitHub actions on pushes to open pull requests.

## Architecture

- **`_quarto.yml`**: Site-level config (theme, navbar, footer, extensions). `freeze: true` means computed R outputs are cached in `_freeze/` and not re-executed unless the source changes.
- **`blog/_metadata.yml`**: Defaults for all blog posts (freeze, echo/message/warning suppression, giscus comments, title-block-banner).
- **`_freeze/`**: Cached execution results (JSON + figures). Committed to the repo so CI doesn't need R packages installed.
- **`_site/`**: Build output, committed to repo.
- **`_extensions/`**: Quarto extensions (fontawesome, iconify, social-embeds).
- **`custom_styles.scss` / `custom_styles_dark.scss`**: Theme overrides for light/dark modes on top of the cosmo Bootstrap theme.
- **`data/`**: Shared datasets (geojson, csv, zip) referenced across blog posts.

## Blog post structure

Each post lives at `blog/YYYY/post-slug/index.qmd`. The frontmatter pattern:

```yaml
---
title: "Post title"
date: "YYYY-MM-DD"
author: "Jacob Dawang"
categories: [category1, category2, category3]
description: "few sentence summary"
link-external-newwindow: true
link-external-icon: false
---
```

Posts use R code chunks with knitr. Common libraries: `tidyverse`, `sf`, `gt`, `ggplot2`, `cancensus`, `mountainmathHelpers`. Data paths typically reference `../../../data` relative to the post via `here()`.

## R package management

Posts have their own `renv.lock` for reproducibility. To restore packages for a specific post:

```bash
cd blog/2026/nodes-corridors
Rscript -e "renv::restore()"
```

When creating a new post, always:

- Initialize renv in its directory using `renv::init()`.
- Install required packages before trying to execute code.

If you come across an error like "[package name or function name] not found", that is most likely due to not installing the package. Install it and try again.

Before committing changes to a blog post, always run `renv::snapshot()` from within its directory to ensure the environment is saved.

## Freeze behaviour

Because `freeze: true` is set globally, rendered outputs are stored in `_freeze/` and reused. To force re-execution of a post's R code, change into the post's directory and rerender it with the `--no-freeze` option.

```bash
cd blog/2026/nodes-corridors/
quarto render blog/2026/nodes-corridors/index.qmd --no-freeze
```

The `blog/2022/election-maps-2022/index.qmd` is explicitly excluded from rendering in `_quarto.yml`.
16 changes: 8 additions & 8 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM ghcr.io/rocker-org/geospatial:4.5.2

RUN sudo curl -sLO https://cdn.posit.co/positron/releases/deb/x86_64/Positron-2026.01.0-147-x64.deb \
RUN sudo curl -sLO https://cdn.posit.co/positron/releases/deb/x86_64/Positron-2026.03.0-212-x64.deb \
&& sudo curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg \
&& sudo sh -c 'echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list' \
&& sudo apt-get update \
&& sudo apt install -y ./Positron-2026.01.0-147-x64.deb \
&& sudo apt install -y ./Positron-2026.03.0-212-x64.deb \
&& sudo apt install -y \
bat \
fonts-firacode \
r-rig \
zsh \
cargo \
rustc \
bat \
fonts-firacode \
r-rig \
zsh \
cargo \
rustc \
&& sudo curl -sS https://starship.rs/install.sh | sh -s -- -y \
&& chsh -s $(which zsh) \
&& rig add 4.5.2
15 changes: 15 additions & 0 deletions _freeze/blog/2026/property-values/index/execute-results/html.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ project:
- "blog/**/*.md"
- "!blog/2022/election-maps-2022/index.qmd"
- "!README.md"
- "!blog/2025/property-values/index.qmd"
- "!blog/2025/election/index.qmd"
- "!blog/2025/nodes-corridors-bp/index.qmd"

execute:
freeze: true
Expand Down
2 changes: 1 addition & 1 deletion blog/2025/property-value-preliminary/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ prepped %>%

## Next up

While descriptive analysis is useful, I do plan on examining this question further using models which can control for the effect of neighbourhood, specific properties, and more. Meanwhile, on a surface level, it doesn't seem like infill has any effect on property values, positive or negative.
While descriptive analysis is useful, I do plan on examining this question further using models which can control for the effect of neighbourhood, specific properties, and more. Meanwhile, on a surface level, it doesn't seem like infill has any effect on property values, positive or negative.
1 change: 1 addition & 0 deletions blog/2026/property-values/.Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source("renv/activate.R")
7 changes: 7 additions & 0 deletions blog/2026/property-values/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata

/.quarto/
data/
Empty file added blog/2026/property-values/.here
Empty file.
Loading