-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Description
Description
When Giscus creates GitHub Discussions for pages in the /code-quality/
section, the generated links within the discussion body are missing
the /code-quality/
base path.
Example
You can see this issue in existing discussions:
https://github.com/toss/frontend-fundamentals/discussions?discussions_q=%2Fcode%2F
Try clicking any link within these discussions - they lead to 404 pages because the /code-quality/
prefix is missing.
Specific example:
- Page: https://frontend-fundamentals.com/code-quality/code/examples/submit-button.html
- Discussion: 같이 실행되지 않는 코드 분리하기 | Frontend Fundamentals #60
- Problem: Links in the discussion show as
/code/examples/...
instead of/code-quality/code/examples/...
Current Behavior
- Pages under
/code-quality/code/examples/
have their links incorrectly generated as/code/examples/...
- The
/code-quality/
prefix is being stripped from the URL - This issue only affects the
code-quality
module, not other modules (a11y, bundling, debug)
Expected Behavior
Links should maintain the full path: /code-quality/code/examples/...
Root Cause
The issue occurs because:
- The
code-quality
module has a subfolder named/code/
- When Giscus parses the HTML, it incorrectly interprets relative paths
- The base path
/code-quality/
is not properly recognized during link generation
Proposed Solution
Add a <base>
tag to the HTML head to explicitly define the base URL:
head.push(["base", { href: "/code-quality/" }]);
This ensures all relative links are correctly resolved with the module's base path.
Metadata
Metadata
Assignees
Labels
No labels