diff --git a/docs/changelog.rst b/docs/changelog.rst
index aa54009d..858a6e1b 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -14,6 +14,9 @@ Next release
and author pages 2) feeds 3) draft and hidden articles and pages
* New ``ARTICLE_TRANSLATION_ID`` and ``PAGE_TRANSLATION_ID`` settings to specify
metadata attributes used to identify translations; or to disable translations
+* New ``{static}`` syntax to link to static content; content linked to by
+ ``{static}`` and ``{attach}`` is automatically copied over even if not in
+ ``STATIC_PATHS``
3.7.1 (2017-01-10)
==================
diff --git a/docs/content.rst b/docs/content.rst
index 7bafbf6f..8d07e390 100644
--- a/docs/content.rst
+++ b/docs/content.rst
@@ -168,6 +168,34 @@ If you want to exclude any pages from being linked to or listed in the menu
then add a ``status: hidden`` attribute to its metadata. This is useful for
things like making error pages that fit the generated theme of your site.
+Static content
+==============
+
+Static files are files other than articles and pages that are copied to the
+output folder as-is, without processing. You can control which static files
+are copied over with the ``STATIC_PATHS`` setting of the project's
+``pelicanconf.py`` file. Pelican's default configuration includes the
+``images`` directory for this, but others must be added manually. In addition,
+static files that are explicitly linked to are included (see below).
+
+Mixed content in the same directory
+-----------------------------------
+
+Starting with Pelican 3.5, static files can safely share a source directory with
+page source files, without exposing the page sources in the generated site.
+Any such directory must be added to both ``STATIC_PATHS`` and ``PAGE_PATHS``
+(or ``STATIC_PATHS`` and ``ARTICLE_PATHS``). Pelican will identify and process
+the page source files normally, and copy the remaining files as if they lived
+in a separate directory reserved for static files.
+
+Note: Placing static and content source files together in the same source
+directory does not guarantee that they will end up in the same place in the
+generated site. The easiest way to do this is by using the ``{attach}`` link
+syntax (described below). Alternatively, the ``STATIC_SAVE_AS``,
+``PAGE_SAVE_AS``, and ``ARTICLE_SAVE_AS`` settings (and the corresponding
+``*_URL`` settings) can be configured to place files of different types
+together, just as they could in earlier versions of Pelican.
+
.. _ref-linking-to-internal-content:
Linking to internal content
@@ -221,13 +249,10 @@ and ``article2.md``::
Linking to static files
-----------------------
-Linking to non-article or non-page content uses the same ``{filename}`` syntax
-as described above. It is important to remember that those files will not be
-copied to the output directory unless the source directories containing them
-are included in the ``STATIC_PATHS`` setting of the project's ``pelicanconf.py``
-file. Pelican's default configuration includes the ``images`` directory for
-this, but others must be added manually. Forgetting to do so will result in
-broken links.
+You can link to static content using ``{static}path/to/file``. Files linked to
+with this syntax will automatically be copied to the output directory, even if
+the source directories containing them are not included in the ``STATIC_PATHS``
+setting of the project's ``pelicanconf.py`` file.
For example, a project's content directory might be structured like this::
@@ -241,48 +266,28 @@ For example, a project's content directory might be structured like this::
``test.md`` would include::
- 
- [Our Menu]({filename}/pdfs/menu.pdf)
-
-``pelicanconf.py`` would include::
-
- STATIC_PATHS = ['images', 'pdfs']
+ 
+ [Our Menu]({static}/pdfs/menu.pdf)
Site generation would then copy ``han.jpg`` to ``output/images/han.jpg``,
``menu.pdf`` to ``output/pdfs/menu.pdf``, and write the appropriate links
in ``test.md``.
-Mixed content in the same directory
------------------------------------
-
-Starting with Pelican 3.5, static files can safely share a source directory with
-page source files, without exposing the page sources in the generated site.
-Any such directory must be added to both ``STATIC_PATHS`` and ``PAGE_PATHS``
-(or ``STATIC_PATHS`` and ``ARTICLE_PATHS``). Pelican will identify and process
-the page source files normally, and copy the remaining files as if they lived
-in a separate directory reserved for static files.
-
-Note: Placing static and content source files together in the same source
-directory does not guarantee that they will end up in the same place in the
-generated site. The easiest way to do this is by using the ``{attach}`` link
-syntax (described below). Alternatively, the ``STATIC_SAVE_AS``,
-``PAGE_SAVE_AS``, and ``ARTICLE_SAVE_AS`` settings (and the corresponding
-``*_URL`` settings) can be configured to place files of different types
-together, just as they could in earlier versions of Pelican.
+If you use ``{static}`` to link to an article or a page, this will be turned into
+a link to its source code.
Attaching static files
----------------------
Starting with Pelican 3.5, static files can be "attached" to a page or article
using this syntax for the link target: ``{attach}path/to/file`` This works
-like the ``{filename}`` syntax, but also relocates the static file into the
+like the ``{static}`` syntax, but also relocates the static file into the
linking document's output directory. If the static file originates from a
subdirectory beneath the linking document's source, that relationship will be
preserved on output. Otherwise, it will become a sibling of the linking
document.
-This only works for linking to static files, and only when they originate from
-a directory included in the ``STATIC_PATHS`` setting.
+This only works for linking to static files.
For example, a project's content directory might be structured like this::
@@ -298,7 +303,6 @@ For example, a project's content directory might be structured like this::
``pelicanconf.py`` would include::
PATH = 'content'
- STATIC_PATHS = ['blog', 'downloads']
ARTICLE_PATHS = ['blog']
ARTICLE_SAVE_AS = '{date:%Y}/{slug}.html'
ARTICLE_URL = '{date:%Y}/{slug}.html'
@@ -328,7 +332,7 @@ the article's output directory.
If a static file is linked multiple times, the relocating feature of
``{attach}`` will only work in the first of those links to be processed.
-After the first link, Pelican will treat ``{attach}`` like ``{filename}``.
+After the first link, Pelican will treat ``{attach}`` like ``{static}``.
This avoids breaking the already-processed links.
**Be careful when linking to a file from multiple documents:**
@@ -342,7 +346,7 @@ file's old location might then find their links broken. **It is therefore
advisable to use {attach} only if you use it in all links to a file, and only
if the linking documents share a single directory.** Under these conditions,
the file's output location will not change in future builds. In cases where
-these precautions are not possible, consider using ``{filename}`` links instead
+these precautions are not possible, consider using ``{static}`` links instead
of ``{attach}``, and letting the file's location be determined by the project's
``STATIC_SAVE_AS`` and ``STATIC_URL`` settings. (Per-file ``save_as`` and
``url`` overrides can still be set in ``EXTRA_PATH_METADATA``.)
@@ -360,8 +364,11 @@ To remain compatible with earlier versions, Pelican still supports vertical bars
(``||``) in addition to curly braces (``{}``) for internal links. For example:
``|filename|an_article.rst``, ``|tag|tagname``, ``|category|foobar``.
The syntax was changed from ``||`` to ``{}`` to avoid collision with Markdown
-extensions or reST directives. Support for the old syntax may eventually be
-removed.
+extensions or reST directives. Similarly, Pelican also still supports linking to
+static content with ``{filename}``. The syntax was changed to ``{static}`` to allow
+linking to both generated articles and pages and their static sources.
+
+Support for the old syntax may eventually be removed.
Importing an existing site
diff --git a/pelican/__init__.py b/pelican/__init__.py
index 83b2c169..bc236708 100644
--- a/pelican/__init__.py
+++ b/pelican/__init__.py
@@ -150,8 +150,11 @@ class Pelican(object):
start_time = time.time()
context = self.settings.copy()
- # Share these among all the generators and content objects:
- context['filenames'] = {} # maps source path to Content object or None
+ # Share these among all the generators and content objects
+ # They map source paths to Content objects or None
+ context['generated_content'] = {}
+ context['static_links'] = set()
+ context['static_content'] = {}
context['localsiteurl'] = self.settings['SITEURL']
generators = [
diff --git a/pelican/contents.py b/pelican/contents.py
index dbda19b0..327adc72 100644
--- a/pelican/contents.py
+++ b/pelican/contents.py
@@ -142,7 +142,8 @@ class Content(object):
if not hasattr(self, 'status'):
self.status = getattr(self, 'default_status', None)
- if len(self._context.get('filenames', [])) > 0:
+ if (len(self._context.get('generated_content', [])) > 0 or
+ len(self._context.get('static_content', [])) > 0):
self.refresh_metadata_intersite_links()
signals.content_object_init.send(self)
@@ -255,7 +256,7 @@ class Content(object):
siteurl += '/'
# XXX Put this in a different location.
- if what in {'filename', 'attach'}:
+ if what in {'filename', 'static', 'attach'}:
if path.startswith('/'):
path = path[1:]
else:
@@ -264,22 +265,33 @@ class Content(object):
os.path.join(self.relative_dir, path)
)
- if path not in self._context['filenames']:
- unquoted_path = path.replace('%20', ' ')
+ key = 'static_content' if what in ('static', 'attach')\
+ else 'generated_content'
- if unquoted_path in self._context['filenames']:
- path = unquoted_path
+ def _get_linked_content(key, path):
+ try:
+ return self._context[key][path]
+ except KeyError:
+ try:
+ # Markdown escapes spaces, try unescaping
+ return self._context[key][path.replace('%20', ' ')]
+ except KeyError:
+ if what == 'filename' and key == 'generated_content':
+ key = 'static_content'
+ linked_content = _get_linked_content(key, path)
+ if linked_content:
+ logger.warning(
+ '{filename} used for linking to static'
+ 'content %s in %s. Use {static} instead',
+ path,
+ self.get_relative_source_path())
+ return linked_content
+ return None
- linked_content = self._context['filenames'].get(path)
+ linked_content = _get_linked_content(key, path)
if linked_content:
if what == 'attach':
- if isinstance(linked_content, Static):
- linked_content.attach_to(self)
- else:
- logger.warning(
- "%s used {attach} link syntax on a "
- "non-static file. Use {filename} instead.",
- self.get_relative_source_path())
+ linked_content.attach_to(self)
origin = joiner(siteurl, linked_content.url)
origin = origin.replace('\\', '/') # for Windows paths.
else:
@@ -310,6 +322,17 @@ class Content(object):
return ''.join((m.group('markup'), m.group('quote'), origin,
m.group('quote')))
+ def _get_intrasite_link_regex(self):
+ intrasite_link_regex = self.settings['INTRASITE_LINK_REGEX']
+ regex = r"""
+ (?P<[^\>]+ # match tag with all url-value attributes
+ (?:href|src|poster|data|cite|formaction|action)\s*=\s*)
+
+ (?P["\']) # require value to be quoted
+ (?P{0}(?P.*?)) # the url value
+ \2""".format(intrasite_link_regex)
+ return re.compile(regex, re.X)
+
def _update_content(self, content, siteurl):
"""Update the content attribute.
@@ -323,18 +346,29 @@ class Content(object):
if not content:
return content
- instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX']
- regex = r"""
- (?P<[^\>]+ # match tag with all url-value attributes
- (?:href|src|poster|data|cite|formaction|action)\s*=\s*)
-
- (?P["\']) # require value to be quoted
- (?P{0}(?P.*?)) # the url value
- \2""".format(instrasite_link_regex)
- hrefs = re.compile(regex, re.X)
-
+ hrefs = self._get_intrasite_link_regex()
return hrefs.sub(lambda m: self._link_replacer(siteurl, m), content)
+ def get_static_links(self):
+ static_links = set()
+ hrefs = self._get_intrasite_link_regex()
+ for m in hrefs.finditer(self._content):
+ what = m.group('what')
+ value = urlparse(m.group('value'))
+ path = value.path
+ if what not in {'static', 'attach'}:
+ continue
+ if path.startswith('/'):
+ path = path[1:]
+ else:
+ # relative to the source path of this content
+ path = self.get_relative_source_path(
+ os.path.join(self.relative_dir, path)
+ )
+ path = path.replace('%20', ' ')
+ static_links.add(path)
+ return static_links
+
def get_siteurl(self):
return self._context.get('localsiteurl', '')
diff --git a/pelican/generators.py b/pelican/generators.py
index a960051d..90e4c8a5 100644
--- a/pelican/generators.py
+++ b/pelican/generators.py
@@ -147,7 +147,7 @@ class Generator(object):
parent_path, subdir = os.path.split(os.path.join(self.path, e))
exclusions_by_dirpath.setdefault(parent_path, set()).add(subdir)
- files = []
+ files = set()
ignores = self.settings['IGNORE_FILES']
for path in paths:
# careful: os.path.join() will add a slash when path == ''.
@@ -170,33 +170,41 @@ class Generator(object):
for f in temp_files:
fp = os.path.join(reldir, f)
if self._include_path(fp, extensions):
- files.append(fp)
+ files.add(fp)
elif os.path.exists(root) and self._include_path(path, extensions):
- files.append(path) # can't walk non-directories
+ files.add(path) # can't walk non-directories
return files
- def add_source_path(self, content):
+ def add_source_path(self, content, static=False):
"""Record a source file path that a Generator found and processed.
Store a reference to its Content object, for url lookups later.
"""
location = content.get_relative_source_path()
- self.context['filenames'][location] = content
+ key = 'static_content' if static else 'generated_content'
+ self.context[key][location] = content
- def _add_failed_source_path(self, path):
+ def _add_failed_source_path(self, path, static=False):
"""Record a source file path that a Generator failed to process.
(For example, one that was missing mandatory metadata.)
The path argument is expected to be relative to self.path.
"""
- self.context['filenames'][posixize_path(os.path.normpath(path))] = None
+ key = 'static_content' if static else 'generated_content'
+ self.context[key][posixize_path(os.path.normpath(path))] = None
- def _is_potential_source_path(self, path):
+ def _is_potential_source_path(self, path, static=False):
"""Return True if path was supposed to be used as a source file.
(This includes all source files that have been found by generators
before this method is called, even if they failed to process.)
The path argument is expected to be relative to self.path.
"""
- return (posixize_path(os.path.normpath(path))
- in self.context['filenames'])
+ key = 'static_content' if static else 'generated_content'
+ return (posixize_path(os.path.normpath(path)) in self.context[key])
+
+ def add_static_links(self, content):
+ """Add file links in content to context to be processed as Static
+ content.
+ """
+ self.context['static_links'] |= content.get_static_links()
def _update_context(self, items):
"""Update the context with the given items from the currrent
@@ -596,6 +604,7 @@ class ArticlesGenerator(CachingGenerator):
elif article.status == "draft":
all_drafts.append(article)
self.add_source_path(article)
+ self.add_static_links(article)
def _process(arts):
origs, translations = process_translations(
@@ -702,6 +711,7 @@ class PagesGenerator(CachingGenerator):
elif page.status == "draft":
draft_pages.append(page)
self.add_source_path(page)
+ self.add_static_links(page)
def _process(pages):
origs, translations = process_translations(
@@ -753,9 +763,12 @@ class StaticGenerator(Generator):
def generate_context(self):
self.staticfiles = []
- for f in self.get_files(self.settings['STATIC_PATHS'],
- exclude=self.settings['STATIC_EXCLUDES'],
- extensions=False):
+ linked_files = {os.path.join(self.path, path)
+ for path in self.context['static_links']}
+ found_files = self.get_files(self.settings['STATIC_PATHS'],
+ exclude=self.settings['STATIC_EXCLUDES'],
+ extensions=False)
+ for f in linked_files | found_files:
# skip content source files unless the user explicitly wants them
if self.settings['STATIC_EXCLUDE_SOURCES']:
@@ -770,7 +783,7 @@ class StaticGenerator(Generator):
context_signal=signals.static_generator_context,
context_sender=self)
self.staticfiles.append(static)
- self.add_source_path(static)
+ self.add_source_path(static, static=True)
self._update_context(('staticfiles',))
signals.static_generator_finalized.send(self)
diff --git a/pelican/tests/TestPages/page_with_static_links.md b/pelican/tests/TestPages/page_with_static_links.md
new file mode 100644
index 00000000..1967cfcf
--- /dev/null
+++ b/pelican/tests/TestPages/page_with_static_links.md
@@ -0,0 +1,7 @@
+Title: Page with static links
+
+My links:
+
+[Link 0]({static}image0.jpg)
+
+[Link 1]({attach}image1.jpg)
diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html
index bc05969e..aa19e421 100644
--- a/pelican/tests/output/basic/author/alexis-metaireau.html
+++ b/pelican/tests/output/basic/author/alexis-metaireau.html
@@ -42,8 +42,8 @@
>>> from ipdb import set_trace
>>> set_trace()
diff --git a/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml b/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml
index fe670d13..54378c52 100644
--- a/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml
+++ b/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml
@@ -5,8 +5,8 @@ as well as <strong>inline markup</strong>.</p>
<div class="section" id="this-is-a-simple-title">
<h2>This is a simple title</h2>
<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
-<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
<pre class="literal-block">
>>> from ipdb import set_trace
>>> set_trace()
@@ -17,12 +17,12 @@ as well as <strong>inline markup</strong>.</p>
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
<div class="section" id="why-not">
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
\ No newline at end of file
diff --git a/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml b/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml
index 9c3f82f0..57942aed 100644
--- a/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml
+++ b/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml
@@ -5,6 +5,6 @@ as well as <strong>inline markup</strong>.</p>
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0000tag:None,2010-10-20:/oh-yeah.htmlohbaryeah
\ No newline at end of file
diff --git a/pelican/tests/output/basic/feeds/all-en.atom.xml b/pelican/tests/output/basic/feeds/all-en.atom.xml
index 2a0c7ea3..b5965cc8 100644
--- a/pelican/tests/output/basic/feeds/all-en.atom.xml
+++ b/pelican/tests/output/basic/feeds/all-en.atom.xml
@@ -19,8 +19,8 @@ as well as <strong>inline markup</strong>.</p>
<div class="section" id="this-is-a-simple-title">
<h2>This is a simple title</h2>
<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
-<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
<pre class="literal-block">
>>> from ipdb import set_trace
>>> set_trace()
@@ -31,13 +31,13 @@ as well as <strong>inline markup</strong>.</p>
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
<div class="section" id="why-not">
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p>
<p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a>
diff --git a/pelican/tests/output/basic/feeds/all.atom.xml b/pelican/tests/output/basic/feeds/all.atom.xml
index ba6322df..33e852a9 100644
--- a/pelican/tests/output/basic/feeds/all.atom.xml
+++ b/pelican/tests/output/basic/feeds/all.atom.xml
@@ -21,8 +21,8 @@ as well as <strong>inline markup</strong>.</p>
<div class="section" id="this-is-a-simple-title">
<h2>This is a simple title</h2>
<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
-<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
<pre class="literal-block">
>>> from ipdb import set_trace
>>> set_trace()
@@ -33,13 +33,13 @@ as well as <strong>inline markup</strong>.</p>
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
<div class="section" id="why-not">
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p>
<p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a>
diff --git a/pelican/tests/output/basic/feeds/bar.atom.xml b/pelican/tests/output/basic/feeds/bar.atom.xml
index 0d0f0ce6..2d594f29 100644
--- a/pelican/tests/output/basic/feeds/bar.atom.xml
+++ b/pelican/tests/output/basic/feeds/bar.atom.xml
@@ -3,12 +3,12 @@
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
<div class="section" id="why-not">
<h2>Why not ?</h2>
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
</div>
\ No newline at end of file
diff --git a/pelican/tests/output/basic/feeds/yeah.atom.xml b/pelican/tests/output/basic/feeds/yeah.atom.xml
index dfd37b62..3d48f4f3 100644
--- a/pelican/tests/output/basic/feeds/yeah.atom.xml
+++ b/pelican/tests/output/basic/feeds/yeah.atom.xml
@@ -5,8 +5,8 @@ as well as <strong>inline markup</strong>.</p>
<div class="section" id="this-is-a-simple-title">
<h2>This is a simple title</h2>
<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
-<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
-<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
<pre class="literal-block">
>>> from ipdb import set_trace
>>> set_trace()
diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html
index ed1356ed..077d0ba5 100644
--- a/pelican/tests/output/basic/index.html
+++ b/pelican/tests/output/basic/index.html
@@ -191,7 +191,7 @@ as well as inline markup.
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !
-
+
read more
diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html
index 86086bc1..df378418 100644
--- a/pelican/tests/output/basic/oh-yeah.html
+++ b/pelican/tests/output/basic/oh-yeah.html
@@ -43,7 +43,7 @@
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !
-
+
diff --git a/pelican/tests/output/basic/pictures/Sushi.jpg b/pelican/tests/output/basic/pictures/Sushi.jpg
new file mode 100644
index 00000000..e49e5f0a
Binary files /dev/null and b/pelican/tests/output/basic/pictures/Sushi.jpg differ
diff --git a/pelican/tests/output/basic/pictures/Sushi_Macro.jpg b/pelican/tests/output/basic/pictures/Sushi_Macro.jpg
new file mode 100644
index 00000000..21f935a1
Binary files /dev/null and b/pelican/tests/output/basic/pictures/Sushi_Macro.jpg differ
diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html
index b699a45d..04bb26eb 100644
--- a/pelican/tests/output/basic/tag/bar.html
+++ b/pelican/tests/output/basic/tag/bar.html
@@ -90,7 +90,7 @@ as well as inline markup.
Why not ?
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
YEAH !
-
+read more
diff --git a/pelican/tests/output/basic/tag/foobar.html b/pelican/tests/output/basic/tag/foobar.html
index 34505977..cc72782c 100644
--- a/pelican/tests/output/basic/tag/foobar.html
+++ b/pelican/tests/output/basic/tag/foobar.html
@@ -42,8 +42,8 @@