Skip to content

feat(link-forever): linking by URLs to remote HEAD #12

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

Merged
merged 5 commits into from
Apr 13, 2025
Merged

Conversation

tonywu6
Copy link
Owner

@tonywu6 tonywu6 commented Apr 13, 2025

mdbook-link-forever

Add a (currently undocumented) compatibility feature where HTTP links to HEAD, such as https://github.com/owner/repo/tree/HEAD/path/to/file.png, will be treated as intended to be permalinks and converted/checked accordingly, as if they were written as path-based links.

This can be used to, for example, convert image links in included files ({{#include}}) back to path-based links, so that they become same-origin links in book output while staying as GitHub links when viewed elsewhere.

tonywu6 added 5 commits April 13, 2025 21:53
Add a (currently undocumented) compatibility feature where HTTP links to
HEAD, such as `https://github.com/owner/repo/tree/HEAD/path/to/file.png`
will be treated as intended to be a permalink and converted/checked
accordingly, as if they were written as a path-based link.

This can be used to, for example, convert image links in included files
(`{{#include}}`) back to path-based links, so that they become
same-origin links in book output while staying as GitHub links when
viewed elsewhere.
@tonywu6 tonywu6 merged commit 9934a2f into main Apr 13, 2025
13 checks passed
@tonywu6 tonywu6 deleted the tony/lf-raw-head branch April 13, 2025 16:28
@tonywu6 tonywu6 mentioned this pull request Apr 13, 2025
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.

1 participant