New page, who dis?
Contents 6 sections
This is my copy-paste template for new blog posts. I got tired of looking up the same Quarto features every time, so this is essentially just a growing example for me.
YAML frontmatter
Copy this header and adjust:
title: "Your Title Here"
description: "Brief description for SEO and social cards"
date: 2025-01-15
categories: [Statistics, R]
tags: ["brms", "Bayesian"]
draft: false # set to true to hide
cache: true # speeds up builds for R-heavy posts
Optional stuff:
heroImage: Header image pathheroImageScale: Zoom into the header image.1shows as much of it as the frame allowsheroImagePositionX,heroImagePositionY: Shift the image right and down, as a fraction of its own size.heroImagePositionY: 0.235puts the point 26.5% from the image’s top in the middle of the frame. The post’s card on the blog index shows the same spotlastUpdated: When you edited it
Typography
Drop caps are gorgeous, and automatic: the first letter of the first paragraph becomes one at build time. To leave a post without one, add this to the header:
dropcap: false
Math: inline like
Citations: (Cinelli et al. 2020) if you have a references.bib file.
Margin notes:
Normal notes:
I am not in the morgin but in the middle of the text instead.
R Code
Basic chunk:
library(ggplot2)
library(dplyr)
set.seed(42)
data <- data.frame(
x = rnorm(100),
y = rnorm(100) + 0.3 * rnorm(100),
group = sample(c("A", "B", "C"), 100, replace = TRUE)
)
head(data, 3)
x y group
1 1.3709584 0.6006866 B
2 -0.5646982 1.1448842 B
3 0.3631284 -0.6518111 C
Plots
ggplot(data, aes(x = x, y = y, color = group)) +
geom_point(alpha = 0.7) +
theme_minimal() +
labs(title = "Sample Data", x = "X values", y = "Y values")

Collapsible code
For longer setup that would clutter the post:
<details class="code-collapse">
<summary>Show data processing</summary>
Code goes here
</details>
Show data processing
processed_data <- data %>%
filter(!is.na(x), !is.na(y)) %>%
mutate(
x_scaled = scale(x)[,1],
y_scaled = scale(y)[,1],
distance = sqrt(x_scaled^2 + y_scaled^2)
) %>%
arrange(desc(distance))
head(processed_data, 3)
x y group x_scaled y_scaled distance
1 -2.656455 3.1449272 B -2.582179 3.3197211 4.205734
2 -2.993090 -0.8387712 C -2.905445 -0.7676472 3.005144
3 -2.440467 -1.4272253 C -2.374769 -1.3714150 2.742317
Standard markdown
Works as expected: bold, italic, code, links, lists, etc.
References
Cinelli, Carlos, Andrew Forney, and Judea Pearl. 2020. “A Crash Course in Good and Bad Controls.” SSRN Electronic Journal, ahead of print. https://doi.org/10.2139/ssrn.3689437.