Skip to content
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

feat(docs): add Vite Plugin to Remove .md Extensions from URLs #1580

Merged

Conversation

yurisldk
Copy link
Contributor

@yurisldk yurisldk commented Sep 14, 2024

Description

This PR introduces a custom Vite plugin that removes .md file extensions from URLs during the build process. This fix addresses the common issue of 404 errors due to Markdown links containing .md extensions.

closes #1564

image

Motivation

In Astro and Vite projects, links to Markdown files often include the .md extension. This plugin automatically removes .md extensions from internal URLs, ensuring clean and functional links like /specifications/backend/api-response-format#users-for-authentication instead of /specifications/backend/api-response-format.md#users-for-authentication.

Benefits

  • Automatically fixes broken links caused by .md extensions.
  • Provides user-friendly URLs without .md.
  • Seamlessly integrates into your Vite or Astro project.

This plugin ensures that all internal links remain functional and clean, improving both user experience and SEO.

Summary

copilot:summary

Details

copilot:walkthrough

Copy link

stackblitz bot commented Sep 14, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for realworld-docs failed.

Name Link
🔨 Latest commit 1fa55a5
🔍 Latest deploy log https://app.netlify.com/sites/realworld-docs/deploys/66fa51ead43ead0008161174

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for frabjous-strudel-0577e0 failed.

Name Link
🔨 Latest commit 1fa55a5
🔍 Latest deploy log https://app.netlify.com/sites/frabjous-strudel-0577e0/deploys/66fa51eaf5314f00086a00ae

- Implement `remove-md-extension` plugin to clean URLs by removing `.md` extensions.
- Fix 404 errors caused by `.md` extensions in Markdown links.
- Update documentation with usage instructions and examples.
@geromegrignon geromegrignon force-pushed the feature/remove-md-extension-plugin branch from f38489b to 1fa55a5 Compare September 30, 2024 07:23
@geromegrignon geromegrignon merged commit 84e885c into gothinkster:main Sep 30, 2024
@geromegrignon
Copy link
Contributor

Thanks fro the contribution @yurisldk

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.

[Bug]: 404 Page no found on link in Styles Specifications
2 participants