1
0
Fork 0
forked from github/pelican
Commit graph

1,577 commits

Author SHA1 Message Date
Jorge Maldonado Ventura
9495a6c3df Remove trailing whitespaces from notmyidea 2017-07-30 17:41:32 +02:00
Justin Mayer
68724e9682 Encourage use of https:// in SITEURL
Refs #2183 #2186
2017-07-25 09:00:41 -07:00
winlu
089b46b7eb Consolidate validation of content (#2128)
* Consolidate validation of content

Previously we validated content outside of the content class via
calls to `is_valid_content` and some additional checks in page /
article generators (valid status).
This commit moves those checks all into content.valid() resulting
in a cleaner code structure.
This allows us to restructure how generators interact with content,
removing several old bugs in pelican (#1748, #1356, #2098).

- move verification function into content class
- move generator verifying content to contents class
- remove unused quote class
- remove draft class (no more rereading drafts)
- move auto draft status setter into Article.__init__
- add now parsing draft to basic test output
- remove problematic DEFAULT_STATUS setting
- add setter/getter for content.status
  removes need for lower() calls when verifying status

* expand c4b184fa32

Mostly implement feedback by @iKevinY.

* rename content.valid to content.is_valid
* rename valid_* functions to has_valid_*
* update tests and function calls in code accordingly
2017-07-24 10:01:14 -07:00
Jonas Lundholm Bertelsen
1c96d8c933 Correct import of socketserver on Python 3 2017-07-24 12:25:21 +02:00
Justin Mayer
fbb1f32a06 Merge pull request #2165 from pananormalny/fix_rsync_makefile
Fix rsync_upload in Makefile template
2017-07-20 14:54:03 -07:00
Justin Mayer
f9a778fcae Merge pull request #2163 from mosra/override-docutils-html-translator
Ability to override docutils HTML translator
2017-07-20 14:14:43 -07:00
Vladimír Vondruš
7336de45cb Ability to override docutils HTML writer/translator.
The RstReader class can now use user-specified writer/translator classes
instead of the hardcoded ones from docutils. This allows for far easier
overriding of the default HTML output -- in the past one would need to
override the internal _parse_metadata() and _get_publisher() functions.
With hypothetical Html5Writer and Html5FieldBodyTranslator classes,
based for example on docutils.writers.html5_polyglot.Writer and
docutils.writers.html5_polyglot.HTMLTranslator, a plugin that overrides
the default behavior would now look just like this:

    # (definition of Writer / Translator classes omitted)

    class Html5RstReader(RstReader):
        writer_class = Html5Writer
        field_body_translator_class = Html5FieldBodyTranslator

    def add_reader(readers):
        readers.reader_classes['rst'] = Html5RstReader

    def register():
        pelican.signals.readers_init.connect(add_reader)
2017-06-30 22:59:42 +02:00
Justin Mayer
d4435ea874 Merge pull request #1982 from adeverteuil/feature_check_static_modified
Add static file options: hard/symlink & only-when-modified
2017-06-22 12:49:26 -07:00
evilroot
fdf355c377 Fix rsync_upload in Makefile template 2017-06-08 22:59:12 +01:00
Justin Mayer
fa1d4d937c Merge pull request #2130 from ingwinlu/more_py36_regex_warnings
Fix more Python 3.6 regex warnings
2017-05-31 09:10:22 -07:00
derwinlu
c68958e6b8 Fixup ec5c77b251
fix forgotten PAGES -> pages
2017-05-05 16:02:48 +02:00
Justin Mayer
c2b2def1c8 Merge pull request #2115 from jvoisin/_update_content_regexp_simplification
Improve the regexp used in _update_content
2017-04-20 12:18:11 -07:00
jvoisin
ad38d602c7 Improve the regexp used in _update_content
a html tag always starts with <[a-z], < [a-z] is invalid
a space can be found after the = in href='bleh'

This function is taking 10% of the compilation time, with caching enabled,
maybe it's worth optimising the regexp a bit more, I don't know.
2017-03-31 11:39:05 +02:00
derwinlu
f49037e0ca Fixup 89b28fd
We need to mark the whole doctest string as raw as it contains
regular expressions.
2017-03-29 10:46:51 +02:00
derwinlu
623eb0a4c0 Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
derwinlu
89b28fd36b Fix warnings originating from bad regexes
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.
2017-03-27 16:09:08 +02:00
Justin Mayer
fb07f4d513 Merge pull request #2117 from timwienk/fix-none-filename-metadata
Optional items in FILENAME_METADATA expression.
2017-03-20 15:40:35 -07:00
Justin Mayer
30df8e3558 Merge pull request #2085 from Scheirle/feed_signal
Add new signal: feed_generated
2017-03-19 15:04:07 -04:00
Tim Wienk
4917b8618a Fix setting None metadata from FILENAME_METADATA matches.
This is relevant when using optional items in the expression. E.g. if an
optional captured group is not matched, the result of
`match.groupdict()` contains the captured group with value `None`.
2017-03-15 17:07:31 +01:00
fxfitz
b65a790b50 Switch over to use awscli 2017-03-13 17:59:43 -05:00
Justin Mayer
ee643d47d7 Merge pull request #2099 from horazont/feature/stop-save_as-from-breaking-out-of-output
Try to prevent writing outside of the output directory
2017-02-28 11:17:44 -08:00
Jonas Wielicki
018f4468cc Check safety of save_as earlier if possible
The check in the writer still serves as a safety net.
2017-02-27 21:49:17 +01:00
Jonas Wielicki
4006554a49 Prevent to write outside the output directory
This is crude and simply raises RuntimeError. We would generally
want to have earlier checks which log a warning and do not call
write at all.
2017-02-02 20:40:51 +01:00
derwinlu
22208a9471 Add test checking url replcmnt of unkn. file
There was no test case checking the behaviour of what happens when
trying to {filename} an unknown file.

Also changed the braces to `'` chars that we use elseware.
2017-01-24 09:12:16 +01:00
derwinlu
5a19887a22 Correct new flake8 warnings 2017-01-24 09:12:16 +01:00
Bernhard Scheirle
927d9c7ea5 Add new signal: feed_generated
This signal gets emitted before a feed gets written to disk.
Therefore it allows plugins to do arbitrary changes to the feed.
2017-01-16 11:33:13 +01:00
Justin Mayer
25732f7be6 Prepare version 3.7.2.dev0 for next development cycle 2017-01-10 13:51:37 -08:00
Justin Mayer
ce38e318bd Bump version 3.7.1 2017-01-10 13:34:09 -08:00
Alexandre de Verteuil
b46fbb7879 Add two STATIC_ settings. Fix #1982
STATIC_CREATE_LINKS = False

Create links instead of copying files. If the content and output
directories are on the same device, then create hard links. Falls
back to symbolic links if the output directory is on a different
filesystem. If symlinks are created, don’t forget to add the -L or
--copy-links option to rsync when uploading your site.

STATIC_CHECK_IF_MODIFIED = False

If set to True, and STATIC_CREATE_LINKS is False, compare mtimes of
content and output files, and only copy content files that are newer
than existing output files.
2016-12-30 02:45:37 -05:00
Lucas Chavez
84920e8fdf Set locale to LC_ALL in Quickstart script. Fixes #2043 2016-12-27 16:25:17 -07:00
Justin Mayer
82ada44aa8 Merge pull request #2065 from amyspark/master
Initialize locale for Python 2+ in quickstart script. Fixes #2043
2016-12-16 14:44:01 -08:00
L. E. Segovia
5c6ae32f99 For python 2+, initialize locale. Fixes #2043 2016-12-16 23:10:53 +01:00
Justin Mayer
0936d5f6ee Prepare version 3.7.1.dev0 for next development cycle 2016-12-14 13:56:47 -08:00
Justin Mayer
d13d57eaa6 Bump version 3.7.0 2016-12-12 14:05:20 -08:00
Justin Mayer
3518713ac6 Merge pull request #2022 from rjames86/query_strings
Prevent server from dying when query strings present
2016-12-12 10:18:04 -08:00
Ryan M
90025818ed prevent server from dying when query strings present
split on first ?
2016-12-10 10:05:50 -08:00
Deniz Turgut
1c09741280 Add tests to make sure cached content is properly added to generators 2016-12-10 05:18:35 -05:00
Deniz Turgut
fc52234986 Fix generator caching
With generator level caching, cached files weren't added to the
collections. Only new files were processed. This fixes the issue.
2016-12-10 02:05:35 -05:00
Justin Mayer
f17f3068e3 Merge pull request #2051 from Totktonada/feature/rss_full_content_opt
Add option to include full content into RSS feeds
2016-12-03 12:48:58 -08:00
Ryan M
335c40d23e Allow setting Jinja environment arguments from settings
fix flake8 warnings

Set jinja environment defaults within settings

updating docs to remove JINJA_EXTENSIONS

update logger warning and defaults documentation

better way to grab jinja environment

updating settings after refactor
2016-12-03 10:27:27 -08:00
Rogdham
6cc053b920 Improve logging in translation detection 2016-11-21 23:21:34 +01:00
Rogdham
4645def789 Fix translation metadata support 2016-11-20 20:01:56 +01:00
Alexander Turenko
d3b22c6e21 Add option to include full content into RSS feeds
Include only summary by default.

This follow ups pull [1], where RSS feeds become summary-only.

[1]: https://github.com/getpelican/pelican/pull/1989
2016-11-20 00:06:27 +03:00
John
6f9f0def0f Fix #1325 and add test_find_empty_alt 2016-11-17 23:29:19 +00:00
Bernhard Scheirle
a445e81ae6 Make markdown extensions order non-arbitrary 2016-11-15 17:05:12 +01:00
Bernhard Scheirle
27d67f04cb Update unittest to match the new Markdown output format 2016-11-02 21:19:41 +01:00
Bernhard Scheirle
a80a707321 Set the Markdown output format to html5 by default 2016-11-02 21:11:42 +01:00
Bernhard Scheirle
9e399e7a05 Updates test cases to use MARKDOWN 2016-11-02 21:11:42 +01:00
Bernhard Scheirle
35dba138e0 Replaces MD_EXTENSIONS with MARKDOWN
MARKDOWN allows to configure the python markdown module

fixes #1024
2016-11-02 21:11:42 +01:00
Justin Mayer
594b9c9633 Merge pull request #2040 from avaris/exception_logging_fixes
Fixes Exception name related bugs
2016-10-29 12:57:46 -06:00