-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Wrong xref link with page containing permalink #152
Comments
@mojavelinux any idea ? may be we are missing something regarding jekyll-asciidoctor ? |
This is really going outside of the design of inter-document cross references. They simply don't have the awareness of the path mapping that would be required to use them in this context. They are intended for simple document-to-document mapping in a standalone context. I recommend instead to just use the regular link macro, which allows you to construct paths using abitrary variables. I'm currently working on a new design of inter-document referencing for use in a site that will have this level of awareness. But it's something that has to be done using extensions (or post-processors). Asciidoctor (the core processor) is not a site generator, so it needs the help of other software for handling page URL mapping. This may be something we can later roll into the Jekyll AsciiDoc plugin, but there's still a lot of design to be done before that. |
To be clear, here's what Asciidoctor does with this:
It changes '.adoc' to '.html'. That's it. (Though if the file was included in the current file, it will create a local reference instead). |
I think I got bitten by this issue as well when trying to link two blog posts together. When I tried to use the more document-centric In my case I had a
So for a post that had the URL Its almost like jekyll-asciidoc can not overwrite any permalink information. If the permalink was ignored in this case, I feel the xref would have worked because it would have resolved the URL to I thought that I could pass through the Jekyll liquid syntax through a passthrough block which does get you close. https://jekyllrb.com/docs/liquid/tags/#link With this syntax I tried using a |
Here's the correct way to link from one post to another when the post is written in AsciiDoc:
NOTE: I don't know why the file extension has to be excluded, but it fails otherwise. Though you also have to enable liquid processing on the AsciiDoc file by adding the following entry to the front matter:
The reason the xref doesn't work is because Asciidoctor doesn't know anything about Jekyll's permalink translation. So it's necessary to use the Liquid helper to handle the translation, then give the result back to AsciiDoc to make a link in the normal way. The link: prefix is required because what you get back is a pathname, not an absolute URL. |
It looks like in Jekyll 4, it assumes you have left off the file extension. See https://github.com/jekyll/jekyll/blob/master/lib/jekyll/tags/post_url.rb#L19-L20 and https://github.com/jekyll/jekyll/blob/master/features/post_url_tag.feature#L11 |
Hi, it seems that xref link does not resolve path to html when the .adoc file contains a permalink.
For example
= FILE2.adoc <<dir/FILE1.adoc#, Link to the FILE1>>
The html will translate the link to
localhost:4000/dir/FILE1.html
instead oflocalhost:4000/hello/index.html
.asciidoctor (1.5.5)
jekyll-asciidoc (2.1.0.dev)
(cc @prudhomm)
The text was updated successfully, but these errors were encountered: