From 0a8678a8ae8e08969e85221e4f82214b8057793a Mon Sep 17 00:00:00 2001
From: Justin Mayer
Date: Thu, 11 Apr 2013 12:15:18 -0700
Subject: [PATCH] Change RELATIVE_URLS default to False - Fixes #829
---
docs/contribute.rst | 4 +-
docs/settings.rst | 6 +-
pelican/settings.py | 2 +-
.../basic/a-markdown-powered-article.html | 30 +++---
pelican/tests/output/basic/archives.html | 40 ++++----
pelican/tests/output/basic/article-1.html | 26 ++---
pelican/tests/output/basic/article-2.html | 26 ++---
pelican/tests/output/basic/article-3.html | 26 ++---
.../output/basic/author/alexis-metaireau.html | 40 ++++----
pelican/tests/output/basic/categories.html | 30 +++---
pelican/tests/output/basic/category/bar.html | 30 +++---
pelican/tests/output/basic/category/cat1.html | 48 +++++-----
pelican/tests/output/basic/category/misc.html | 46 ++++-----
pelican/tests/output/basic/category/yeah.html | 30 +++---
.../basic/filename_metadata-example.html | 26 ++---
pelican/tests/output/basic/index.html | 94 +++++++++----------
pelican/tests/output/basic/oh-yeah.html | 30 +++---
.../tests/output/basic/override/index.html | 22 ++---
.../pages/this-is-a-test-hidden-page.html | 22 ++---
.../basic/pages/this-is-a-test-page.html | 22 ++---
.../tests/output/basic/second-article-fr.html | 30 +++---
.../tests/output/basic/second-article.html | 30 +++---
pelican/tests/output/basic/tag/bar.html | 50 +++++-----
pelican/tests/output/basic/tag/baz.html | 30 +++---
pelican/tests/output/basic/tag/foo.html | 40 ++++----
pelican/tests/output/basic/tag/foobar.html | 30 +++---
pelican/tests/output/basic/tag/oh.html | 30 +++---
pelican/tests/output/basic/tag/yeah.html | 30 +++---
.../output/basic/this-is-a-super-article.html | 30 +++---
pelican/tests/output/basic/unbelievable.html | 30 +++---
pelican/tests/test_pelican.py | 2 +-
pelican/tests/test_webassets.py | 6 +-
pelican/tools/templates/pelicanconf.py.in | 3 +
pelican/tools/templates/publishconf.py.in | 4 +-
pelican/writers.py | 2 +-
samples/pelican.conf.py | 3 +
36 files changed, 478 insertions(+), 472 deletions(-)
diff --git a/docs/contribute.rst b/docs/contribute.rst
index 2069765c..e53fabf5 100644
--- a/docs/contribute.rst
+++ b/docs/contribute.rst
@@ -54,9 +54,9 @@ If you have made changes that affect the output of a Pelican-generated weblog,
then you should update the output used by functional tests.
To do so, you can use the following two commands::
- $ LC_ALL="C" pelican -o pelican/tests/output/custom/ -s samples/pelican.conf.py \
+ $ pelican -o pelican/tests/output/custom/ -s samples/pelican.conf.py \
samples/content/
- $ LC_ALL="C" pelican -o pelican/tests/output/basic/ samples/content/
+ $ pelican -o pelican/tests/output/basic/ samples/content/
testing for python3
-------------------
diff --git a/docs/settings.rst b/docs/settings.rst
index db5c0164..83348228 100644
--- a/docs/settings.rst
+++ b/docs/settings.rst
@@ -107,9 +107,9 @@ Setting name (default value) What doe
`OUTPUT_SOURCES_EXTENSION` (``.text``) Controls the extension that will be used by the SourcesGenerator.
Defaults to ``.text``. If not a valid string the default value
will be used.
-`RELATIVE_URLS` (``True``) Defines whether Pelican should use document-relative URLs or
- not. If set to ``False``, Pelican will use the SITEURL
- setting to construct absolute URLs.
+`RELATIVE_URLS` (``False``) Defines whether Pelican should use document-relative URLs or
+ not. Only set this to ``True`` when developing/testing and only
+ if you fully understand the effect it can have on links/feeds.
`PLUGINS` (``[]``) The list of plugins to load. See :ref:`plugins`.
`SITENAME` (``'A Pelican Blog'``) Your site name
`SITEURL` Base URL of your website. Not defined by default,
diff --git a/pelican/settings.py b/pelican/settings.py
index df1de0c7..319df7f8 100644
--- a/pelican/settings.py
+++ b/pelican/settings.py
@@ -66,7 +66,7 @@ _DEFAULT_CONFIG = {'PATH': os.curdir,
'YEAR_ARCHIVE_SAVE_AS': False,
'MONTH_ARCHIVE_SAVE_AS': False,
'DAY_ARCHIVE_SAVE_AS': False,
- 'RELATIVE_URLS': True,
+ 'RELATIVE_URLS': False,
'DEFAULT_LANG': 'en',
'TAG_CLOUD_STEPS': 4,
'TAG_CLOUD_MAX_ITEMS': 100,
diff --git a/pelican/tests/output/basic/a-markdown-powered-article.html b/pelican/tests/output/basic/a-markdown-powered-article.html
index 251b3aab..021f2720 100644
--- a/pelican/tests/output/basic/a-markdown-powered-article.html
+++ b/pelican/tests/output/basic/a-markdown-powered-article.html
@@ -3,38 +3,38 @@
A markdown powered article
-
+
+
+
+
@@ -44,11 +44,11 @@
Wed 20 April 2011
- In cat1 .
+ In cat1 .
You're mutually oblivious.
-a root-relative link to unbelievable
-a file-relative link to unbelievable
+a root-relative link to unbelievable
+a file-relative link to unbelievable
diff --git a/pelican/tests/output/basic/archives.html b/pelican/tests/output/basic/archives.html
index 06b3e6e6..c941849e 100644
--- a/pelican/tests/output/basic/archives.html
+++ b/pelican/tests/output/basic/archives.html
@@ -3,31 +3,31 @@
A Pelican Blog
-
+
+
+
+
diff --git a/pelican/tests/output/basic/article-1.html b/pelican/tests/output/basic/article-1.html
index fb425644..a86bcbd0 100644
--- a/pelican/tests/output/basic/article-1.html
+++ b/pelican/tests/output/basic/article-1.html
@@ -3,38 +3,38 @@
Article 1
-
+
+
+
+
@@ -44,7 +44,7 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 1
diff --git a/pelican/tests/output/basic/article-2.html b/pelican/tests/output/basic/article-2.html
index 39d55c6b..da74685d 100644
--- a/pelican/tests/output/basic/article-2.html
+++ b/pelican/tests/output/basic/article-2.html
@@ -3,38 +3,38 @@
Article 2
-
+
+
+
+
@@ -44,7 +44,7 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 2
diff --git a/pelican/tests/output/basic/article-3.html b/pelican/tests/output/basic/article-3.html
index e7e59440..03641539 100644
--- a/pelican/tests/output/basic/article-3.html
+++ b/pelican/tests/output/basic/article-3.html
@@ -3,38 +3,38 @@
Article 3
-
+
+
+
+
@@ -44,7 +44,7 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 3
diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html
index 8b83c8a6..9c47c7a0 100644
--- a/pelican/tests/output/basic/author/alexis-metaireau.html
+++ b/pelican/tests/output/basic/author/alexis-metaireau.html
@@ -3,31 +3,31 @@
A Pelican Blog - Alexis Métaireau
-
+
+
+
+
@@ -35,17 +35,17 @@
-
+
Wed 20 October 2010
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
diff --git a/pelican/tests/output/basic/categories.html b/pelican/tests/output/basic/categories.html
index cdcbb04f..8f6d9f41 100644
--- a/pelican/tests/output/basic/categories.html
+++ b/pelican/tests/output/basic/categories.html
@@ -3,38 +3,38 @@
A Pelican Blog
-
+
+
+
+
diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html
index f815a45b..deca8aed 100644
--- a/pelican/tests/output/basic/category/bar.html
+++ b/pelican/tests/output/basic/category/bar.html
@@ -3,31 +3,31 @@
A Pelican Blog - bar
-
+
+
+
+
@@ -35,17 +35,17 @@
-
+
Wed 20 October 2010
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
diff --git a/pelican/tests/output/basic/category/cat1.html b/pelican/tests/output/basic/category/cat1.html
index 1922f57a..90edd920 100644
--- a/pelican/tests/output/basic/category/cat1.html
+++ b/pelican/tests/output/basic/category/cat1.html
@@ -3,31 +3,31 @@
A Pelican Blog - cat1
-
+
+
+
+
@@ -35,17 +35,17 @@
Other articles
@@ -56,7 +56,7 @@
@@ -66,11 +66,11 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 1
- read more
+ read more
@@ -78,7 +78,7 @@
@@ -88,11 +88,11 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 2
- read more
+ read more
@@ -100,7 +100,7 @@
@@ -110,11 +110,11 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 3
- read more
+ read more
diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html
index cdf2a437..f966bf89 100644
--- a/pelican/tests/output/basic/category/misc.html
+++ b/pelican/tests/output/basic/category/misc.html
@@ -3,31 +3,31 @@
A Pelican Blog - misc
-
+
+
+
+
@@ -35,13 +35,13 @@
-
+
Fri 30 November 2012
- In misc .
+ In misc .
Some cool stuff!
@@ -55,7 +55,7 @@
@@ -65,13 +65,13 @@
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- fr
+ In misc .
+tags: foo bar baz
Translations:
+ fr
This is some article, in english
- read more
+ read more
@@ -79,7 +79,7 @@
@@ -89,13 +89,13 @@
Fri 15 October 2010
- In misc .
+ In misc .
Or completely awesome. Depends the needs.
-a root-relative link to markdown-article
-a file-relative link to markdown-article
+a root-relative link to markdown-article
+a file-relative link to markdown-article
- read more
+ read more
diff --git a/pelican/tests/output/basic/category/yeah.html b/pelican/tests/output/basic/category/yeah.html
index fc108e93..bce27b13 100644
--- a/pelican/tests/output/basic/category/yeah.html
+++ b/pelican/tests/output/basic/category/yeah.html
@@ -3,31 +3,31 @@
A Pelican Blog - yeah
-
+
+
+
+
@@ -35,17 +35,17 @@
-
+
Some content here !
This is a simple title
diff --git a/pelican/tests/output/basic/filename_metadata-example.html b/pelican/tests/output/basic/filename_metadata-example.html
index 3b971617..0c7f6753 100644
--- a/pelican/tests/output/basic/filename_metadata-example.html
+++ b/pelican/tests/output/basic/filename_metadata-example.html
@@ -3,38 +3,38 @@
FILENAME_METADATA example
-
+
+
+
+
@@ -44,7 +44,7 @@
Fri 30 November 2012
- In misc .
+ In misc .
Some cool stuff!
diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html
index 657ea233..d109f535 100644
--- a/pelican/tests/output/basic/index.html
+++ b/pelican/tests/output/basic/index.html
@@ -3,31 +3,31 @@
A Pelican Blog
-
+
+
+
+
@@ -35,13 +35,13 @@
-
+
Fri 30 November 2012
- In misc .
+ In misc .
Some cool stuff!
@@ -55,7 +55,7 @@
@@ -65,13 +65,13 @@
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- fr
+ In misc .
+tags: foo bar baz
Translations:
+ fr
This is some article, in english
- read more
+ read more
@@ -79,7 +79,7 @@
@@ -89,12 +89,12 @@
Wed 20 April 2011
- In cat1 .
+ In cat1 .
You're mutually oblivious.
-a root-relative link to unbelievable
-a file-relative link to unbelievable
- read more
+a root-relative link to unbelievable
+a file-relative link to unbelievable
+ read more
@@ -102,7 +102,7 @@
@@ -112,11 +112,11 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 1
- read more
+ read more
@@ -124,7 +124,7 @@
@@ -134,11 +134,11 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 2
- read more
+ read more
@@ -146,7 +146,7 @@
@@ -156,11 +156,11 @@
Thu 17 February 2011
- In cat1 .
+ In cat1 .
Article 3
- read more
+ read more
@@ -168,7 +168,7 @@
@@ -179,14 +179,14 @@
- By Alexis Métaireau
+ By Alexis Métaireau
- In yeah .
-tags: foo bar foobar
+ In yeah .
+tags: foo bar foobar
Multi-line metadata should be supported
as well as inline markup .
- read more
+ read more
@@ -194,7 +194,7 @@ as well as inline markup .
@@ -205,10 +205,10 @@ as well as inline markup .
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
@@ -216,7 +216,7 @@ YEAH !
- read more
+ read more
@@ -224,7 +224,7 @@ YEAH !
@@ -234,13 +234,13 @@ YEAH !
Fri 15 October 2010
- In misc .
+ In misc .
Or completely awesome. Depends the needs.
-a root-relative link to markdown-article
-a file-relative link to markdown-article
+a root-relative link to markdown-article
+a file-relative link to markdown-article
- read more
+ read more
diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html
index 761ae0ff..82b90905 100644
--- a/pelican/tests/output/basic/oh-yeah.html
+++ b/pelican/tests/output/basic/oh-yeah.html
@@ -3,38 +3,38 @@
Oh yeah !
-
+
+
+
+
@@ -45,10 +45,10 @@
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
diff --git a/pelican/tests/output/basic/override/index.html b/pelican/tests/output/basic/override/index.html
index 20995de3..82c1e184 100644
--- a/pelican/tests/output/basic/override/index.html
+++ b/pelican/tests/output/basic/override/index.html
@@ -3,31 +3,31 @@
Override url/save_as
-
+
+
+
+
diff --git a/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html
index 6f1f71ee..06e4bcc1 100644
--- a/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html
+++ b/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html
@@ -3,31 +3,31 @@
This is a test hidden page
-
+
+
+
+
diff --git a/pelican/tests/output/basic/pages/this-is-a-test-page.html b/pelican/tests/output/basic/pages/this-is-a-test-page.html
index ce9ffd2c..c40fc879 100644
--- a/pelican/tests/output/basic/pages/this-is-a-test-page.html
+++ b/pelican/tests/output/basic/pages/this-is-a-test-page.html
@@ -3,31 +3,31 @@
This is a test page
-
+
+
+
+
diff --git a/pelican/tests/output/basic/second-article-fr.html b/pelican/tests/output/basic/second-article-fr.html
index 67c206af..6b3f422e 100644
--- a/pelican/tests/output/basic/second-article-fr.html
+++ b/pelican/tests/output/basic/second-article-fr.html
@@ -3,38 +3,38 @@
Deuxième article
-
+
+
+
+
@@ -44,9 +44,9 @@
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- en
+ In misc .
+tags: foo bar baz
Translations:
+ en
Ceci est un article, en français.
diff --git a/pelican/tests/output/basic/second-article.html b/pelican/tests/output/basic/second-article.html
index e779e0da..657e1e5d 100644
--- a/pelican/tests/output/basic/second-article.html
+++ b/pelican/tests/output/basic/second-article.html
@@ -3,38 +3,38 @@
Second article
-
+
+
+
+
@@ -44,9 +44,9 @@
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- fr
+ In misc .
+tags: foo bar baz
Translations:
+ fr
This is some article, in english
diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html
index 6d4138f2..725cd165 100644
--- a/pelican/tests/output/basic/tag/bar.html
+++ b/pelican/tests/output/basic/tag/bar.html
@@ -3,31 +3,31 @@
A Pelican Blog - bar
-
+
+
+
+
@@ -35,15 +35,15 @@
-
+
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- fr
+ In misc .
+tags: foo bar baz
Translations:
+ fr
This is some article, in english
@@ -57,7 +57,7 @@
@@ -68,14 +68,14 @@
- By Alexis Métaireau
+ By Alexis Métaireau
- In yeah .
-tags: foo bar foobar
+ In yeah .
+tags: foo bar foobar
Multi-line metadata should be supported
as well as inline markup .
- read more
+ read more
@@ -83,7 +83,7 @@ as well as inline markup .
@@ -94,10 +94,10 @@ as well as inline markup .
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
@@ -105,7 +105,7 @@ YEAH !
- read more
+ read more
diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html
index dd44e38a..6a8baa42 100644
--- a/pelican/tests/output/basic/tag/baz.html
+++ b/pelican/tests/output/basic/tag/baz.html
@@ -3,31 +3,31 @@
A Pelican Blog - baz
-
+
+
+
+
@@ -35,15 +35,15 @@
-
+
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- fr
+ In misc .
+tags: foo bar baz
Translations:
+ fr
This is some article, in english
diff --git a/pelican/tests/output/basic/tag/foo.html b/pelican/tests/output/basic/tag/foo.html
index 0812ed7c..d8e06ee3 100644
--- a/pelican/tests/output/basic/tag/foo.html
+++ b/pelican/tests/output/basic/tag/foo.html
@@ -3,31 +3,31 @@
A Pelican Blog - foo
-
+
+
+
+
@@ -35,15 +35,15 @@
-
+
Wed 29 February 2012
- In misc .
-tags: foo bar baz
Translations:
- fr
+ In misc .
+tags: foo bar baz
Translations:
+ fr
This is some article, in english
@@ -57,7 +57,7 @@
@@ -68,14 +68,14 @@
- By Alexis Métaireau
+ By Alexis Métaireau
- In yeah .
-tags: foo bar foobar
+ In yeah .
+tags: foo bar foobar
Multi-line metadata should be supported
as well as inline markup .
- read more
+ read more
diff --git a/pelican/tests/output/basic/tag/foobar.html b/pelican/tests/output/basic/tag/foobar.html
index 83ace5e3..ab728689 100644
--- a/pelican/tests/output/basic/tag/foobar.html
+++ b/pelican/tests/output/basic/tag/foobar.html
@@ -3,31 +3,31 @@
A Pelican Blog - foobar
-
+
+
+
+
@@ -35,17 +35,17 @@
-
+
Some content here !
This is a simple title
diff --git a/pelican/tests/output/basic/tag/oh.html b/pelican/tests/output/basic/tag/oh.html
index 4694dadf..d0bd6e6f 100644
--- a/pelican/tests/output/basic/tag/oh.html
+++ b/pelican/tests/output/basic/tag/oh.html
@@ -3,31 +3,31 @@
A Pelican Blog - oh
-
+
+
+
+
@@ -35,17 +35,17 @@
-
+
Wed 20 October 2010
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
diff --git a/pelican/tests/output/basic/tag/yeah.html b/pelican/tests/output/basic/tag/yeah.html
index 5d4358cb..c730f7f2 100644
--- a/pelican/tests/output/basic/tag/yeah.html
+++ b/pelican/tests/output/basic/tag/yeah.html
@@ -3,31 +3,31 @@
A Pelican Blog - yeah
-
+
+
+
+
@@ -35,17 +35,17 @@
-
+
Wed 20 October 2010
- By Alexis Métaireau
+ By Alexis Métaireau
- In bar .
-tags: oh bar yeah
+ In bar .
+tags: oh bar yeah
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
diff --git a/pelican/tests/output/basic/this-is-a-super-article.html b/pelican/tests/output/basic/this-is-a-super-article.html
index 7a4971a7..0ace28c7 100644
--- a/pelican/tests/output/basic/this-is-a-super-article.html
+++ b/pelican/tests/output/basic/this-is-a-super-article.html
@@ -3,38 +3,38 @@
This is a super article !
-
+
+
+
+
@@ -45,10 +45,10 @@
- By Alexis Métaireau
+ By Alexis Métaireau
- In yeah .
-tags: foo bar foobar
+ In yeah .
+tags: foo bar foobar
Some content here !
This is a simple title
diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html
index bb297236..11a68fc5 100644
--- a/pelican/tests/output/basic/unbelievable.html
+++ b/pelican/tests/output/basic/unbelievable.html
@@ -3,38 +3,38 @@
Unbelievable !
-
+
+
+
+
diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py
index 5fd037f3..4baa4418 100644
--- a/pelican/tests/test_pelican.py
+++ b/pelican/tests/test_pelican.py
@@ -77,7 +77,7 @@ class TestPelican(LoggedTestCase):
dcmp = dircmp(self.temp_path, os.path.join(OUTPUT_PATH, 'basic'))
self.assertFilesEqual(recursiveDiff(dcmp))
self.assertLogCountEqual(
- count=10,
+ count=4,
msg="Unable to find.*skipping url replacement",
level=logging.WARNING)
diff --git a/pelican/tests/test_webassets.py b/pelican/tests/test_webassets.py
index a9760b37..fe5d6309 100644
--- a/pelican/tests/test_webassets.py
+++ b/pelican/tests/test_webassets.py
@@ -56,6 +56,9 @@ class TestWebAssets(unittest.TestCase):
class TestWebAssetsRelativeURLS(TestWebAssets):
"""Test pelican with relative urls."""
+ def setUp(self):
+ TestWebAssets.setUp(self, override={'RELATIVE_URLS': True})
+
def test_jinja2_ext(self):
# Test that the Jinja2 extension was correctly added.
@@ -90,8 +93,7 @@ class TestWebAssetsAbsoluteURLS(TestWebAssets):
"""Test pelican with absolute urls."""
def setUp(self):
- TestWebAssets.setUp(self, override={'RELATIVE_URLS': False,
- 'SITEURL': 'http://localhost'})
+ TestWebAssets.setUp(self, override={'SITEURL': 'http://localhost'})
def test_absolute_url(self):
# Look in the output files for the link tag with absolute url.
diff --git a/pelican/tools/templates/pelicanconf.py.in b/pelican/tools/templates/pelicanconf.py.in
index d59a7989..9ef94553 100644
--- a/pelican/tools/templates/pelicanconf.py.in
+++ b/pelican/tools/templates/pelicanconf.py.in
@@ -20,3 +20,6 @@ SOCIAL = (('You can add links in your config file', '#'),
('Another social link', '#'),)
DEFAULT_PAGINATION = $default_pagination
+
+# Uncomment following line if you want document-relative URLs when developing
+#RELATIVE_URLS = True
diff --git a/pelican/tools/templates/publishconf.py.in b/pelican/tools/templates/publishconf.py.in
index 8fd2a4f7..20e5ced9 100755
--- a/pelican/tools/templates/publishconf.py.in
+++ b/pelican/tools/templates/publishconf.py.in
@@ -10,13 +10,11 @@ sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = '$siteurl'
+RELATIVE_URLS = False
DELETE_OUTPUT_DIRECTORY = True
# Following items are often useful when publishing
-# Uncomment following line for absolute URLs in production:
-#RELATIVE_URLS = False
-
#DISQUS_SITENAME = ""
#GOOGLE_ANALYTICS = ""
diff --git a/pelican/writers.py b/pelican/writers.py
index ea93dae6..c762bbe4 100644
--- a/pelican/writers.py
+++ b/pelican/writers.py
@@ -89,7 +89,7 @@ class Writer(object):
finally:
locale.setlocale(locale.LC_ALL, old_locale)
- def write_file(self, name, template, context, relative_urls=True,
+ def write_file(self, name, template, context, relative_urls=False,
paginated=None, **kwargs):
"""Render the template and write the file.
diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py
index 714a418c..70edd5f8 100755
--- a/samples/pelican.conf.py
+++ b/samples/pelican.conf.py
@@ -6,6 +6,9 @@ SITENAME = "Alexis' log"
SITEURL = 'http://blog.notmyidea.org'
TIMEZONE = "Europe/Paris"
+# can be useful in development, but set to False when you're ready to publish
+RELATIVE_URLS = True
+
GITHUB_URL = 'http://github.com/ametaireau/'
DISQUS_SITENAME = "blog-notmyidea"
PDF_GENERATOR = False