|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +Use this guide when contributing to Code @ LHC's Hugo site to keep content consistent and builds reliable. |
| 4 | + |
| 5 | +## Project Structure & Module Organization |
| 6 | +- `content/` houses Markdown with TOML front matter; subfolders mirror site navigation and service areas. Prefer Hugo shortcodes (e.g. `readme`) over raw HTML embeds. |
| 7 | +- `layouts/` and `layouts/shortcodes/` override theme templates; keep page partials grouped by section to avoid collisions. |
| 8 | +- `assets/sass/` contains the SCSS processed by Hugo Extended; rely on the Hugo Pipes pipeline instead of committing compiled CSS. |
| 9 | +- `static/` serves images and downloads verbatim; store heavy media externally and link here only when needed. |
| 10 | +- `data/` exposes YAML/TOML snippets consumed by shortcodes, ideal for project inventories and shared content blocks. |
| 11 | +- `themes/kode` (active) and `themes/hugo-arcana` are git submodules; sync them before editing and avoid direct changes without upstream pull requests. |
| 12 | +- `public/` is generated build output; never edit it manually. |
| 13 | + |
| 14 | +## Build, Test, and Development Commands |
| 15 | +- `git submodule update --init --recursive` ensures theme sources are available after cloning or switching branches. |
| 16 | +- `hugo server -D --disableFastRender` runs a local preview with drafts enabled and reloads assets on each request (http://localhost:1313). |
| 17 | +- `hugo --cleanDestinationDir --gc --minify` mirrors the CI build, prunes unused assets, and writes fresh output to `public/`; run before pushing. |
| 18 | +- `hugo --panicOnWarning` catches missing resources, shortcode errors, or front matter issues during review. |
| 19 | +- `npm ci` (optional) installs theme tooling when a `package-lock.json` is introduced or updated. |
| 20 | + |
| 21 | +## Coding Style & Naming Conventions |
| 22 | +- Follow `.editorconfig`: 4-space indentation by default, 2 spaces for HTML/CSS/JS/YAML, tabs only in `Makefile`; always keep UTF-8 with LF endings and a trailing newline. |
| 23 | +- Author content in Markdown with TOML front matter; wrap prose near 100 characters and prefer semantic Markdown (lists, tables) over ad-hoc HTML. |
| 24 | +- Name new content files in `kebab-case.md`; include standard fields like `title`, `author`, `description`, `repository`, `weight`, and `draft`. Legacy files may differ—match nearby conventions when touching existing content. |
| 25 | +- Keep SCSS indented with two spaces and organized by component; do not commit generated CSS. |
| 26 | +- Place reusable snippets in `layouts/shortcodes/` instead of embedding raw HTML directly in content files. |
| 27 | + |
| 28 | +## Testing Guidelines |
| 29 | +- Toggle `draft = true` while iterating on new pages, flipping to `false` only when ready to publish. |
| 30 | +- Verify new or updated pages via `hugo server` and watch the terminal/browser console for warnings about missing resources or broken links. |
| 31 | +- Run `hugo --cleanDestinationDir --gc --minify` locally and spot-check `public/index.html` (or affected pages) for layout regressions. |
| 32 | +- Use `hugo --panicOnWarning` to fail fast on front matter or shortcode issues. |
| 33 | +- After Sass changes, confirm compiled styles in the browser and resolve any console warnings. |
| 34 | +- The repository has no automated unit tests; document manual verification steps in pull requests. |
| 35 | + |
| 36 | +## Commit & Pull Request Guidelines |
| 37 | +- Follow the existing `type: [scope] message` pattern (e.g. `new: [project] Add Range42`) using imperative verbs. |
| 38 | +- Group related changes per commit, separating content edits from theme updates to ease review. |
| 39 | +- Pull requests should link related issues, describe the change, list manual checks (commands run), and attach screenshots or GIFs for UI adjustments. |
| 40 | +- Confirm `hugo --cleanDestinationDir --minify` (and other relevant checks) passes before requesting review. |
| 41 | + |
| 42 | +## Security & Configuration Tips |
| 43 | +- Global settings live in `config/_default/`; review `params.toml` before introducing site-wide toggles. |
| 44 | +- The default `theme_kode` branch deploys via `.github/workflows/hugo.yml`; keep the pinned Hugo Extended (0.108.0) and Dart Sass versions updated together when bumping. |
0 commit comments