chiark / gitweb /
m.htmlsanity: introduce and use new format_siteurl filter.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 16:23:08 +0000 (18:23 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 16:23:08 +0000 (18:23 +0200)
commit9476408bc63a4496d5643a7d91f30155faf7f0fc
tree17a181bef743054b069e3f1887199323f3b3c109
parent9cbd3245657e9cf1e272a7035947526860b7b69f
m.htmlsanity: introduce and use new format_siteurl filter.

I needed a way to prepend SITEURL to page, article, tag etc URLs that's
consistent with current (wrong) Pelican way of doing it:

    '/'.join([SITEURL, url])

That of course doesn't work when `url` is an absolute URL, so I'm using
urljoin (but still staying compatible with the above). This is now also
used throughout the template -- I mistakenly assumed that when SITEURL
is set, all page.url etc. properties already have it, but that's
apparently *not* the case, which caused me a bit of headache the past
months.
16 files changed:
doc/plugins/htmlsanity.rst
pelican-plugins/m/htmlsanity.py
pelican-theme/templates/archives.html
pelican-theme/templates/article.html
pelican-theme/templates/article_footer.html
pelican-theme/templates/article_header.html
pelican-theme/templates/author.html
pelican-theme/templates/base.html
pelican-theme/templates/base_blog.html
pelican-theme/templates/base_blog_section.html
pelican-theme/templates/category.html
pelican-theme/templates/index.html
pelican-theme/templates/page.html
pelican-theme/templates/pagination.html
pelican-theme/templates/tag.html
site/pelicanconf.py