Skip to content

Fix article title links producing relative URLs (404 on nested paths)#29

Merged
JJLovesLife merged 2 commits intolivefrom
copilot/fix-title-link-404-error
Mar 23, 2026
Merged

Fix article title links producing relative URLs (404 on nested paths)#29
JJLovesLife merged 2 commits intolivefrom
copilot/fix-title-link-404-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

Article hrefs like mesa/opengl-framebuffer resolve relative to the current path, so navigating the title link at /mesa/opengl-framebuffer targets /mesa/mesa/opengl-framebuffer.

Prepend / to destUrlPath at construction so all downstream href interpolations produce absolute URLs:

-var destUrlPath = Path.ChangeExtension(relativePath, null)...
+var destUrlPath = "/" + Path.ChangeExtension(relativePath, null)...

This fixes the <h2> title link in both article and index pages, and the "Read more…" link.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • necolas.github.io
    • Triggering command: /home/REDACTED/work/blog/blog/build/bin/Debug/net10.0/build /home/REDACTED/work/blog/blog/build/bin/Debug/net10.0/build --force (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Title link in article page causing 404.</issue_title>
<issue_description>H2 href in "/mesa/opengl-framebuffer" is "mesa/opengl-framebuffer", causing target URL to be "/mesa/mesa/opengl-framebuffer"</issue_description>

Comments on the Issue (you are @copilot in this section)


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Fix title link in article page causing 404 error Fix article title links producing relative URLs (404 on nested paths) Mar 23, 2026
Copilot AI requested a review from jjshao-ms March 23, 2026 15:40
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://mango-mushroom-0f508f700-29.eastasia.3.azurestaticapps.net

@JJLovesLife JJLovesLife marked this pull request as ready for review March 23, 2026 15:46
@JJLovesLife JJLovesLife merged commit 1213e9c into live Mar 23, 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.

Title link in article page causing 404.

3 participants