Hi Nicolas,

Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> So, basically, upon exporting the following document to HTML:
>
>   #+html_link_root: /tmp/
>   [[/tmp/unicorn.jpg]]
>
> the link becomes
>
>   <img src="/unicorn.jpg" alt="unicorn.jpg" />

Is this saying "subtract the value of 'html_link_root' from the Org link
to make its URL"?

If so, I think this would not be general enough to help some cases.  For
example, with Nikola+orgmode and with Nikola's "pretty URLs" option the
relative location between either the Org source or its generated HTML
and an image that they both link will differ.

Some details:

Nikola source wants this layout:

  /path/to/my/nikola/posts/my-blog-post.org
  /path/to/my/nikola/images/unicorn.jpg

The Org source generates to HTML which will be found at this URL path:

  /mysiteroot/posts/my-blog-post/index.html

So, right now, either the Org link to the image must be written to be
invalid (for Org):

  [[../../images/unicorn.jpg]]

Or, some mechanism needs to turn the valid Org link:

  [[../images/unicorn.jpg]]

into either:

  <img src="/mysiteroot/images/unicorn.jpg" ...>

or:

  <img src="../../images/unicorn.jpg" ...>

I guess I could use html_link_root set to "/path/to/my/nikola" but then
my Org source loses portability.

I think better would be able to explicitly state the desired URL path
for the HTML <img> like:

  #+html_url_path: /mysiteroot/images/unicorn.jpg
  [[../images/unicorn.jpg]]


-Brett.

PS: imo, in this example, I think the real solution is to make Nikola
allow for keeping org+img source together and to output org+img+html all
together in one web directory.

Attachment: signature.asc
Description: PGP signature

Reply via email to