Use str.startswith('/') to check whether 'ret' starts with a slash. The original code fails when 'ret' is an empty string, such as when INDEX_URL is set to "".
`shutil.rmtree` would fail in `TestUtils.test_clean_output_dir` on some
filesystems if an application with a filewatcher had the pelican project
open while the test ran.
Using `tempfile.mkdtmp` for test directories circumvents this.
There are small typos in:
- docs/tips.rst
- pelican/tests/__init__.py
Fixes:
- Should read `module` rather than `modulole`.
- Should read `console` rather than `cosole`.
Signed-off-by: Tim Gates <tim.gates@iress.com>
Get rid of the coerce_overrides() function.
Add the ParseOverrides argparse.Action to parse overrides.
Treat all extra settings values strictly as json values.
Test overrides.
Edit docs and cli help.
Add a <main> tag to surround all the content blocks, so that it's easier
to target the main part of a page (be it an article, the list of posts
or the different categories) using CSS.
Because of this, the <section> part of the article.html template is made
redundant, so it is removed.
Finally, the generic <div> is replaced by an <article> tag to surround
the article's content.
In the simple theme, some templates are using `h1`, others are using
`h2` for the main title of the page (other than the one in the header).
This commit changes that so all of the pages are using `h1`.
We want to hint at the location of our default set of substitutions.
This should allow easier reuse for plugin authors who need to access
this utility as well.
Closes#2845
Currently the `assertDirsEqual` test utility uses the `env` argument to `subprocess.Popen` to make git run non-interactively, but this overwrites all environment variables causing test failures on Guix. The `--no-pager` option is a more targeted way to achieve the same thing.
Filtration is now being applied before caching the metadata, solving the issue where _DISCARD objects from previous runs were being retrieved from cache.
These configuration files do not need a #! line as they are not intended to be
executed directly and are not marked as executable. (In practise this doesn't
cause any problems - it just came up in a Guix bug report because Guix
transforms the #! lines.)
The "coding: utf-8" lines are also no longer required now that Pelican is Python
3 only.
Folders without index.html has to be redirected (/foo -> /foo/) for
directory listing to work properly. Skip '/' suffix if original path
does not have it so that base class can return a redirect.
Improve _HTMLWordTruncator by using more than one unicode block in
_word_regex, making word count function behave properly with CJK,
Cyrillic, and more Latin characters when generating summary.