1
0
Fork 0
forked from github/pelican
Commit graph

133 commits

Author SHA1 Message Date
Alexis Métaireau
cb5f66ffe0 Check all lists are not strings. 2013-03-23 19:56:45 -07:00
Dave King
bd54cb1b88 Prevent people from setting STATIC_PATHS to a str
Previously you could accidentally set for example site/css and pelican would iterate through the string and attempt to copy '/' into your output.
2013-03-23 19:56:14 -07:00
W. Trevor King
b59da89e80 Convert '.' and '..' to the less magical os.curdir and os.pardir
While I'm cleaning up path manipulation, I might as well make things
more semantic.
2013-03-21 12:44:44 -04:00
W. Trevor King
a5c1fdac58 settings: Use splitext to remove extensions, not rpartition 2013-03-21 12:44:44 -04:00
W. Trevor King
e5e455e0e5 Replace os.sep.join with the more robust os.path.join
From the Python docs for os.sep [1]:

  Note that knowing this is not sufficient to be able to parse or
  concatenate pathnames - use os.path.split() and os.path.join()...

Where I touched a line, I also changed double quoted string literals
to single quotes, since they are used more often in the source:

  wking@mjolnir ~/src/pelican $ git grep "'" pelican/*.py | wc -l
  683
  wking@mjolnir ~/src/pelican $ git grep '"' pelican/*.py | wc -l
  181

[1]: http://docs.python.org/3/library/os.html#os.sep
2013-03-21 11:38:14 -04:00
John Mastro
f92c800216 Add a period archives feature and brief docs.
Allows users to have per-year, per-month, and per-day archives of posts
automatically generated. The feature is disabled by default; to enable
it a user must supply format strings for a period's respective
`_SAVE_AS` setting.
2013-03-15 17:22:42 -07:00
W. Trevor King
bfa8851af0 Add the PATH_METADATA setting
Sometimes the base filename doesn't have everything you need.

Remember that os.sep is platform dependent, so using it in a regular
expression for this setting may not be portable (boo MS Windows!).
2013-03-12 15:16:25 -07:00
W. Trevor King
49bf80ec39 contents: Convert StaticContent to Static, a Page subclass
Static needs a lot of the same handling as other pages, so make it a
subclass of Page.  The rename from StaticContent to Static makes for
cleaner configuration settings (STATIC_URL instead of
STATICCONTENT_URL).

All currently generated Static instances override the save_as
attribute explicitly on initialization, but it isn't hard to imagine
wanting to adjust STATIC file output based on metadata (e.g. extracted
from their source filename).  With this union, the framework for
manipulating URLs and filenames is shared between all source file
types.
2013-03-10 23:19:56 -07:00
Alexis Métaireau
14cf5f014c Some doc + various enhancements 2013-03-10 22:57:08 -07:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08:00
Rıdvan Örsvuran
0288bf1f68 added IGNORE_FILES setting for autoreload 2013-01-23 01:02:46 +01:00
W. Trevor King
004adfa5cc content: Convert Path.filename to .source_path
Making everything consistent is a bit awkward, since this is a
commonly used attribute, but I've done my best.

Reasons for not consolidating on `filename`:

* It is often used for the "basename" (last component in the path).
  Using `source_path` makes it clear that this attribute can contain
  multiple components.

Reasons for not consolidating on `filepath`:

* It is barely used in the Pelican source, and therefore easy to
  change.
* `path` is more Pythonic.  The only place `filepath` ever show up in
  the documentation for `os`, `os.path`, and `shutil` is in the
  `os.path.relpath` documentation [1].

Reasons for not consolidating on `path`:

* The Page elements have both a source (this attribute) and a
  destination (.save_as).  To avoid confusion for developers not aware
  of this, make it painfully obvious that this attribute is for the
  source.  Explicit is better than implicit ;).

Where I was touching the line, I also updated the string formatting in
StaticGenerator.generate_output to use the forward compatible
'{}'.format() syntax.

[1]: http://docs.python.org/2/library/os.path.html#os.path.relpath
2013-01-18 07:57:35 -05:00
Alexis Metaireau
a7fb6b5eae Merge pull request #661 from wking/settings-abspath
settings: Fix abspath existence check for path settings
2013-01-15 10:56:57 -08:00
Dirk Makowski
71995d5e1b Port pelican to python 3.
Stays compatible with 2.x series, thanks to an unified codebase.
2013-01-11 03:20:09 +01:00
W. Trevor King
9eb5ad77ef settings: Fix abspath existence check for path settings
The path to check is `absp`.  `p` is the setting name.
2013-01-03 12:19:27 -05:00
Bruno Binet
8bb86d3e5d revert #523
we don't need a new MARKDOWN_EXTENSIONS setting because the equivalent setting
MD_EXTENSIONS already exists.
2012-12-03 22:35:11 +01:00
Bruno Binet
debd6fb3b4 add FILENAME_METADATA setting to extract metadata from filename
FILENAME_METADATA default to '(?P<date>\d{4}-\d{2}-\d{2}).*' which will allow
to extract date metadata from the filename.
2012-12-03 09:53:14 +01:00
Bruno Binet
fa82e19c1f change default value for DEFAULT_DATE to None
(was 'fs' => guess from file mtime)
2012-11-28 00:29:51 +01:00
Bruno Binet
801bc755b5 Merge branch 'pr/558'
Conflicts:
	docs/settings.rst
	pelican/signals.py
2012-11-23 15:32:17 +01:00
jawher
1b81f8b830 Move SITEURL check for feed generation from generators.py to settings.py 2012-11-12 23:01:17 +01:00
jawher
13f444260c Avoid iterating over all settings keys to detect if a feed is enabled 2012-11-12 23:01:17 +01:00
jawher
8a72b11e3d code style: remove unnecessary trailing \ 2012-11-12 23:01:17 +01:00
jawher
537e9df3ed Reworked the "unset feed_domain" warning to handle all feed variables 2012-11-12 23:01:16 +01:00
jawher
5593670759 The default settings sets up FEED_ALL_ATOM (instead of FEED_ATOM) to all.atom.xml 2012-11-12 23:01:16 +01:00
Simon
4cfb0cd24e Move Webassets in a plugin 2012-11-07 00:17:50 +01:00
Simon
1b20319074 add a warning for the users of the LESS_GENERATOR setting 2012-11-05 21:56:18 +01:00
Simon
d0f5875f66 remove the LessCSSGenerator and the related config option 2012-11-05 21:51:27 +01:00
Bruno Binet
e0e1b3eecf rename STATIC_PAGES to TEMPLATE_PAGES 2012-10-30 09:56:10 +01:00
Tarek Ziade
7127676f71 added a static pages generator
Conflicts:
	pelican/__init__.py
	pelican/generators.py
	pelican/settings.py
2012-10-30 09:56:08 +01:00
Martin Brochhaus
47c972e21a Added USE_FOLDER_AS_CATEGORY setting.
This allows users to organize their files in ways where the subfolder name
would not make a good category name (i.e. /2012/09/). Set this to ``False``
and the subfolder will no longer be used as a standard category,
`DEFAULT_CATEGORY` will be used instead.
2012-10-28 20:43:45 +01:00
jawher
a11726783e TRANSLATION_FEED is now split into TRANSLATION_FEED_ATOM and TRANSLATION_FEED_RSS to match the other feed configuration keys
Incidentally, Pelican can now generate RSS translation feeds.
2012-10-22 22:52:06 +02:00
Bruno Binet
4029f2ec82 refactoring so that command line options override settings
and Pelican class now accepts a single parameter ``settings``
2012-10-16 01:35:39 +02:00
Bruno Binet
136e2e46d8 remove useless default_settings param in configure_settings 2012-10-15 22:49:24 +02:00
Alexis Métaireau
17dc36aad6 merge upstream 2012-10-12 23:22:55 +02:00
Alexis Metaireau
48625964f1 Merge pull request #510 from nrocco/sourcegen
New source file .text generator
2012-10-12 13:57:18 -07:00
Stéphane Bunel
ee46becaf9 FIX: Standardizing "extentions" to "extensions" 2012-10-03 22:29:59 +02:00
Nico Di Rocco
c53a06a5d5 Simplified configuration option to be more flexible
As @ametaireau suggested: instead of having logic that prepends the
OUTPUT_SOURCES_EXTENSION with a '.' we allow the user more
flexibility to control the extension that can be used.
2012-10-03 22:06:45 +02:00
Stéphane Bunel
45c836fdf5 Update docs and tests for MARKDOWN_EXTENTIONS 2012-09-28 23:09:57 +02:00
Nico Di Rocco
a7dd21ffaf Added a new setting OUTPUT_SOURCES_EXTENSION
Using this configurable setting users can control what extension will be
appended to filenames by the SourcesGenerator.

The default is to use the ``.text`` extension.
2012-09-28 14:59:05 +02:00
stephane
4f5253bcb3 Add MARKDOWN_EXTENTIONS configuration parameter to enable Markdown extentions of your choice.
Ex: MARKDOWN_EXTENTIONS = [ 'toc', ] enable TOC markup to generate Table of Contents.
2012-09-27 19:49:42 +02:00
Nico Di Rocco
0a1a868b37 Added sourcefile generator that generates .text files 2012-09-15 23:11:09 +02:00
Rachid Belaid
c462237b9d Add new setting EXTRA_TEMPLATES_PATHS
This setting allow to use template which are not in the theme.
Should help to build more generic themes around the content.
2012-09-03 00:57:23 +01:00
tBunnyMan
644fd4ed5f Deep copy _DEFAULT_SETTINGS instead of linking.
This caused the defaults to be overwritten and edge case bugs with tests.
The test for empty setting needed to be updated to reflect that the method
for setting up the local settings sets extra settings.
2012-08-29 13:36:15 -07:00
Julian Berman
7cb18a088e Reimplement settings loading to preserve __file__ 2012-08-01 13:36:47 -04:00
Alexis Metaireau
8007c20c79 Merge pull request #418 from tbunnyman/WarnOnFeedGeneration#383
Update: De-appreciate FEED for FEED_RSS & FEED_ATOM
2012-07-20 03:53:18 -07:00
tBunnyMan
fe91caf325 Changed wording of the setting to NEWEST_FIRST_ARCHIVES
Also updated documentation and tested to make sure behavior matches expected wording
2012-07-18 11:18:48 -07:00
tBunnyMan
5f958ae84d Refactor atom feed names for clarity
FEED -> FEED_ATOM
TAG_FEED -> TAG_FEED_ATOM
CATEGORY_FEED -> CATEGORY_FEED_ATOM
2012-07-16 09:35:05 -07:00
tBunnyMan
79e480a894 Change default REVERSE_ARCHIVE_ORDER to true
Updated documentation and updated tests to reflect correct default order
Fixes #304
2012-07-14 17:53:10 -07:00
tBunnyMan
d9817f9a96 Test for FEED & FEED_RSS before generation.
Then we bypass all feed generation of both are set to None or throw a warning if SITEURL is unset.
Updated all documentation, to make sure the usage and warning is clear.
2012-07-14 17:05:04 -07:00
Bruno Binet
fe9388a7a4 Merge remote-tracking branch 'origin/master' into fix-functional-tests
Conflicts:
	tests/support.py
2012-07-05 01:22:31 +02:00