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

Transform relative paths to URL slugs on build #46

Open
robinmetral opened this issue Aug 16, 2024 · 0 comments
Open

Transform relative paths to URL slugs on build #46

robinmetral opened this issue Aug 16, 2024 · 0 comments

Comments

@robinmetral
Copy link
Owner

Something I really want is to use relative paths for page links. Benefits:

  • navigate the site directly in the IDE
  • get autocomplete from the IDE
  • ...which helps avoid creating links when authoring
<!-- in /posts/2.md -->
A link to [the about page](../about.md) and a link to [another post](./1.md).

Currently, this would obviously break the build. We'd need to go through all links on build and transform them. Good news is that this is pretty easy using the hast that unified gives us. If using this in html pages, we need #42 first, to make sure html pages go through a hast step.

Eleventy does something like this in a plugin: https://www.11ty.dev/docs/plugins/inputpath-to-url/

@robinmetral robinmetral changed the title Transform relative paths to slugs Transform relative paths to URL slugs on build Aug 16, 2024
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

No branches or pull requests

1 participant