Skip to content

feat: add pages_dir config and output_dir safety guard#4

Merged
lucasnevespereira merged 2 commits intomainfrom
fix/output-dir-guard
Apr 26, 2026
Merged

feat: add pages_dir config and output_dir safety guard#4
lucasnevespereira merged 2 commits intomainfrom
fix/output-dir-guard

Conversation

@lucasnevespereira
Copy link
Copy Markdown
Member

Summary

Two related changes around build paths:

  1. Guard against unsafe output_dir. Previous behavior would os.RemoveAll whatever path you pointed output_dir at — setting it to . would delete the entire project on first build. New validateOutput() rejects:

    • Empty values
    • output_dir equal to the project root
    • output_dir outside the project tree (../escape)
  2. Configurable pages_dir. Was hardcoded to pages/. Now overridable via ink.yaml:

pages_dir: src/pages

Defaults to pages/. Useful when migrating from layouts that already have a src/ convention.

Test plan

  • go vet ./... clean
  • go build ./... clean
  • Existing examples still build (minimal, multi-page, library, bio)
  • Guard rejects output_dir: "." with a clear error
  • pages_dir: src resolves correctly when content lives at src/<page>/content.md

@lucasnevespereira lucasnevespereira merged commit 1b7c613 into main Apr 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant