Skip to content

Giscus discussion links are incorrectly generated for code-quality section pages #365

@Huinno-ParkJinHyun

Description

@Huinno-ParkJinHyun

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:

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:

  1. The code-quality module has a subfolder named /code/
  2. When Giscus parses the HTML, it incorrectly interprets relative paths
  3. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions