Skip to content

Build a _preview/ Hugo config only from _preview/ - #54

Merged
alexander-yevsyukov merged 1 commit into
masterfrom
check-links-preview-work-dir
Nov 2, 2026
Merged

alexander-yevsyukov merged 1 commit into
masterfrom
check-links-preview-work-dir

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

Follow-up to #53. Hugo finds a config in $SITE_DIR/_preview/ only when it runs there. Say the only config is docs/_preview/hugo.toml and the only lockfile is docs/package-lock.json. Step 0 of check-links then fell back to WORK_DIR=docs, and the build would fail with "Unable to locate config file".

Change

  • Step 0 saves the matched config path in SITE_CFG.
  • The $SITE_DIR fallback now applies to site-root configs only. A _preview/ config needs _preview/package-lock.json.
  • The error names the config it found: Found docs/_preview/hugo.toml but no package-lock.json to build it with. The old "No package-lock.json found under …" would be wrong in this case, because there is one.

This mirrors the same fix to the "Detect docs site" step of check-links.yml in SpineEventEngine/config#827, which its Codex review raised.

Verification

I ran the step 0 snippet, before and after this change:

Checkout / layout Before After
validation c72021e WORK_DIR=docs/_preview same
documentation 3f69c93 WORK_DIR=docs/_preview same
docs/hugo.toml with docs/package-lock.json WORK_DIR=docs same
site/_preview/config/_default/hugo.yaml with a lockfile WORK_DIR=site/_preview same
docs/_preview/hugo.toml with only docs/package-lock.json WORK_DIR=docs error (exit 1)
a config with no lockfile error error, now naming the config
no site not applicable same

🤖 Generated with Claude Code

Hugo finds a config in `$SITE_DIR/_preview/` only when it runs there.
When that was the only config and the only lockfile was
`$SITE_DIR/package-lock.json`, step 0 fell back to
`WORK_DIR=$SITE_DIR`, and the build would fail with "Unable to locate
config file". Step 0 now saves the matched path in `SITE_CFG`, and the
`$SITE_DIR` fallback applies to site-root configs only. A `_preview/`
config without `_preview/package-lock.json` is an error, like any config
without a lockfile to build it with, and the message names the config.

This mirrors the fix to the "Detect docs site" step of
`check-links.yml` in SpineEventEngine/config#827, raised by its Codex
review. Checked by running the step 0 snippet against validation and
documentation (both `docs/_preview`, unchanged) and fixtures. Only that
layout changes its outcome: `WORK_DIR=docs` → error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T16:34:12.714758Z e340860 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

No active review issues remain for the working-directory selection update.

No open issues 🎉

What changed in this PR

This follow-up to #53 corrects working-directory selection in the shared check-links skill so a Hugo config under _preview/ cannot fall back to a build from the site root.

Changes:

  • Records the detected config path in SITE_CFG.
  • Restricts the site-root lockfile fallback to site-root configs.
  • Documents the _preview/package-lock.json requirement and names the detected config in the error message.
File Description
skills/​check-links/​SKILL.md Updates Step 0’s directory-selection logic, explanation, and missing-lockfile error.

Review effort: Balanced

@alexander-yevsyukov
alexander-yevsyukov merged commit 551ad4f into master Nov 2, 2026
1 check passed
@alexander-yevsyukov
alexander-yevsyukov deleted the check-links-preview-work-dir branch November 2, 2026 16:34
@github-project-automation github-project-automation Bot moved this from In Review to ✅ Done in v2.0 Nov 2, 2026
alexander-yevsyukov added a commit to SpineEventEngine/config that referenced this pull request Nov 2, 2026
Brings in SpineEventEngine/agents#54, the skill side of the previous
commit: step 0 of the `check-links` skill now builds a `_preview/` Hugo
config only from `_preview/`, as the "Detect docs site" step of
`check-links.yml` does.

#54 changes only `skills/check-links/SKILL.md`, so the hook scripts
wired in `.claude/settings.json` and `.codex/hooks.json` are as they
were at `01b89c3`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants