--- title: "Contributing to the course site" description: "How to fix a page, the OKF frontmatter contract every content page follows, how to read a failing CI check, how to build the site locally, what the pipeline scripts own, and the house style." type: Reference tags: [course, instructor-facing, contributing, okf, frontmatter, ci, style-guide] status: stable generated: by: "claude/fable-5-1" at: "2026-09-08T00:00:00Z" sources: - id: carc-contributing resource: "https://github.com/UNM-CARC/docs/blob/main/docs/about/contributing.md" title: "CARC Documentation: Contributing to these docs (adapted)" author: "team:unm-carc" - id: okf-spec resource: "https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md" title: "Open Knowledge Format (OKF) v0.2 specification" author: "team:google-cloud" --- # Contributing to the course site This site is a git repository of Markdown files under `docs/`, built with [Zensical](https://zensical.org){target=_blank} and structured as an [Open Knowledge Format (OKF) v0.2](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md){target=_blank} knowledge bundle: every page is readable by people *and* consumable by AI agents, with provenance and lifecycle signals in its frontmatter. The content was converted from the course wiki ([UA-AI2S/AI-Automation-and-Agents-v2](https://github.com/UA-AI2S/AI-Automation-and-Agents-v2){target=_blank}) by a reproducible script, and while the content team still edits the wiki the script can be re-run to pick up their changes. This page tells you how to change things without fighting that pipeline. ## Small fixes Every page has an **edit button** (:material-pencil:) at the top right that opens the source file on GitHub. Fix the text, propose the change as a pull request, and CI validates it; once merged it is deployed automatically. Before you do, check the page's frontmatter: - `generated.by: "process:scripts/migrate_wiki.py"` means the page is **owned by the pipeline** and will be regenerated from the wiki. Either make the fix in the wiki (it arrives at the next migration run) or add an exact-literal entry to the script's `PATCHES` table. A hand edit to the file itself is overwritten. - `generated.by: "process:nbconvert"` means a lab page rendered from a notebook; edit the `.ipynb` under `docs/materials/` and re-run the render. - `generated.by: "claude/fable-5-1"` or `"human:"` means a hand-written, **frozen** page (the landing page, everything under *Start here* and *About*, the instructor materials page, the two interactive Module 1 pages, and the update log). Edit it directly. ## The frontmatter contract Every content page starts with YAML frontmatter. OKF requires `type`; the rest make the page trustworthy and discoverable. A copy-paste template lives in `templates/page.md` in the repository. ```yaml --- title: "Module 1 Activities" description: "One sentence used by search, cards, llms.txt, and agents." type: Activity # closed set, lint-warned: Overview | Lesson | Reading Guide | Reading | Activity | # Worksheet | Lab | Assessment | Resource List | Tutorial | Guide | Course Design | Policy | Reference tags: [module-1, student-facing, activities, ollama, openwork, workflow-audit] # scope tag + audience tag + topics module: 1 # custom keys are tolerated by OKF consumers time_estimate: "8 hours" status: stable # draft | stable | deprecated (default stable) stale_after: "2027-07-22T00:00:00Z" # required when a tool tag (langchain, langgraph, crewai, langsmith, ollama, openwork, n8n, colab…) is present: last_modified + 12 months generated: by: "process:scripts/migrate_wiki.py" # hand-written pages: "claude/fable-5-1" or "human:"; notebook pages: "process:nbconvert" at: "2026-09-08T00:00:00Z" # constant per migration run, never now() (reproducible diffs) sources: - id: wiki-v2 resource: "" title: "AI Automation and Agents v2 wiki: Module-1:-Activities" author: "Michelle Yung; Carlos Lizárraga-Celaya" # real names from git log --follow last_modified: "2026-07-22T16:42:32-07:00" # git log -1 --format=%aI authorship: { created: "2026-04-22", updated: "2026-07-21", contributors: ["C. Lizárraga", "M. Yung"] } # from the wiki footer wiki_page: "Module-1:-Activities" # exact wiki stem; drives the crosswalk superseded_by: "../../modules/module-1/activities.md" # deprecated pages only; lint verifies it resolves --- ``` Key by key: - **`type`** is the closed set above. It says what kind of page this is (*Lesson* teaches, *Reading Guide* structures a reading, *Assessment* tests, *Course Design* documents the design, *Policy* states a rule). The linter warns on anything else. - **`tags`** always start with a *scope* tag (`course` or `module-N`) and an *audience* tag (`student-facing` or `instructor-facing`), then topics. Tool names are tags too - and they trigger the next rule. - **`stale_after`** is required on any page tagged with a tool or framework, set to twelve months after the source's last change. A monthly CI run surfaces pages past that date so someone re-checks versions, pricing and screenshots. Update the date when you re-check; do not just delete it. - **`status`** is `stable` by default. `draft` marks a page with a known content problem (it gets a *Draft* banner); `deprecated` marks history. - **`superseded_by`** is required on every `deprecated` page and must be a relative path that resolves. Deprecated pages live under `archive/` (or `course-design/` for historical design documents), carry a *Superseded* banner, and are never in the navigation. - **`generated`** and **`sources`** are provenance: who or what produced the current text and where it came from, with the upstream `last_modified` taken from git. - **Never write `verified`.** Only an instructor adds `verified: { by: "human:", at: … }` after reviewing a page; the linter rejects anything else. How and when is described in [Instructor materials](../course-design/instructor-materials.md). Section `index.md` files are OKF directory listings and carry **no frontmatter**; the pipeline generates them, so do not hand-edit them. The root `docs/index.md` is the only index with frontmatter. `docs/log.md` is the dated change log: add a `## YYYY-MM-DD` entry (newest first) with a bullet prefixed **Initialization**, **Migration**, **Creation**, **Update**, **Deprecation** or **Removal** whenever you make a meaningful change. ## How to read a red X CI runs three checks on every pull request. Open the *Files changed* tab; the failures are annotated on the exact line. | Check | What it enforces | Typical message and fix | | :-- | :-- | :-- | | `scripts/okf_validate.py docs` | OKF conformance: parseable frontmatter, a non-empty `type`, `status` in the allowed set, ISO 8601 `stale_after`, no frontmatter on section indexes, ISO date headings in `log.md` | `ERROR modules/module-2/x.md: frontmatter missing non-empty type` - add the key. `unparseable YAML frontmatter` - usually an unquoted colon in a title or description; quote the string. | | `scripts/site_lint.py docs zensical.toml` | Course rules: one H1, `title` and `description` present, every relative link and image resolves, external links carry `{target=_blank}`, no wiki-era constructs (`[!NOTE]` alerts, `

` for one page. If the wiki gains a page, the script fails until you add it to `PAGES` or `DROPPED`. To adopt new wiki edits, move `WIKI_REF` forward, run the script, review the diff. - **`scripts/render_notebooks.py`** - converts each learner `.ipynb` under `docs/materials/` to a lab page with the *Open in Colab* / download / view buttons and the API-key warning. Instructor solutions are never rendered. - **`scripts/optimize_images.py`** - copies exactly the referenced images from `images/` (full-resolution originals) into `docs/assets/images/`, downscaled to at most 1600 px wide, keeping byte-exact file names. `--report` lists unreferenced originals. - **`scripts/okf_validate.py`**, **`scripts/site_lint.py`** - the two validators described above. - **`scripts/gen_llms_txt.py`** - builds `docs/llms.txt` (a linked outline per [llmstxt.org](https://llmstxt.org){target=_blank}) and `docs/llms-full.txt` (the whole corpus with frontmatter). - **`scripts/postbuild_agent_surface.py`** and **`scripts/check_site.py`** - run after `zensical build`: add the Markdown mirror, `okf:*` meta tags and `robots.txt` to `site/`, then assert the build is complete. - **`scripts/make_social_card.py`** - draws the 1200x630 `og:image` card into `docs/assets/social-card.png` from the site palette. Re-run it after changing the site name or tagline; `--check` fails if the committed PNG is stale. It needs Liberation, DejaVu or macOS system fonts, so it runs on a workstation rather than in CI. - **`scripts/okf_links.py`** - the one rule for publishing Markdown to agents: a relative link becomes an absolute URL pointing at the linked page's Markdown twin (page URL + `index.md`). Used by `postbuild_agent_surface.py` when it mirrors a page and by `gen_llms_txt.py` when it builds `llms-full.txt`; the sources under `docs/` keep their relative links. - **`scripts/check_consistency.py`** - checks that the lab notebooks, the activities pages, the module overviews and *Labs, Colab, and API keys* agree on submission filenames, time budgets, learning-objective labels, provider defaults and what each lab contains, and that every quiz question has feedback for every option. Run it after changing any of those; it is not part of CI. ## Style notes - **One `# ` H1 per page**, matching the frontmatter `title`. Headings carry no letter or roman-numeral prefixes and no time estimates; put an italic *Estimated time: ~N min* line under the heading instead. - **Admonitions, not one-column tables.** The wiki's `| HINT |` and `| WHAT TO SUBMIT |` boxes become `!!! tip "Hint"` and `!!! info "What to submit"`; use `!!! note`, `!!! warning`, `!!! example` and `??? question` the same way. - **Answer keys go in `??? success "Show answer and feedback"`** collapsibles (or `??? note` for key tables), never in plain text. The linter fails a key line outside a `???` block. - **Diagrams** are written as Mermaid inside a `mermaid` fence, not committed as pictures. The source stays readable in the diff, the figure cannot quietly go stale the way a binary can, and anyone can edit it without image tooling. - **Tables** are written as Markdown tables. A table shipped as a screenshot is invisible to search, to screen readers and to `llms.txt`, and it cannot reflow on a phone. - **Images** are for photographs and screenshots of real interfaces. They live in `docs/assets/images/` and are referenced relatively with alt text and an `attr_list` width — `![alt text](){ width="900" }`. Add the original to `images/` and let `optimize_images.py` produce the served copy; never link to a GitHub `blob` URL. - **Downloadable materials** (notebooks, PDFs, HTML activities, the glossary `.docx`) live in `docs/materials/moduleN/` and are linked relatively. Anything only instructors should have goes in `instructor/`, outside `docs/`. It is never rendered on the site, and only the instructor materials page links to it, by its GitHub URL. - **Links**: internal links are relative (`../modules/module-2/overview.md`) and plain; external links get `{target=_blank}`. Raw HTML `src`/`href` attributes are not rewritten by the build, so compute them from the rendered directory URL (`../../../materials/…` from a page two levels deep). - **Code** goes in fenced blocks with a language (`python`, `bash`, `text`). - Keep the wiki's voice: short paragraphs, direct instructions, real examples. ## Pull requests The pull request template lists the six things reviewers check: frontmatter with a `type`, one H1, relative internal links and `{target=_blank}` external ones, both validators run, `gen_llms_txt.py` run, and a `docs/log.md` entry. Keep pull requests to one topic so the log entry can describe them in a line.