build-pkgdown-sitelisted
Install: claude install-skill pjt222/agent-almanac
# Build pkgdown Site
Configure and deploy a pkgdown documentation website for an R package.
## When to Use
- Creating a documentation site for an R package
- Customizing pkgdown layout, theme, or navigation
- Fixing 404 errors on a deployed pkgdown site
- Migrating between deployment methods
## Inputs
- **Required**: R package with roxygen2 documentation
- **Required**: GitHub repository
- **Optional**: Custom theme or branding
- **Optional**: Vignettes to include as articles
## Procedure
### Step 1: Initialize pkgdown
```r
usethis::use_pkgdown()
```
This creates `_pkgdown.yml` and adds pkgdown to `.Rbuildignore`.
**Got:** `_pkgdown.yml` exists in the project root. `.Rbuildignore` contains pkgdown-related entries.
**If fail:** Install pkgdown with `install.packages("pkgdown")`. If `_pkgdown.yml` already exists, the function will update `.Rbuildignore` without overwriting the config.
### Step 2: Configure `_pkgdown.yml`
```yaml
url: https://username.github.io/packagename/
development:
mode: release
template:
bootstrap: 5
bootswatch: flatly
navbar:
structure:
left: [intro, reference, articles, news]
right: [search, github]
components:
github:
icon: fa-github
href: https://github.com/username/packagename
reference:
- title: Core Functions
desc: Primary package functionality
contents:
- main_function
- helper_function
- title: Utilities
desc: Helper and utility functions
contents:
- starts_wi