[Academy Validation] Respect build draft mode in content ID validation#234
[Academy Validation] Respect build draft mode in content ID validation#234ritzorama wants to merge 2 commits into
Conversation
Draft modules are now only validated when the build actually renders them (hugo --buildDrafts). When draft mode is off, draft content is skipped entirely instead of being run through registry validation, so it is neither checked nor reported as a warning. Draft state is derived from Hugo's build-aware page status; the file-based draft fallback now marks such content with a neutral draft status and skips validation rather than emitting a draft warning. Drafts that are being built keep the existing soft draft_warning behaviour and never block publishing. Signed-off-by: Marcus Blom <158522975+marblom007@users.noreply.github.com>
|
There was a problem hiding this comment.
Code Review
This pull request updates the academy validation logic to respect Hugo's draft mode. It ensures that draft content is only validated when the build actually renders it (e.g., with --buildDrafts), and skipped entirely when draft mode is off. The README.md is updated to document this behavior, and the instructor toolkit layout is updated to display a 'Draft' status when appropriate. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR updates Academy content ID validation to respect Hugo’s draft build mode, so draft content that isn’t being rendered no longer triggers registry validation or warnings.
Changes:
- Adjust draft detection/handling in content health collection to distinguish “draft on disk” vs “draft built” and to skip validation for non-built drafts.
- Render a neutral
draftstatus in the Instructor Toolkit report table. - Document draft-mode-aware validation behavior in the README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Updates validation documentation to describe draft-mode-aware behavior. |
| layouts/shortcodes/instructor-toolkit.html | Adds UI handling for the new neutral draft status in the report table. |
| layouts/partials/academy-validation/collect-content-health.html | Updates draft-state derivation and validation flow to avoid warning on drafts that aren’t rendered in the current build mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{- /* A page only carries a Hugo draft flag inside $site.Pages when the build | ||
| itself included drafts (hugo --buildDrafts). Treat that as "draft mode on" | ||
| for this content: it is being rendered, so validate it softly below. */ -}} | ||
| {{- $draftBuilt := or .Draft (eq (printf "%v" .Params.draft | lower) "true") -}} | ||
| {{- $isDraft := $draftBuilt -}} |
There was a problem hiding this comment.
Good call — $draftBuilt now derives solely from .Draft (Hugo's build-aware page draft state), so "draft rendered in this build" and "draft on disk" stay distinct. The on-disk front-matter check still feeds $isDraft, so a draft that isn't being built falls into the status = "draft" skip path. Fixed in e76672d.
Generated by Claude Code
| checked softly and never block publishing. When draft mode is off, draft | ||
| modules are not part of the build and are skipped entirely — they are neither | ||
| checked against the registry nor reported as warnings. |
There was a problem hiding this comment.
Agreed — reworded to "draft root content" to match the section's scope (root learning paths, challenges, certifications). Fixed in e76672d.
Generated by Claude Code
Key $draftBuilt off .Draft alone (Hugo's build-aware draft state) instead of also inspecting .Params.draft, keeping 'draft on disk' and 'draft rendered in this build' as distinct concepts. The on-disk front-matter check still feeds $isDraft so non-built drafts are skipped rather than validated. Reword the README to describe draft root content, matching the scope of the validation section (root learning paths, challenges, certifications). Signed-off-by: Marcus Blom <158522975+marblom007@users.noreply.github.com>
Notes for Reviewers
Content ID validation now respects the build's draft mode so that draft modules are not validated when draft mode is off.
Previously, content marked as draft could still be run through the full org/ID/registry validation and softened to a
draft_warning, emitting a build warning even when the build was not rendering drafts. This change ties draft handling to Hugo's build-aware page state:hugo): draft content is not part of the build and is skipped entirely — never checked against the registry and never reported as a warning. Content detected as draft on disk while the build is not rendering it gets a neutraldraftstatus instead of a warning.hugo --buildDrafts, e.g. PR previews): drafts are still validated softly (draft_warning) and never block publishing — unchanged behavior.Changes:
layouts/partials/academy-validation/collect-content-health.html— derive draft state from Hugo's--buildDrafts-aware page status; skip validation for draft content that is not being built; only downgrade built drafts todraft_warning.layouts/shortcodes/instructor-toolkit.html— render the neutraldraftstatus in the report table.README.md— document the draft-mode-aware validation behavior.Verified with an isolated Hugo build: with draft mode off the draft learning path is excluded and unvalidated; with
--buildDraftsit appears as a non-blockingdraft_warning. The Instructor Toolkit report renders correctly in both cases.This PR fixes #
Signed commits
Generated by Claude Code