|
1 | 1 | # Repository Guidelines |
2 | 2 |
|
| 3 | +Use this guide when contributing to Code @ LHC's Hugo site to keep content consistent and builds reliable. |
| 4 | + |
3 | 5 | ## Project Structure & Module Organization |
4 | | -- `content/` houses Markdown with TOML front matter; subfolders mirror site navigation and service areas. |
5 | | -- `layouts/` overrides theme templates; keep page partials grouped by section to avoid collisions. |
6 | | -- `assets/` collects SCSS and pipeline assets compiled by Hugo Extended. |
7 | | -- `static/` serves images and downloads verbatim; store heavy media externally and link here. |
8 | | -- `data/` exposes YAML/TOML snippets consumed by shortcodes, ideal for project inventories. |
9 | | -- `themes/` includes `kode` (active) and `hugo-arcana`; treat them as git submodules and avoid direct edits without upstream PRs. |
| 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. |
10 | 13 |
|
11 | 14 | ## Build, Test, and Development Commands |
12 | | -- `hugo server -D --disableFastRender` starts a local preview with drafts and reloads assets on each request. |
13 | | -- `hugo --minify --gc` produces the production bundle in `public/`, pruning unused fingerprinted assets. |
14 | | -- `git submodule update --init --recursive` syncs theme sources after cloning or switching branches. |
| 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. |
15 | 20 |
|
16 | 21 | ## Coding Style & Naming Conventions |
17 | | -- Author content in Markdown with TOML front matter; use snake_case filenames for multi-word slugs. |
18 | | -- Wrap prose near 100 characters and prefer semantic Markdown (lists, tables) over ad-hoc HTML. |
19 | | -- Keep SCSS indented with two spaces and rely on Hugo Pipes; do not commit compiled CSS. |
| 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. |
20 | 27 |
|
21 | 28 | ## Testing Guidelines |
22 | | -- Verify new pages via `hugo server` and watch for console warnings about missing resources or broken links. |
23 | | -- Before pushing, run `hugo --minify` locally and open `public/index.html` to spot layout regressions. |
24 | | -- The repository has no automated unit tests; document manual verification steps in the pull request description. |
| 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. |
25 | 35 |
|
26 | 36 | ## Commit & Pull Request Guidelines |
27 | | -- Follow the existing `type: [scope] message` pattern (e.g., `new: [project] Add Range42`) and keep messages imperative. |
| 37 | +- Follow the existing `type: [scope] message` pattern (e.g. `new: [project] Add Range42`) using imperative verbs. |
28 | 38 | - Group related changes per commit, separating content edits from theme updates to ease review. |
29 | | -- Pull requests should link related issues, describe the change, list manual checks, and attach screenshots for UI adjustments. |
| 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. |
30 | 41 |
|
31 | 42 | ## Security & Configuration Tips |
32 | 43 | - Global settings live in `config/_default/`; review `params.toml` before introducing site-wide toggles. |
|
0 commit comments