Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,14 @@ Supported `validationMode` values:
- `off` suppresses content health warnings and skips registry lookups.

Registry lookups are scoped to root learning paths, challenges, and
certifications. Draft root content is not warning-producing and is hidden from
the Instructor Toolkit report. Nested course/module/page/test IDs are not
checked against the Cloud curriculum registry.
certifications. Nested course/module/page/test IDs are not checked against the
Cloud curriculum registry.

Validation respects the build's draft mode. Draft content is only validated
when the build actually renders it (`hugo --buildDrafts`); those drafts are
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.

If `params.academy.registryURL` is not configured, the build prints one
configuration warning and does not report existing IDs as invalid because they
Expand Down
17 changes: 14 additions & 3 deletions layouts/partials/academy-validation/collect-content-health.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@
{{- $fix := "" -}}
{{- $registryStatus := "" -}}
{{- $cloudStatus := "" -}}
{{- $isDraft := or .Draft (eq (printf "%v" .Params.draft | lower) "true") -}}
{{- /* 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 -}}
{{- if not $isDraft -}}
{{- $sourcePath := printf "content/%s" $filePath -}}
{{- $source := try (os.ReadFile $sourcePath) -}}
Expand All @@ -85,7 +89,14 @@
{{- $draft = add $draft 1 -}}
{{- end -}}

{{- if not (partial "academy-validation/validate-academy-org-id.html" $orgID) -}}
{{- if and $isDraft (not $draftBuilt) -}}
{{- /* Content is marked draft but the build's draft mode is off (Hugo is not
rendering it). Respect the build mode and skip validation entirely so we
never check or warn on draft modules that are not part of this build. */ -}}
{{- $status = "draft" -}}
{{- $issue = "Draft content is not validated while the build's draft mode is off." -}}
{{- $fix = "Build with drafts enabled (--buildDrafts) to validate this draft, or publish it." -}}
{{- else if not (partial "academy-validation/validate-academy-org-id.html" $orgID) -}}
Comment thread
aabidsofi19 marked this conversation as resolved.
{{- $status = "broken" -}}
{{- $issue = "Content is outside a valid organization directory." -}}
{{- $fix = "Move this root content under content/<type>/<org-id>/<slug>/." -}}
Expand Down Expand Up @@ -117,7 +128,7 @@
{{- end -}}
{{- end -}}

{{- if and $isDraft (ne $status "good") -}}
{{- if and $draftBuilt (ne $status "good") -}}
Comment thread
aabidsofi19 marked this conversation as resolved.
{{- $status = "draft_warning" -}}
{{- if eq $issue "" -}}
{{- $issue = "Draft content could not be fully validated." -}}
Expand Down
2 changes: 2 additions & 0 deletions layouts/shortcodes/instructor-toolkit.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
{{- else if eq .status "unchecked" -}}
Not checked
{{- else if eq .status "draft" -}}
Draft
{{- else -}}
Comment thread
aabidsofi19 marked this conversation as resolved.
{{- if ne $consoleURL "" -}}<a href="{{ $consoleURL }}" target="_blank" rel="noopener" aria-label="Open Instructor Console">❌</a>{{- else -}}❌{{- end -}}
{{- end -}}
Expand Down
Loading