AGENTS.md
Project Overview
This repository is the official r/SelfHosted wiki, a Retype-powered documentation site for people learning about and contributing self-hosting guides. The content is mostly Markdown with Retype YAML navigation/front matter, plus a small Bash helper for icon normalization and a Docker image that serves the static build with Apache httpd.
Repository Structure
.
|-- .github/workflows/ # GitHub Actions for Docker image build/publish and deployment backup
|-- _components/icon/fa/ # Custom Retype Font Awesome SVG icons
|-- _includes/ # Retype include files, including custom head HTML
|-- contributing/ # Contributor documentation and Retype section metadata
|-- guides/ # Self-hosting guide content grouped by topic
|-- learn/ # Introductory self-hosting learning pages
|-- scripts/ # Maintenance scripts; currently icon normalization
|-- static/ # Static assets such as the favicon
|-- Dockerfile # Production static-site image build
|-- index.md # Site homepage content
|-- retype.yml # Retype site configuration, branding, links, and output path
`-- README.md # Project intro and custom icon notes
Environment Setup
- Install Retype. The contributor docs point to the official Retype setup guide for general use.
- On macOS ARM64, this checkout includes local npm tooling for Retype 4.6.0. Run
npm installfrom the repository root ifnode_modules/is missing. - No application environment variables are required. Site configuration lives in
retype.yml. - When adding or replacing custom SVG icons, place them under
_components/icon/<pack>/<name>.svgand runbash scripts/normalize-icons.sh.
Build & Run
- Local preview:
npm run startstarts Retype and serves the wiki, usually athttp://127.0.0.1:5000/. - Production build:
npm run buildrunsprebuild, which normalizes icons, then runsretype buildinto.retype/. - Direct icon normalization:
npm run icons:normalize. - Docker build:
docker build . --file Dockerfile --tag wiki. The Dockerfile installs Retype 4.6.0 with the .NET 10 SDK, normalizes icons, builds the static site into.docker-build/, and serves it fromhttpd:2.4.
Testing
There is no separate automated test suite. Treat npm run build as the required validation for content, navigation, Retype front matter, and custom icon changes. GitHub Actions also validates the production Docker path on pushes to main by running docker build.
Code Style & Conventions
- Write pages in Markdown with Retype front matter. Regular pages should use a clear
label,icon: dot, andtitleonly when the full page title should differ from the sidebar label. - Keep content friendly, practical, beginner-aware, and concise. Explain technical terms the first time a beginner may not know them.
- Use headings in order; do not skip from
##to####. - Use descriptive link text. Prefer internal links for wiki pages, lowercase paths, and trailing slashes, such as
/guides/software/virtual-private-networks/wireguard/. - Use fenced code blocks with language tags for commands and configuration. Use inline code for filenames, commands, package names, and configuration keys.
- Run
npm run buildbefore submitting changes that affect content, navigation, Retype config, icons, or Docker build behavior.
Architecture Notes
- Retype builds from
input: .and writes generated output to.retype/; do not edit generated files. - Content is organized by top-level section folders. Each section uses
index.ymlfor folder-level navigation metadata and.mdfiles for pages. - Custom Retype icons are resolved from
_components/icon/<pack>/<name>.svgas<pack>-<name>inretype.yml. Font Awesome icons must be normalized to a24x24wrapper withscripts/normalize-icons.sh. - The production container does not rely on the local npm Retype package. Docker installs
retypeappviadotnet tool install retypeapp --version 4.6.0 --tool-path /bin. - The published static site is served by Apache httpd from
/usr/local/apache2/htdocs/.
Commit & PR Conventions
- No strict branch naming or commit message convention is documented in this repository.
- Keep PRs focused on one content or infrastructure change at a time.
- Before opening a PR, verify the wiki builds with
npm run build; for Docker or CI changes, also rundocker build . --file Dockerfile --tag wikiwhen Docker is available. - GitHub Actions builds and pushes
ghcr.io/r-selfhosted/wiki:lateston pushes tomain.
Things to Avoid
- Do not edit
.retype/,.docker-build/,retype.manifest,node_modules/, or other generated/local dependency output. - Do not add unnormalized Font Awesome SVGs; run
bash scripts/normalize-icons.shafter icon changes. - Do not use mixed-case wiki links or paths when lowercase paths are available; case drift can break Retype navigation on case-sensitive systems.
- Do not place a new page in a new folder unless the folder will be useful for more than one page.
- Do not bypass
index.ymlwhen adding or reorganizing sections; Retype navigation depends on the section metadata. - Do not assume the local npm Retype package is the production source of truth; the Dockerfile owns the production Retype installation path.