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.
When the `serve` and `livereload` targets are invoked, a web browser will be
automatically opened, pointing to the locally-served website.
If no web browser can be found by the module, the `open()` call returns
`False`, but no exception is raised. This means that it is still possible
to call livereload on a remote machine and access it without any error
being triggered.
Signed-off-by: Romain Porte <microjoe@microjoe.org>
- use custom build command, with caching turned on - this reduces site
build time by around 40% on my testing machines
- collect all glob patterns in a list and then call `server.watch`
on each item - this allows to have single place where callback
function must be specified
- use '**/*.html' as glob in template, to track changes in
subdirectories
By default, the rsync option '--cvs-exclude' excludes the 'tags'
directory. For a blog, it's a bit unfortunate, as it's quite common to
have a `tags` directory in a blog, either for the tag pages or the tag
feeds.
With this commit, we force rsync to include this directory, and save a
little headache to users who wonder why their tags are present in the
output directory, but are not present on the server.
The PORT variable check earlier in the Makefile sets up the `-p` argument as part of PELICANOPTS so prior to this change `-p` was duplicated on each of the serve targets.
Instead of serving on localhost by default with no way to override, the
host can now be configured, allowing both `serve` and `livereload` tasks
to serve output on non-localhost addresses such as `0.0.0.0`.
Adds a `preserve_case` parameter to the `slugify()` function and uses it
to preserve capital letters in category names when using the Pelican
importer.
The devserver target recently acquired a sane default of restricting
access only to localhost. This is good for security. However, it can
frustrate some usages like testing on phones on a local network or
hosting the dev server within VMs (e.g. Docker for Mac) which see host
OS browsers as not being 127.0.0.1.
Add a new target called `devserver-global` for this case. As it's longer
to type, the more svelte `devserver` will retain the more secure
defaults that will suffice for most users; they can use the
longer-to-type `devserver-global` target to relax the localhost-only
restriction.
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.
The syntax passed to rsync for specifying the port is incorrect. In the
Makefile template, the -e option is correctly used to pass the port. We
use the same syntax here to pass the SSH port.
This fix issue #2623.
Signed-off-by: Romain Porte <microjoe@microjoe.org>
Instead of repeating hard-coded 'pelicanconf.py' values throughout
Invoke's task.py template, assign default settings file names to
variables, and use those variables where applicable.
The default setting for OUTPUT_PATH is already 'output', so it would be
more DRY to use the existing default value instead of a hardcoded
'output' string.
Removes the `livereload` dependency from `setup.py`.
Updates the `invoke livereload` task by moving the `livereload` import
into the task function since it is now an optional dependency.
Updates the Invoke section of the documentaion with instructions on
using the `livereload` Invoke task.