1
0
Fork 0
forked from github/pelican
Commit graph

181 commits

Author SHA1 Message Date
Alexis Métaireau
e39dc95c3b Bug #1493 — Memoize slugify when possible 2014-10-09 11:42:11 +02:00
Deniz Turgut
dec6023fe6 Fix for broken test in #1348 2014-09-18 20:09:12 -04:00
Justin Mayer
1d9981b4f9 Merge pull request #1348 from vjousse/davidmarble-page-order-by
Support ordering pages and articles when iterating in templates.
2014-09-18 16:12:51 -07:00
Justin Mayer
1fae9534d5 Merge pull request #1446 from avaris/enhanced_strftime
Fixes #1395: extends pelican.utils.strftime with `-` prefix to strip leading zeros
2014-08-28 11:17:28 -07:00
Justin Mayer
b8c9d61f20 Merge pull request #1411 from barrysteyn/typogrify-ignore-list
Allow Typogrify to ignore user specified tags. Refs #1407
2014-08-17 07:18:19 -06:00
Justin Mayer
2ecd85d7b3 Merge pull request #1412 from avaris/refactor_logging
Refactor logging handling
2014-08-13 14:17:09 -07:00
Justin Mayer
4261b9f5d0 Merge pull request #1371 from omasanori/tz
Add timezone to datetime objects. Refs #962.
2014-08-02 07:38:08 -07:00
Barry Steyn
a0ecab901f Allows Typogrify to ignore user specified tags. Refs #1407
Typogrify interferes with certain sections of the output that it should not touch (see #1407 for more details).
This feature adds a setting called TYPOGRIFY_IGNORE_LIST which is a list of tag for Typogrify to ignore.

The following was updated:

 1. readers.py - if TYPOGRIFY_IGNORE_TAGS is present, then use it
 2. settings.ps - default TYPOGRIFY_IGNORE_TAGS to []
 3. contents/article_with_code_block.rst - an article with a code block for typogrify to ignore
 4. updated tests
 5. updated documentation
2014-07-28 15:17:12 -07:00
Deniz Turgut
ed3209888a Refactor logging handling
Old system was using manual string formatting for log messages.
This caused issues with common operations like exception logging
because often they need to be handled differently for Py2/Py3
compatibility. In order to unify the effort:

 - All logging is changed to `logging.level(msg, arg1, arg2)` style.
 - A `SafeLogger` is implemented to auto-decode exceptions properly
in the args (ref #1403).
 - Custom formatters were overriding useful logging functionality
like traceback outputing (ref #1402). They are refactored to be
more transparent. Traceback information is provided in `--debug`
mode for `read_file` errors in generators.
 - Formatters will now auto-format multiline log messages in order
to make them look related. Similarly, traceback will be formatted in
the same fashion.
 - `pelican.log.LimitFilter` was (ab)using logging message which
would result in awkward syntax for argumented logging style. This
functionality is moved to `extra` keyword argument.
 - Levels for errors that would result skipping a file (`read_file`)
changed from `warning` to `error` in order to make them stand out
among other logs.
 - Small consistency changes to log messages (i.e. changing all
to start with an uppercase letter) and quality-of-life improvements
(some log messages were dumping raw object information).
2014-07-22 12:39:39 -04:00
Deniz Turgut
7c3cc8fc0d Fixes #1395: extends pelican.utils.strftime with - prefix to strip leading zeros
Adds the ability to use `-` prefix with C89 format codes to strip any
leading zeros.
2014-07-16 03:40:53 -04:00
Daan Debie
00434d4bb6 Reader name now accessible for articles and pages 2014-07-15 00:29:52 +02:00
OGINO Masanori
2c50ccb764 Add timezone to datetime objects. Refs #962.
Based on https://github.com/getpelican/pelican/pull/977, but it adds
timezone information before formatting.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-07-04 01:23:57 +09:00
Ondrej Grover
40c9406ca4 Fix test_direct_templates_save_as_false test case
A non-existent asserts_called_count attr was used which would always
succeed, silently hiding the error.
2014-06-27 14:54:18 +02:00
Deniz Turgut
009543b7e4 Fix test errors on OSX
On OSX, if LC_TIME and LC_CTYPE differs the output of strftime is not properly decoded
in Python 3. This makes sure that the 'utils.DateFormatter' and the related Jinja filter
'strftime' set the same value for LC_TIME and LC_CTYPE while formatting.

Also, '%a' is removed from DEFAULT_DATE_FORMAT in 'custom_locale' tests. OSX and *nix have
different conversions for '%a' ('Jeu' vs 'jeu.') and there is not a feasible way to handle
the difference for tests.
2014-06-26 01:01:42 -04:00
Ondrej Grover
3f6b130d6e Fix #1198, enable custom locale in template rendering, fixes links
reverts getpelican/pelican@ddcccfeaa9

If one used a locale that made use of unicode characters (like fr_FR.UTF-8)
the files on disk would be in correct locale while links would be to C.

Uses a SafeDatetime class that works with unicode format strigns
by using custom strftime to prevent ascii decoding errors with Python2.

Also added unicode decoding for the calendar module to fix period
archives.
2014-06-26 00:00:19 -04:00
Justin Mayer
2432a22400 Merge pull request #1322 from smartass101/get_files_multiple_paths
move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS and correlate with {ARTICLE,PAGE}_EXCLUDES
2014-06-25 07:29:22 -07:00
Deniz Turgut
bf9316bb7e Remove AsciiDocReader from core. Fixes #1355 2014-06-14 02:17:43 -04:00
Mark Lee
e86f4d6250 Merge branch 'master' of https://github.com/getpelican/pelican into davidmarble-page-order-by 2014-05-27 11:15:34 -07:00
Ondrej Grover
b8db970455 Fix RstReader authors metadata processing
The reader would return a list of authors already, but
METADATA_PROCESSORS['authors'] expects a string.
Added a test case for this (only the HTMLReader had it).
2014-05-25 09:12:35 +02:00
Ondrej Grover
6aa0e4346d Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES automatically
This makes it easier for someone to change PAGE_PATHS without the
need to change ARTICLE_EXCLUDES accordingly.
2014-05-14 14:30:21 +02:00
Ondrej Grover
d635a347d1 move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS
Instead of one path a list can be given. This is due to popular request.
Should help people not wanting to use Pelican for blogging.
Maintain backward compatibility though.
Thanks to @ingwinlu for pointing out the change in StaticGenerator.
2014-05-14 14:04:50 +02:00
Vincent Jousse
bf6a4ad747 Add missing methods 2014-05-14 11:11:58 +02:00
Vincent Jousse
ebf0da0f7b Merge remote-tracking branch 'remotes/malept/davidmarble-page-order-by' into davidmarble-page-order-by
Conflicts:
	docs/settings.rst
	pelican/generators.py
	pelican/tests/test_generators.py
2014-05-14 10:48:41 +02:00
Ondrej Grover
5bad061c19 rename CACHE_DIR -> CACHE_PATH to unify with rest of Pelican
CACHE_PATH can now be relative to settings file like OUTPUT_PATH.
Also add --cache-path commandline option.
Change cache loading warning to a less scary and more helpful message.
2014-05-02 18:08:32 +02:00
Justin Mayer
cd35e713e0 Merge pull request #1313 from al-tonio/frenchdate
Test to reproduce problem with Python 3.3+ on Mac OS X only
2014-04-21 11:46:56 -07:00
Ondrej Grover
c1324b0206 split content caching into two layers
This is a reworked and improved version of content caching.
Notable changes:
- by default only raw content and metadata returned by readers are
  cached which should prevent conficts with plugins, the speed benefit
  of content objects caching is not very big with a simple setup
- renamed --full-rebuild to --ignore-cache
- added more elaborate logging to caching code
2014-04-20 14:34:52 +02:00
Justin Mayer
5959346e17 Merge pull request #1310 from eincs/handle-multiline-meta-in-markdown
Handle multi-line meta in markdown content properly
2014-04-18 20:47:10 -07:00
Shauna
e6be02264a Add feeds for each author 2014-04-18 14:29:18 -07:00
James Lee
22484983e9 Handle list metadata as list of string in MarkdownReader 2014-04-19 03:45:48 +09:00
Justin Mayer
06080dd873 Merge pull request #1318 from smartass101/fix_cacher_open_func
set _cache_open func even if not loading cache, fixes autoreload
2014-04-18 11:27:22 -07:00
Ondrej Grover
676981c621 set _cache_open func even if not loading cache, fixes autoreload
The _cache_open attribute of the FileDataCacher class was not set when
settings[load_policy_key] was not True, so saving later failed.
As a precaution, replaced the `if ...: return` style with a plain
if structure to prevent such readability issues and added tests.
2014-04-18 07:15:26 +02:00
Ondrej Grover
6703950abe enable writing of only selected output paths
- add WRITE_SELECTED setting
- add --write-selected commandline option
2014-04-17 19:36:18 +02:00
Antoine Brenner
fd7cb9e213 Test to reproduce an issue that occurs with python3.3 under macos10 only
This test passes fine under linux
2014-04-15 22:01:20 +02:00
Antoine Brenner
7277c95fb5 Make sure locale is what we want before/after the tests
The locale is a global state, and it was not properly reset to
whatever it was before the unitttest possibly changed it.
This is now fixed.

Not restoring the locale led to weird issues: depending on
the order chosen by "python -m unittest discover" to run
the unit tests, some tests would apparently randomly fail
due to the locale not being what was expected.

For example, test_period_in_timeperiod_archive would
call mock('posts/1970/ 1月/index.html',...) instead of
expected mock('posts/1970/Jan/index.html',...) and fail.
2014-04-15 16:45:45 +02:00
Ondrej Grover
fd77926700 Cache content to speed up reading. Fixes #224.
Cache read content so that it doesn't have to be read next time if its
source has not been modified.
2014-04-15 08:57:38 -04:00
Justin Mayer
66a16b560f Merge pull request #1307 from al-tonio/datetestfix
Fix unittest issue related to python2/python3 differences
2014-04-14 15:52:31 -04:00
Antoine Brenner
03976b650d Fix unittest issue related to python2/python3 differences
The test_datetime test passed on python3 but not python2 because
datetime.strftime is a byte string in python2, and a unicode string in python3

This patch allows the test to pass in both python2 and python3 (3.3+ only)
2014-04-14 20:43:19 +02:00
Rogdham
d9b0091357 Limit and filter logs
Drop duplicates logs.
Allow for logs to be grouped, enforcing a maximum number of logs per group.
Add the LOG_FILTER setting to ask from the configuration file to ignore some
logs (of level up to warning).
2014-04-01 20:44:09 +02:00
Justin Mayer
cfd18b20fc Merge pull request #1266 from hrbonz/date_timezone
Change date metadata parsing to dateutil.parser
2014-03-31 16:36:23 -07:00
Justin Mayer
8ec958fb35 Merge pull request #1293 from jeanlauliac/typogrify-summary
Apply Typogrify to article summary
2014-03-30 12:08:05 -07:00
Justin Mayer
16b288222d Merge pull request #1268 from bandb42/multiple_authors_fix
Split multiple authors on ',' instead of every character
2014-03-30 11:40:23 -07:00
Jean Lauliac
91d576eb45 Apply typogrify on article summary as well 2014-03-24 14:59:03 -04:00
th3aftermath
990ddb5a5e Fix Issue #1165 allows extensions to be set by certain settings
PAGINATION_PATTERNS was hard coded so that all files had a ".html" extension. This fixes that and add a test to
ensure that the pagination code is not changing the filename incorrectly.
2014-03-08 20:33:23 -05:00
th3aftermath
56b0061393 Add the setting SLUGIFY_ATTRIBUTE 2014-03-04 21:16:23 -05:00
Stefan hr Berder
652eb3686f add lang support for drafts (#826 & #1107)
Fix #826
Fix #1107
2014-02-23 14:03:09 +01:00
Stefan hr Berder
7f2bc2a23b change date metadata parsing to dateutil.parser 2014-02-23 11:21:44 +01:00
Ben Bridts
05d357e98e Split multiple authors on ',' 2014-02-18 17:56:57 +01:00
Justin Mayer
58e817cb0f Merge pull request #859 from cdunklau/new_github_logo
Update GitHub icon for notmyidea theme
2014-02-17 09:40:46 -08:00
Mario Lang
cff9d0aa58 Fix stray </ol> and </section> if only one article is displayed.
We already check if loop.length > 1 before outputting <section> and <ol>
tags, but we neglected to do the same check when outputting the corresponding
end tags.

Also, since I had to read the code when I touched it, simplified a conditional:
if (a) if (a and (b or not b and c))
can be simplified to
if (a) if (b or c)

Note the "b or not b", it was just too ugly to not fix.
2014-02-15 13:21:06 +01:00
Mario Lang
459a13bf79 HTML error in notmyidea: <li> not allowed in <section>.
<li> tags need to be inside of <ul> or <ol>.
Thanks to the w3c_validate plugin for finding this.
2014-02-15 13:02:03 +01:00