1
0
Fork 0
forked from github/pelican
Commit graph

1,734 commits

Author SHA1 Message Date
W. Trevor King
9b574361c9 doc: convert Markdown example to source_path and modernize 2013-01-18 07:57:53 -05: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
W. Trevor King
61f05672e6 content: Convert StaticContent.filepath to .filename
For reasons that are unclear to me, StaticContent introduces the
`filepath` attribute rather than using the existing (and semantically
equivalent) Page.filename.  This has caused confusion before [1], and
it's probably a good idea to merge the two.

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

[1]: https://github.com/getpelican/pelican/issues/162#issuecomment-3000363
2013-01-18 07:40:42 -05:00
Bruno Binet
08a5ea6fdf Merge pull request #663 from wking/url-format-metadata
contents: Page.url_format should expose all metadata
2013-01-18 03:20:10 -08:00
W. Trevor King
d2a221c899 contents: Encode Unicode locales for Python 2 in Page.__init__
Python 2.7 chokes on Unicode locales:

  $ python2.7
  >>> import locale
  >>> locale.setlocale(locale.LC_ALL, u'ja_JP.utf8')
  Traceback (most recent call last):
    ...
  ValueError: too many values to unpack

With the addition of:

  from __future__ import unicode_literals

to tests/test_contents.py in:

  commit bebb94c15b
  Author: W. Trevor King <wking@tremily.us>
  Date:   Tue Jan 15 22:50:58 2013 -0500

    test_contents.py: Add URLWrapper comparison tests

the locale strings in TestPage.test_datetime are interpreted as
Unicode.  Rather than fixing the encoding there, this patch updates
Page to handle Unicode locales automatically.
2013-01-17 09:49:03 -05:00
W. Trevor King
733ab8ae6c test_contents: Add tests for metadata export from Page.url_format 2013-01-15 23:08:32 -05:00
W. Trevor King
bebb94c15b test_contents.py: Add URLWrapper comparison tests
The name switch between wrapper_a and wrapper_b ensures that we're not
secretly comparing some other field (e.g. id(object)).
2013-01-15 22:52:02 -05:00
W. Trevor King
656b5150ff docs/themes.rst: Document URLWrapper sorting for use in Jinja templates 2013-01-15 22:52:01 -05:00
W. Trevor King
2c434ebac1 contents: Add rich comparisons to URLWrapper for easy sorting
There have been earlier attempts to sort categories and authors
[1,2,3], but they either sorted based on the object id [3], or only
sorted the main author and categories list.

This patch uses rich comparisons (keyed off URLWrapper.name, but
easily adjustable in subclasses) to make the objects sortable without
specifying a key for each sort.  For example, now

  {% for tag, articles in tags|sort %}

works as expected in a Jinja template.

The functools.total_ordering decorator fills in the missing rich
comparisons [4,5].

[1]: 877d454c8f
[2]: 7f36e0ed20
[3]: d0ec18f4db
[4]: http://docs.python.org/2/library/functools.html#functools.total_ordering
[5]: http://docs.python.org/3/library/functools.html#functools.total_ordering
2013-01-15 22:51:53 -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
Alexis Métaireau
476f2980ce Damn, I forgot to update travis. 2013-01-15 14:23:00 +01:00
Alexis Métaireau
2f7479374b Merge branch 'master' of github.com:getpelican/pelican 2013-01-15 12:33:50 +01:00
Alexis Métaireau
e11d8aedff Merge branch 'master' into py3k 2013-01-11 21:24:47 +01:00
Alexis Métaireau
d7caaded3f Use the en-us locale for functional tests 2013-01-11 21:24:04 +01:00
Alexis Métaireau
149ca493e0 Annotate py3k code when needed. 2013-01-11 18:55:04 +01:00
Alexis Métaireau
4ac094966e remove py2.6 support 2013-01-11 18:47:22 +01:00
Alexis Métaireau
1197e09626 Revert previously erased changes 2013-01-11 18:46:16 +01:00
Bruno Binet
e5be4b7e40 Merge pull request #658 from elemoine/github
Improve Publishing to GitHub doc section
2013-01-11 07:12:34 -08:00
Dirk Makowski
d1b238638c Update the "how to contribute" docs with py3k info. 2013-01-11 03:21:06 +01: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
Alexis Metaireau
9847394e12 Merge pull request #674 from peterdesmet/patch-2
Fixed a typo
2013-01-07 02:53:09 -08:00
Peter Desmet
696caac9b0 Fixed a typo
BeatifulSoup -> Beautiful Soup
2013-01-07 10:49:51 +01:00
W. Trevor King
88b5a27ddf contents: Page.url_format should expose all metadata
I want to add `directory` metadata to each page in `content/pages/` to
place my non-article pages by hand:

  PAGE_URL = '{directory}/{slug}'
  PAGE_SAVE_AS = '{directory}/{slug}/index.html'

To do this, I need the `directory` metadata for formatting the URL.
2013-01-03 18:18:18 -05: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
Trae Blain
a71465217b Update webassets plugin to allow user to pass configuration settings to Webassets through their settings file. Also removed language about DEBUG not compiling CSS since as of at least webassets 0.8 this is no longer an issue. 2013-01-02 16:26:39 -06:00
Alexis Métaireau
be040715f9 remove duplicates 2013-01-02 13:46:55 +01:00
Alexis Métaireau
8cc0da67e1 Fix the THANKS file. 2013-01-02 13:43:38 +01:00
Éric Lemoine
369bb476e9 Improve Publishing to GitHub section of the doc 2013-01-01 01:01:19 +01:00
Kyle Fuller
c73dba7a7a Merge pull request #655 from wraithan/master
tiny bit of code clean up
2012-12-29 10:07:16 -08:00
Wraithan (Chris McDonald)
fcc74be267 pep8/style matching 2012-12-29 10:03:28 -08:00
Thanos Lefteris
a0b29d980f PyPI links for pelican depedencies 2012-12-25 23:59:53 +02:00
Thanos Lefteris
30c8825fa2 Docs update of the pelican core install depedencies 2012-12-25 23:36:44 +02:00
Alexis Métaireau
02f984f7ef update the version of jinja needed, 2.6 is out 2012-12-18 12:34:05 +01:00
Alexis Metaireau
d879218c27 Merge pull request #620 from rskvazh/patch-1
Update docs/plugins.rst
2012-12-18 01:15:50 -08:00
Alexis Metaireau
92c085c28e Merge pull request #635 from michaelreneer/markdown-summary-metadata
Updated markdown reader to parse summary metadata as markup.
2012-12-11 05:07:30 -08:00
Alexis Metaireau
98c8db568b Merge pull request #577 from davidjb/import-improvements-slug
Provide slug storage option for posts during Pelican import
2012-12-11 03:52:12 -08:00
David Beitey
b4c5d7cf62 Store slugs in posts by default on Pelican import 2012-12-11 21:44:40 +10:00
Michael Reneer
b35947f7a6 Cleaned up markdown read. 2012-12-11 00:48:47 -05:00
Michael Reneer
f66c16bd52 Updated unit tests to test markdown summary metadata. 2012-12-11 00:37:06 -05:00
Michael Reneer
733e41a6a7 Updated markdown reader to parse summary metadata as markup. 2012-12-11 00:34:15 -05:00
Bruno Binet
f79c844855 remote duplicated import statement (thanks @traeblain) 2012-12-09 08:30:17 +01:00
Bruno Binet
e8043594f7 Merge pull request #627 from traeblain/docs-update
Documentation doesn't clearly outline what is required for each plugin in the settings
2012-12-07 12:57:13 -08:00
Trae Blain
b0ff693839 Updated plugins documentation to include actual callable names of each plugin included. 2012-12-07 14:40:44 -06:00
Bruno Binet
802c9d1111 add docs for save_as/url override from metadata feature 2012-12-07 01:02:44 +01:00
Bruno Binet
00c7451200 add functional test for save_as/url override
and update functional tests output
2012-12-07 00:14:02 +01:00
Bruno Binet
a5772bf3d6 allow override page url and save_as values directly from the metadata
this is similar to the template override implemented in #404
2012-12-07 00:10:39 +01:00
Roman Skvazh
694f318614 Update docs/plugins.rst
Change yuicompressor to yui_js and yui_css
2012-12-06 21:15:25 +04:00
Bruno Binet
9f66333d77 fix rst issue 2012-12-04 02:08:13 +01:00
Alexis Métaireau
625afa0621 add the changelog to the text on PyPI 2012-12-04 01:53:52 +01:00
Alexis Métaireau
f92c0cb69d update the version scheme to support micro versions 2012-12-04 01:43:19 +01:00