[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Internal link broken when publishing (was org-id with ox-html)

From: inkbottle
Subject: Internal link broken when publishing (was org-id with ox-html)
Date: Tue, 17 Aug 2021 05:11:35 +0200

I've done a lot of investigation.

I totally agree with internal links not being stable through publishing:
`3c5997f1-205a-437e-8722-d5f52239a207` => `"bye.org#orgfa9c151"`

I totally agree with what Nicolas Goaziou says there:

However, I do have an _internal link_ in the form:
(This link is not hand made at all, it is the result of: `org-id-get-create` 
`org-store-link` `org-insert-link`.)

Which is translated into:
`<a href="bye.org#ID-3c5997f1-205a-437e-8722-d5f52239a207">bye</a>`

But no target of the corresponding form is created, and that somewhat in 
accordance with the cited post above. But it breaks the link.

As I understand it, in accordance with the cited post, the internal link 
should be "interpreted" as:
`<a href="bye.org#orgfa9c151">bye</a>`
(from: `[[id:3c5997f1-205a-437e-8722-d5f52239a207][bye]]`).

For that, there should be some "translation table":
`3c5997f1-205a-437e-8722-d5f52239a207 => bye.org#orgfa9c151`
(there might already such translation table somewhere).
(Actually it is `cache`, in

The obvious workaround would be to use `CUSTOM_ID`, which is stable through 
publishing. But it's not at all a functionality I'm looking for.
I've thought of a function using `org-map-entries`, creating a `:CUSTOM_ID:` 
as a duplicate of `:ID:` everywhere, creating the `:ID:` if necessary. Always 
using `org-id-get-create`.

But maybe there is an _obvious way_ to have it working out of the box.
Here is a minimal example:

## file: hello.org

* hello
  :ID:       e54113f9-2ad7-4a86-94be-68ffc696de0b


## file: bye.org

* bye
  :ID:       3c5997f1-205a-437e-8722-d5f52239a207


P.S. I'm pretty sure the minimal example above can work right out of the box 
with someone, who unlike me, knows how to correctly configure the publishing. 
However, I mention two other leads, the first one I prefer by far: (to be 
honest this first one it is not about internal links not breaking at publishing 
time, which was a "given", but to form more "meaningful" publishing id)
1. Suggestions have been made by Nicolas Goaziou to look in the direction of 
`org-export-get-reference` (at the level of the "translation table"?)
2. Another suggestion is from org-roam

reply via email to

[Prev in Thread] Current Thread [Next in Thread]