Add a --setting-overrides KEY=VAL command line option to override
default settings or those defined in settings files. This adds
flexibility in running Pelican and helps reduce sprawl of settings
files. Cast int and str setting overrides to their respective types.
Support other setting types by treating them as JSON. Fall back to JSON
when an override typecast errors. This should make it possible to set
int values to None, resp. to JSON 'none'
Combined file and folder watchers under a class and refactored
common watcher related code from __init__.py to the class.
This simplifies the main and autoreload functions in __init__
as well as fix the problem with crashes related to multiprocessing
on systems where default spawn mode is "spawn" instead of "fork".
The intention was to prevent accidental source content data loss by
skipping output directory deletion if the output directory is a parent
of the source content directory. But the previous implementation did so
by checking path *strings*, resulting in scenarios where the following
settings would erroneously skip deletion of the output directory:
PATH = "/repo/docs-src/content"
OUTPUT_PATH = "/repo/docs"
The output directory should have been deleted but wasn't because the
PATH string contains "/repo/docs". This change eschews string comparison
and instead compares actual paths to ensure that the output path is not
a parent of the source content directory.
Users were previously met with an ugly traceback. Now `pelican --listen`
invocations, when quit via CTRL-C, are followed instead by a more
user-friendly message.
* Creates pelican.plugins
* Moves plugin related code under pelican.plugins
* pelican.plugins.signals is now the location for signals, pelican.signals is kept
for backwards compatibility
* pelican.plugins._utils contains necessary bits for plugin discovery and loading.
Logic from Pelican class is moved here. Pelican class now just asks for plugins
and registers them
* Contains tests for old and new plugin loading
This commit removes Six as a dependency for Pelican, replacing the
relevant aliases with the proper Python 3 imports. It also removes
references to Python 2 logic that did not require Six.
Competing static site generators integrate the functionality of regenerating
content and serving it into their main executable. In pelican this
functionality used to be in an external script `develop_server.sh` which
resides in the blog base directory. This has the disadvantage that changes in
pelican can break the `develop_server.sh` scripts which will not automatically
be upgraded together with pelican by package managers. Thus, pelican should
integrate this functionality into its main executable.
To this end, this commit removes `develop_server.sh` and adds three command
line options to the pelican executable:
* `-l/--listen` starts the HTTP server (`-s/--serve` was already taken)
* `-p/--port` specifies the port to listen at
* `-b/--bind` specifies the IP to bind to
`--listen` and `--autoreload` can be used together to achieve the same
effect that other static site generators offer: Serve files via HTTP
while at the same time auto-generating the content.
Since the `develop_server.sh` script was removed, pelican-quickstart looses the
`develop` option.
Since the `develop_server.sh` script was removed, the Makefile looses the
`stopserver` target and the `devserver` target is replaced by running `pelican
-l` in the foreground.
Since pelican now offers the `--listen` option, the fabfile uses that instead
of starting the socketserver itself.
Fix intrasite links for non-'summary' metadata
Metadata like `MyArticleBanner: ` would be properly parsed (as defined in `FORMATTED_FIELDS`), but the intrasite links would not be processed.
Only the summary gets its intrasite links processed, has its value is either generated from the content (calling self._update_content at some point) or self._update_content is explicitly called if summary is passed as metadata.
This PR expands the paths as soon as possible in (`Content.__init__`) for metadata defined in `FORMATTED_FIELDS`.
Starting with python 3.6 warnings are issued for invalid escape
sequences in regular expressions. This commit corrects all
DeprecationWarning's via properly declaring the offending
regular expressions as raw strings.
Resolves#2095.