all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brett Viren <bv@bnl.gov>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Carsten Dominik <dominik@uva.nl>,
	Tim Cross <theophilusx@gmail.com>,
	Org Mode <emacs-orgmode@gnu.org>,
	Kaushal Modi <kaushal.modi@gmail.com>
Subject: Re: why prepend "file://" to abs paths in html output?
Date: Mon, 10 Jul 2017 09:58:49 -0400	[thread overview]
Message-ID: <86y3rw2y1y.fsf@hierocles.phy.bnl.gov> (raw)
In-Reply-To: <877ezh51ns.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sun, 09 Jul 2017 12:45:43 +0200")

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

Hi Nicolas,

Nicolas Goaziou <mail@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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

  parent reply	other threads:[~2017-07-10 14:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08  0:38 why prepend "file://" to abs paths in html output? Matt Price
2017-07-08 10:33 ` Nicolas Goaziou
2017-07-08 12:37   ` Kaushal Modi
2017-07-08 14:08     ` Nicolas Goaziou
2017-07-08 14:19       ` Carsten Dominik
2017-07-08 19:13         ` Nicolas Goaziou
2017-07-08 23:37           ` Tim Cross
2017-07-09 10:45             ` Nicolas Goaziou
2017-07-10 12:53               ` Kaushal Modi
2017-07-10 13:31                 ` Nicolas Goaziou
2017-07-10 13:58               ` Brett Viren [this message]
2017-07-10 19:54                 ` Kaushal Modi
2017-07-10 21:44                   ` Kaushal Modi
2017-07-13 12:39                   ` Nicolas Goaziou
2017-07-13 12:50                     ` Kaushal Modi
2017-07-13 12:55                       ` Nicolas Goaziou
2017-07-13 13:01                         ` Kaushal Modi
2017-07-13 13:14                           ` Nicolas Goaziou
2017-07-13 12:46                 ` Nicolas Goaziou
2017-07-10 22:12               ` Tim Cross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y3rw2y1y.fsf@hierocles.phy.bnl.gov \
    --to=bv@bnl.gov \
    --cc=dominik@uva.nl \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=mail@nicolasgoaziou.fr \
    --cc=theophilusx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.