Closed maphew closed 11 years ago
The default template generates relative urls based on the the actual root /
. Although relative URLs such as ../foo/
are nice to have, you can't have a complete relative website: Atom and RSS feeds require an absolute URL as well das disqus (in case you use it as well). Another edge case are footnotes and url fragments in general, they need to be relative to the web root (at the minimum) when there are multiple posts each having footnotes (#fn:1
e.g.) from 1 to 3 and you want to list them on an index page.
I've seen the integration of relative URLs in pelican and it seemed very difficult to achieve this. Having my mentioned contra arguments in mind, I don't really see a huge benefit of a complete relative URL structure...
Closing this as not needed, I just discovered that WWW_ROOT
in conf.py does what I was looking for. I should have been paying closer attention to http://posativ.org/acrylamid/conf.py.html#basic-settings
WWW_ROOT = 'http://example.com/acrylamid/'
For the record: env.path
contains the "relative" url without the trailing slash (hence for http://example.com/acrylamid/
it would be /acrylamid
)
Is there a straightforward way to make all the urls relative? Before replacing my current site I'm testing in a subdirectory, e.g.
www.example.com/acr
instead ofwww.example.com
but all the urls go to root so css etc are broken.