emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* portable absolute links in HTML export
@ 2010-10-07 12:21 Łukasz Stelmach
  2010-10-07 12:38 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Stelmach @ 2010-10-07 12:21 UTC (permalink / raw)
  To: emacs-orgmode

Hello.

Is there a simple way to create hyperlinks with *absolute* paths that
would work after both: simple file export (C-c C-e h) and publishing on
a remote server (C-c C-e F). I'd like to create a _menu.org file that
contains some navigation links and #+INCLUDE: it (BTW. M-Tab can't
complete #+INC) in every single file I create and publish.

The problem now looks like there should be separete _menu.org files for
each directory if I want to use relative paths in the menu links, that
work after local (C-c C-e h) and remote (C-c C-e h) export. When I put
absolute paths that work on

Let's say I've got a structure like this

~/WWW/index.org
~/WWW/_menu.org
~/stuff/index.org
~/things/index.org
~/problems/index.org

after publishing the index.org files are available at:

http://example.com/~stl/
http://example.com/~stl/stuff/
http://example.com/~stl/things/
http://example.com/~stl/problems/

respectively.

The _menu.org that works in the main index.org looks like this:

+ [[file:index.org][Home]]
+ [[file:stuff/index.org][Stuff]]
+ [[file:things/index.org][Things]]
+ [[file:problems/index.org][Problems]]

But when I #+INCLUDE it in the stuff/index.org file the links point at

http://example.com/~stl/stuff/index.html
http://example.com/~stl/stuff/stuff/index.html
http://example.com/~stl/stuff/things/index.html
http://example.com/~stl/stuff/problems/index.html

On the other hand if I replace file: links with absolute http: ones I
won't be able to navigate between the HTML files created locally with
C-c C-e h.

+ [[http://example.com/~stl/index.org][Home]]
+ [[http://example.com/~stl/stuff/index.org][Stuff]]
+ [[http://example.com/~stl/things/index.org][Things]]
+ [[http://example.com/~stl/problems/index.org][Problems]]

Is there any "secret" way to overcome such a problem?

-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portable absolute links in HTML export
  2010-10-07 12:21 portable absolute links in HTML export Łukasz Stelmach
@ 2010-10-07 12:38 ` Carsten Dominik
  2010-10-07 13:13   ` Łukasz Stelmach
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2010-10-07 12:38 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode


On Oct 7, 2010, at 2:21 PM, Łukasz Stelmach wrote:

> Hello.
>
> Is there a simple way to create hyperlinks with *absolute* paths that
> would work after both: simple file export (C-c C-e h) and publishing  
> on
> a remote server (C-c C-e F). I'd like to create a _menu.org file that
> contains some navigation links and #+INCLUDE: it (BTW. M-Tab can't
> complete #+INC) in every single file I create and publish.

Maybe you can use link abbreviations and define the abbreviation  
differently for both cases.

- Carsten

>
> The problem now looks like there should be separete _menu.org files  
> for
> each directory if I want to use relative paths in the menu links, that
> work after local (C-c C-e h) and remote (C-c C-e h) export. When I put
> absolute paths that work on
>
> Let's say I've got a structure like this
>
> ~/WWW/index.org
> ~/WWW/_menu.org
> ~/stuff/index.org
> ~/things/index.org
> ~/problems/index.org
>
> after publishing the index.org files are available at:
>
> http://example.com/~stl/
> http://example.com/~stl/stuff/
> http://example.com/~stl/things/
> http://example.com/~stl/problems/
>
> respectively.
>
> The _menu.org that works in the main index.org looks like this:
>
> + [[file:index.org][Home]]
> + [[file:stuff/index.org][Stuff]]
> + [[file:things/index.org][Things]]
> + [[file:problems/index.org][Problems]]
>
> But when I #+INCLUDE it in the stuff/index.org file the links point at
>
> http://example.com/~stl/stuff/index.html
> http://example.com/~stl/stuff/stuff/index.html
> http://example.com/~stl/stuff/things/index.html
> http://example.com/~stl/stuff/problems/index.html
>
> On the other hand if I replace file: links with absolute http: ones I
> won't be able to navigate between the HTML files created locally with
> C-c C-e h.
>
> + [[http://example.com/~stl/index.org][Home]]
> + [[http://example.com/~stl/stuff/index.org][Stuff]]
> + [[http://example.com/~stl/things/index.org][Things]]
> + [[http://example.com/~stl/problems/index.org][Problems]]
>
> Is there any "secret" way to overcome such a problem?
>
> -- 
> Miłego dnia,
> Łukasz Stelmach
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portable absolute links in HTML export
  2010-10-07 12:38 ` Carsten Dominik
@ 2010-10-07 13:13   ` Łukasz Stelmach
  2010-10-07 13:19     ` Łukasz Stelmach
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Stelmach @ 2010-10-07 13:13 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

> On Oct 7, 2010, at 2:21 PM, Łukasz Stelmach wrote:
>
>> Is there a simple way to create hyperlinks with *absolute* paths that
>> would work after both: simple file export (C-c C-e h) and publishing
>> on
>> a remote server (C-c C-e F). I'd like to create a _menu.org file that
>> contains some navigation links and #+INCLUDE: it (BTW. M-Tab can't
>> complete #+INC) in every single file I create and publish.
>
> Maybe you can use link abbreviations and define the abbreviation
> differently for both cases.

Any suggestion where/when can I automatically alter
org-link-abbrev-alist for each of export procedures. Creating wrappers
around org-export-as-html* and org-publish* looks easy, except I'd have
to make my own copy of org-export to call them. Of course editing #+LINK
is also a not so bad option.

-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portable absolute links in HTML export
  2010-10-07 13:13   ` Łukasz Stelmach
@ 2010-10-07 13:19     ` Łukasz Stelmach
  2010-10-07 13:29       ` Łukasz Stelmach
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Stelmach @ 2010-10-07 13:19 UTC (permalink / raw)
  To: emacs-orgmode

Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> On Oct 7, 2010, at 2:21 PM, Łukasz Stelmach wrote:
>>
>>> Is there a simple way to create hyperlinks with *absolute* paths that
>>> would work after both: simple file export (C-c C-e h) and publishing
>>> on
>>> a remote server (C-c C-e F). I'd like to create a _menu.org file that
>>> contains some navigation links and #+INCLUDE: it (BTW. M-Tab can't
>>> complete #+INC) in every single file I create and publish.
>>
>> Maybe you can use link abbreviations and define the abbreviation
>> differently for both cases.
>
> Any suggestion where/when can I automatically alter
> org-link-abbrev-alist for each of export procedures. 

No need to :-) In the main index.org i put

#+LINK examplewww: file:

and in the others

#+LINK examplewww: file:../

and it works :-)

Thanks a lot.
-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: portable absolute links in HTML export
  2010-10-07 13:19     ` Łukasz Stelmach
@ 2010-10-07 13:29       ` Łukasz Stelmach
  0 siblings, 0 replies; 5+ messages in thread
From: Łukasz Stelmach @ 2010-10-07 13:29 UTC (permalink / raw)
  To: emacs-orgmode

Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:

> Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:
>
> In the main index.org i put
>
> #+LINK examplewww: file:
>
> and in the others
>
> #+LINK examplewww: file:../
>
> and it works :-)

As long as I don't use #+SETUPFILE.

-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-07 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-07 12:21 portable absolute links in HTML export Łukasz Stelmach
2010-10-07 12:38 ` Carsten Dominik
2010-10-07 13:13   ` Łukasz Stelmach
2010-10-07 13:19     ` Łukasz Stelmach
2010-10-07 13:29       ` Łukasz Stelmach

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).