Skip to content

Conversation

aires-iris
Copy link
Contributor

When obtaining the current path, the algorithm used is to intercept the content after the last / This logic may cause bugs

eg: If the current article address contains multi-level directories, for example: www.domain.com/blog/devops/k8s-gateway-api, Using the current algorithm will cause the final calculated path value incorrectly include the content of the secondary path devops, making the ​​prev/next article address invalid, resulting in 404

Considering that all article paths in the current project start with /blog, it is recommended to intercept the first two parts of the array to append the prev/next article [subdirectory + article id], which is /blog/[subdirectory + article id]

Copy link

vercel bot commented Feb 20, 2025

@aires-iris is attempting to deploy a commit to the cworld Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
astro-theme-pure ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2025 3:15pm

@cworld1
Copy link
Owner

cworld1 commented Feb 20, 2025

Your solution is right. Thanks for your distribution.

@cworld1 cworld1 merged commit 3612faf into cworld1:main Feb 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants