1
0
Fork 0
forked from github/pelican
Commit graph

166 commits

Author SHA1 Message Date
th3aftermath
b00d9ef6d1 Add Multi-theme support
Adds multi-theme support using the new THEMES setting.
You can specify all the themes that you will be using in python
dicionary form. You can then inherit from the themes specified
in THEMES using the corresponding key in the dictionary.
2014-11-04 20:13:01 +01:00
Justin Mayer
de8b437549 Merge pull request #1466 from cgar/spelling
Minor spelling fixes
2014-11-02 12:20:30 -08:00
Forest
48f4f0850d Make StaticGenerator skip content sources. Refs #1019.
This change partially addresses issue #1019, by teaching Pelican to distinguish
between static files and content source files. A user can now safely add the
same directory to both STATIC_PATHS and PAGE_PATHS (or ARTICLE_PATHS). Pelican
will then process the content source files in that directory normally, and
treat the remaining files as static, without copying the raw content source
files to the output directory. (The OUTPUT_SOURCES setting still works.)

In other words, images and markdown/reST files can now safely live together.

To keep those files together in the generated site, STATIC_SAVE_AS and
PAGE_SAVE_AS (or ARTICLE_SAVE_AS) should point to the same output directory.

There are two new configuration settings:

STATIC_EXCLUDES=[]  # This works just like PAGE_EXCLUDES and ARTICLE_EXCLUDES.
STATIC_EXCLUDE_SOURCES=True  # Set this to False to get the old behavior.

Two small but noteworthy internal changes:

StaticGenerator now runs after all the other generators. This allows it to see
which files are meant to be processed by other generators, and avoid them.

Generators now include files that they fail to process (e.g. those with missing
mandatory metadata) along with all the other paths in context['filenames'].
This allows such files to be excluded from StaticGenerator's file list, so they
won't end up accidentally published. Since these files have no Content object,
their value in context['filenames'] is None. The code that uses that dict has
been updated accordingly.
2014-10-31 16:46:01 -07:00
Carlos E. Garcia
f5775bcba0 minor spelling fixes 2014-09-15 20:29:00 -04:00
Justin Mayer
2ecd85d7b3 Merge pull request #1412 from avaris/refactor_logging
Refactor logging handling
2014-08-13 14:17:09 -07:00
RR2DO2
df0731f2e8 Debug print removal
The print either is a debug print that needs removing, or needs an additional description. The first is more likely.
2014-07-25 19:24:40 +01: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
Justin Mayer
e7eb3b8ec3 Increment development version to 3.5.dev 2014-07-01 16:03:02 -07:00
Justin Mayer
a47c0e26c0 Bump version 3.4.0 2014-07-01 13:34:47 -07:00
Ondrej Grover
21882fd4a0 Fix #1344 move PLUGIN_PATH -> PLUGIN_PATHS
Pelican uses *_PATHS names for settings that represent a list of paths.
2014-05-14 14:19:52 +02:00
Ondrej Grover
7cbf750329 Fix typo in command-line option description. 2014-05-10 17:38:58 +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
Ondrej Grover
f00fc944fb Fix get_writer signal received result unpacking 2014-05-01 10:39:07 +02:00
Ondrej Grover
5a3daae72f add get_writer signal and unify with get_generators
Fix outdated docs of get_generators to unify.
2014-04-27 14:25:08 +02: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
Lonewolf
c386e29d0c Ability to specify PLUGIN_PATH as list
PLUGIN_PATH added to settings table
2014-04-18 12:59:06 -07: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
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
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
Stefan hr Berder
652eb3686f add lang support for drafts (#826 & #1107)
Fix #826
Fix #1107
2014-02-23 14:03:09 +01:00
Justin Mayer
23e7ac3659 Merge pull request #1094 from mua/master
Watch static folders in Autoreload mode
2014-01-22 07:54:12 -08:00
M. Utku Altinkaya
cda21c5481 Update __init__.py
Watch static folders using utils.folder_watcher
2014-01-22 01:55:46 +02:00
Simon Conseil
fb4b894b77 More pep8 fixes and refactor the check for old settings. 2014-01-05 23:34:46 +01:00
Norton Wang
f69c71000a Fix typo in manual 2013-11-01 16:59:45 -04:00
M. Utku Altinkaya
a987b65bd2 Watch static folders in Autoreload mode 2013-09-25 04:43:06 +03:00
Justin Mayer
2c468f091a Prepare version 3.3.1.dev for next development cycle 2013-09-24 21:57:28 +02:00
Justin Mayer
b35ce43b7f Bump version 3.3.0 2013-09-24 21:57:07 +02:00
Axel Haustant
c61f6f402a Prepare for bumpr 2013-08-24 20:17:05 +02:00
Axel Haustant
d11b33030f Use .dev suffix for development versions 2013-08-21 06:18:43 +02:00
Talha Mansoor
a7152716e2 Receive the two values returned from get_instance()
`get_instance()` returns two values. Old code, instead of unpacking two
values in two variables, placed the tuple in a single variable
`pelican`.

Later in the same block when `pelican.run()` was called, it resulted in
error.

```
-> Modified: content, theme, settings. re-generating...
CRITICAL: ("'tuple' object has no attribute 'run'",)
CRITICAL: 'tuple' object has no attribute 'run'
Traceback (most recent call last):
  File "/Users/talha/Repos/VirtualEnvs/pelican-dev/bin/pelican", line 8,
  in <module>
    load_entry_point('pelican==3.3', 'console_scripts', 'pelican')()
    File
    "/Users/talha/Repos/VirtualEnvs/pelican-dev/lib/python2.7/site-packages/pelican-3.3-py2.7.egg/pelican/__init__.py",
    line 353, in main pelican.run()
```

Either the returned value should be unpacked properly or
`pelican[0].run` should be called.
2013-08-11 01:43:27 +05:00
Simon Conseil
4bc4b1500c Refactor readers and remove MARKUP
Add a `Readers` class which contains a dict of file extensions / `Reader`
instances. This dict can be overwritten with a `READERS` settings, for instance
to avoid processing *.html files:

    READERS = {'html': None}

Or to add a custom reader for the `foo` extension:

    READERS = {'foo': FooReader}

This dict is no storing the Reader classes as it was done before with
`EXTENSIONS`. It stores the instances of the Reader classes to avoid instancing
for each file reading.
2013-08-06 23:42:41 +02:00
Kyle Mahan
dfc3a7ce2f Move PDF generation to a plugin. Fixes #1009 2013-08-04 18:01:56 -07:00
Russ Webber
4977de8453 fix: clear directory before generation of context
fixes #927
2013-08-04 14:00:56 +08:00
Russ Webber
3445066b11 fix an exception not correctly reporting if the locale is not set 2013-07-18 09:44:46 +08:00
Justin Mayer
6f36b0a246 Keep certain files when cleaning output; fix #574
If DELETE_OUTPUT_DIRECTORY is set to True, all files and directories are
deleted from the output directory. There are, however, several reasons
one might want to retain certain files/directories and avoid their
deletion from the output directory. One such use case is version control
system data: a versioned output directory can facilitate deployment via
Heroku and/or allow the user to easily revert to a prior version of the
site without having to rely on regeneration via Pelican.

This change introduces the OUTPUT_RETENTION setting, a tuple of
filenames that will be preserved when the clean_output_dir function in
pelican.utils is run. Setting OUTPUT_RETENTION = (".hg", ".git") would,
for example, prevent the relevant VCS data from being deleted when the
output directory is cleaned.
2013-06-25 19:03:32 -07:00
Danilo Bargen
d8c9fb31d0 Better duck typing in isinstance check 2013-06-20 00:13:57 +02:00
W. Trevor King
0d1866b393 Pelican.run: Use keyword arguments when initializing generators
This makes it easier to add new arguments to Generator subclasses.
2013-06-16 12:15:26 -04:00
W. Trevor King
8ff34e6c5d Replace settings.get(key) with settings[key] for default settings
If a setting exists in DEFAULT_CONFIG, assume it will be there
(instead of checking and/or providing a local default).  The earlier
code was split between the two idioms, which was confusing.
2013-06-02 14:24:27 -04:00
Alexis Métaireau
ead50cca62 some cleanup 2013-05-13 13:53:52 +10:00
Alexis Metaireau
bcfd574664 Merge pull request #804 from dowlingw/master
#803 - Include default configuration file if present
2013-05-12 20:50:31 -07:00
Deniz Turgut
084818b399 Handle critical exception logging correctly in localized systems
Python generates certain exception messages (like IOError) in system
language, if locale is set. This ensures that the message is properly
converted to unicode in Python 2.
2013-05-04 04:55:42 -04:00
Deniz Turgut
be8837963a ignore emacs lock files and exception handling for watchers 2013-04-22 20:50:11 -04:00
Justin Mayer
e55878fc2e Merge pull request #857 from avaris/feedback
add feedback to user and refactor 'autoreload' code
2013-04-20 07:57:56 -07:00
Deniz Turgut
5ccbbcc7d1 add feedback to user and refactor 'autoreload' code 2013-04-19 13:35:20 -04:00
Deniz Turgut
a07052ff86 force argparse output to be unicode in Py2 2013-04-18 15:03:43 -04:00
Deniz Turgut
a3e8a2d18d __import__ fails for unicode 'fromlist' in Py2.x 2013-04-14 17:03:19 -04:00
Deniz Turgut
c2924402ad Fix for issue #428: Use PLUGIN_PATH properly 2013-04-05 02:39:12 -04:00
Will Dowling
de69739774 Fixing help text 2013-03-26 02:42:11 +00:00
Will Dowling
0d43017704 Adding information to argparse help 2013-03-26 10:37:37 +08:00
Will Dowling
608e398386 Removing utils.file_exists and replacing with os.path.isfile 2013-03-25 10:45:43 +00:00