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

Make relative URLs in {{ post.html }} rendered as absolute URLs #30

Open
semente opened this issue Feb 21, 2021 · 1 comment
Open

Make relative URLs in {{ post.html }} rendered as absolute URLs #30

semente opened this issue Feb 21, 2021 · 1 comment
Labels
bug Something isn't working org-mode

Comments

@semente
Copy link
Contributor

semente commented Feb 21, 2021

As I mentioned in issue #27, I would to use Org's [[file:path/to/file.org]] links to be able to browse Org files in Emacs the same way I would in a web browser.

But I just found an issue with this way of linking internal pages: If a have a link like [[file:example.txt]] in a post posts/post.org its rendered href HTML property (i.e. example.txt) will work just fine in a web browser, which will use the http://example.net/posts/ as the base URL. But the same won't work in RSS files causing it to be rendered as http://example.net/example.txt.

This issue won't happen if I link stuff using the form [[url_for:ROUTE,slug=SLUG]] because it generates an absolute URL but this might be an issue if you try to export this same file, let's say to Markdown, using org-publish. Also, if you use #+OPTIONS: toc, the anchored links it generates will also be relative and won't work in a RSS reader.

So my proposal here is to make post.html to always render internal links as absolute URLs.

@semente semente changed the title Make relative URLs in [{ post.html }} rendered as absolute URLs Make relative URLs in {{ post.html }} rendered as absolute URLs Feb 22, 2021
@clarete
Copy link
Collaborator

clarete commented Feb 22, 2021

great find! thank you once again for the thoroughly written report 🙇🏾
I'll look for a setting that could be passed to ox-html to render links with absolute URLs!

@clarete clarete added the bug Something isn't working label Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working org-mode
Projects
None yet
Development

No branches or pull requests

2 participants