- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13
chore: move SSG root to subdirectory for repository separation #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
acdcb9b    to
    c6236a2      
    Compare
  
    | Could you please do an additional review? @YDX-2147483647 @Its-Just-Nans | 
|  | ||
| // Create a symbolic link to the assets generated by typst-docs in ./public/assets/ | ||
| const assetsDocsPath = resolve(__dirname, "../assets/"); | ||
| const assetsDocsPath = resolve(__dirname, "../../assets/"); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If typst-docs-web is meant to be a git submodule in the future, then I don't think ../../ is a good idea. It will be difficult to test typst-docs-web separately.
Would [Option A] something like readFile(env.TYPST_DOCS_RESULT + 'assets/') be better? Or [Option B] read from metadata.json?
Both approaches require a mechanism to specify where metadata.json is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current approach requires that the git submodule for SSG and the docs.json and assets/ directories output by typst-docs are located in the specified places.
Although using environment variables is one option, since we have a schema-based metadata JSON file, I think injecting the path through this file is a better idea.
| Ah, what should we do with  | 
| const assetsDocsPath = resolve(__dirname, assetsPath); | ||
| const publicAssetsDocsPath = resolve(__dirname, "./public/assets/"); | ||
| rmSync(publicAssetsDocsPath, { recursive: true, force: true }); | ||
| symlinkSync(assetsDocsPath, publicAssetsDocsPath, "dir"); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about [Option C] letting typst-docs-web always read typst-docs-web/public/, and creating symlinks in mise.toml?
[Option C'] Also creating a symlink from metadata.json to typst-docs-web/public/metadata.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request restructures the SSG (Static Site Generator) project by moving it from /website/ to /website/typst-docs-web/ in preparation for separating it into an independent repository that will be managed as a Git submodule.
- Moved SSG project root to /website/typst-docs-web/subdirectory
- Updated file paths and import statements to reflect the new directory structure
- Modified build tasks and CI/CD workflows to use the new paths
Reviewed Changes
Copilot reviewed 12 out of 84 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description | 
|---|---|
| website/typst-docs-web/vite.config.ts | Removed symbolic link creation logic that is now handled externally | 
| website/typst-docs-web/src/utils/translationStatus.ts | Updated file path to use public directory | 
| website/typst-docs-web/src/metadata.ts | Changed from direct import to dynamic file reading with fallback | 
| website/typst-docs-web/src/index.tsx | Updated import path for docs.json | 
| website/typst-docs-web/.gitignore | Added new gitignore for the SSG subdirectory | 
| website/translation-status.json | Updated schema path reference | 
| website/metadata.json | Updated schema path reference | 
| website/.gitignore | Removed old gitignore entries | 
| package.json | Updated textlint path for new directory structure | 
| mise.toml | Added symlink tasks and updated all directory references | 
| .textlintignore | Updated paths for new directory structure | 
| .github/workflows/website.yml | Updated all CI/CD paths and working directories | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cf. #233
In this pull request, the project root for SSG has been moved to
/website/typst-docs-web/in preparation for separating SSG into an independent repository. This directory will soon be replaced with a Git submodule.