1
0
Fork 0
forked from github/pelican
Commit graph

52 commits

Author SHA1 Message Date
Justin Mayer
0a8678a8ae Change RELATIVE_URLS default to False - Fixes #829 2013-04-11 16:12:55 -07:00
W. Trevor King
ae4fc5a25e utils: Add path_to_url() and generalize get_relative_path()
The old get_relative_path() implementation assumed os.sep == '/',
which doesn't hold on MS Windows.  The new implementation uses
split_all() for a more general component count.

I added path_to_url(), because the:

  '/'.join(split_all(path))

idiom was showing up in a number of cases, and it's easier to
understand what's going on when that reads:

  path_to_url(path)

This will fix a number of places where I think paths and URLs were
conflated, and should improve MS Windows support.
2013-03-21 12:44:44 -04:00
William Light
e045515b91 add "output_file" Jinja context variable
"output_file" contains the name of the HTML file that pelican is
currently rendering.
2013-03-10 23:53:41 -07:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08: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
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
Bruno Binet
a0504aeabe add support for relative cross-site links 2012-12-01 21:32:02 +01:00
Bruno Binet
c74abe579b Don't rewrite URLs
Remove the code that was appending ../static in front of some URLs, and add a
way to do cross-content linking.
2012-12-01 21:30:50 +01:00
Bruno Binet
c787e02dcc Merge branch 'pr/555'
Conflicts:
	pelican/contents.py
2012-11-13 01:23:31 +01:00
Brendan Wholihan
f7a2f8ea47 Removed AUTHOR defaulting to OS User /John Doe, so both a blank or undefined (None) author is possible.
Reverted templates back to checking author object, since a None object is possible. Name could be checked for blank if required
ATOM spec states an author element should be provided, so passes a blank name if not specified
Updated unit test
2012-10-26 18:20:05 +01:00
Alexis Métaireau
dd299d272b merge win-encoding 2012-10-25 14:47:57 +02:00
Brian St. Pierre
b1f65f6c9f Fix #535: pagination on files without an extension 2012-10-06 22:35:47 -04:00
Guillermo López
77a538e588 always return Unix-like relative paths, even on Windows 2012-09-04 00:29:02 +02:00
Simon
e9996b5cc6 strip tags for feed titles 2012-05-07 13:05:33 +02:00
Alexis Metaireau
58d98e918f Merge pull request #326 from neoascetic/_save_as_behavior
*_SAVE_AS = False fix
2012-04-26 10:39:56 -07:00
Pavel Puchkin
898ac3808f Last fix? 2012-04-20 11:28:00 +11:00
Pavel Puchkin
6116236ed9 *_SAVE_AS = None fix
Ability to disable creating some files when their `_SAVE_AS` setting is
set to none-value. Mostly for disabling creating of `authors` stuff
(when there only one user, see #320 for details)
2012-04-18 18:56:53 +11:00
Justin Mayer
e29b54e5e0 Replace omitted slash in feed URL generation
This slash was originally present, but I removed it at some point
because it was causing double-slashes. I believe the reason is that I
had a leading slash in my article URL pattern, which in retrospect
should not have been there. Omitting the slash caused problems for other
folks; I should have tested this better. This commit puts the slash back
where it belongs.
2012-04-16 09:10:20 -07:00
Justin Mayer
56b8a88b1f Improve uniqueness of feed entry ID
The ID of a feed entry should never change, but the previous method of
generating the ID -- i.e., using the entry URL -- results in an ID that
is not permanent and can change. Switching to the tag URI method from
RFC 4151 should help improve the long-term uniqueness and permanence of
entry IDs, as espoused here:
<http://web.archive.org/web/20110514113830/http://diveintomark.org/archives/2004/05/28/howto-atom-id>

Also added a trailing slash to the site URL inside the feed; the lack
thereof was causing a feed validation warning.
2012-03-31 10:08:16 -07:00
Justin Mayer
34310a61f5 Feed link inside feed should use FEED_DOMAIN
The initial work on enabling feeds to be served from a different domain
than the site domain focused on the feed link displayed inside the
base template. But there is also a feed link inside the generated feed
itself, which this commit updates to use the FEED_DOMAIN value (if
defined).

Also, it turns out that the FEED_MAIN_URL setting is not necessary; the
existing FEED and FEED_RSS functionality is simpler and can address the
targeted use case just as easily. That attribute has been removed from
the settings and template, along with corresponding changes to the docs.
Refs #177.
2012-03-31 08:10:40 -07:00
Andrea Crotti
0922efa371 change the way logging is done, using the standard log tree instead of
calling the module-level functions on an unitialised logging object.

This allows to
- simplify log.py
- use one logger object for each file
2012-03-20 13:01:21 +00:00
Alexis Metaireau
6cde7fd27a PEP8-ify.
Wrap to 80 chars, sanitize imports.
2012-03-09 16:21:38 +01:00
Stéphane Raimbault
9cced6be83 Sort imports and remove trailing whitespaces 2012-02-28 17:40:13 +01:00
Kyle Fuller
2be58aa51a Remove WITH_PAGINATION, only have a DEFAULT_PAGINATION setting
DEFAULT_PAGINATION can be set to False instead of using WITH_PAGINATION
2011-12-22 14:02:31 +00:00
Brian Hsu
b2919e9051 Add unique_id to RSS/ATOM feeds.
Reason:

    Without <guid> tag in RSS XML, some RSS reader will show all
    items in RSS as unread item.
2011-11-29 09:53:48 +08:00
Rémy HUBSCHER
32a6ecbcc5 Fix timezone bug for ATOM generation 2011-08-16 15:11:49 +02:00
Rémy HUBSCHER
acb65b77af GMT Time in ATOM feeds 2011-08-16 11:40:08 +02:00
Borgar
cd277672d0 Add a setting to limit feeds to a max number of items.
This adds FEED_MAX_ITEMS, which dictates the maximum number of items allowed in a feed.
2011-08-02 23:29:34 +00:00
Borgar
a7d5a9a420 Don't rewrite content URLs unless RELATIVE_URLS is True. 2011-06-29 13:42:04 +00:00
Borgar
f2ea886ed2 Rewrote URL reformatter.
This attempts to fix several issues:

1. The regexp that's supposed to catch href's doesn't work at all and even if it did match anything, it has too many parentheses for the following loop.

2. When a relative URL is replaced then it is done globally on the text and not per instance. So this `<a href="/foo/bar">/foo/bar</a>` will incorrectly get reformatted to `<a href="./static/foo/bar">./static/foo/bar</a>`.

3. Query parameter URLs are rewritten but shouldn't: `<a href="?foo=bar">` gets rewritten to `<a href="./static/?foo=bar">`

4. The joiner is producing too many slashes: `"." + "static" + "/files/image.png"` => `./static//files/image.png`.
2011-06-29 13:41:57 +00:00
Alexis Metaireau
1171d24f3f Remove logger infos 2011-05-08 14:53:10 +01:00
Alexis Metaireau
ec5196e5f0 Don't replace dicts with lists when iterating. 2011-05-08 14:33:05 +01:00
Mikhail Korobov
f3a8f45de4 One more python 2.5 fix 2011-05-06 16:56:02 +06:00
Mikhail Korobov
06246557c5 A couple of docstrings are fixed (they were refering obsolete params) 2011-05-06 16:44:12 +06:00
Nicolas Duhamel
4a5f4fe6e4 Fix internal linkref for allow TOC 2011-04-27 11:45:59 +02:00
Skami18
3166e6dfe3 Calls to «print» replaced by the «pelican.log» module. 2011-04-19 14:49:46 +02:00
Alexander Artemenko
f9f6da0a43 Don't add 'static' prefix to urls with schema.
Don't add 'static' prefix to urls like 'mailto:some@example.com' or
'skype:somename'.
2011-03-23 11:15:37 +03:00
Alexander Artemenko
ddcccfeaa9 Switch to 'C' locale during page rendering.
Don't know why, but without it Jinja fails with UnicodeDecode error.
2011-03-23 11:14:25 +03:00
Alexis Metaireau
d8e8bc868f fix pagination 2011-02-27 04:01:10 +00:00
Alexis Metaireau
e9515130e0 Merge branch 'pagination-zebuline' 2011-02-17 19:04:30 +00:00
Alexis Metaireau
b1f6cfb2c9 pagination - fix extension 2011-02-17 19:02:42 +00:00
Alexis Metaireau
e0e4155e89 PEP 8 fixes 2011-02-15 13:48:57 +00:00
Laureline Guerin
d272896adf Pagination - refactoring 2011-02-15 14:36:55 +01:00
Massimo Santini
aba1b39211 Fixed getlocale/setlocale bug accoriding to http://bugs.python.org/issue1699853 and http://hub.esss.com.br/wordpress/blog/archives/8561 2011-02-14 15:40:23 +01:00
Alexis Metaireau
bbd8305310 Set locale to default while writing RSS feeds
to always output RFC822 compatible dates. Fixes #67
2011-02-09 21:17:57 +00:00
Alexis Metaireau
d13e6f14fb Changes about locales and dates.
Add a way to specify the locale in the settings, and the date formating as well.
Fixes #61.
2011-02-01 21:44:50 +00:00
Alexis Metaireau
4d0e18db23 Avoid rewriting protocol related links. 2011-01-24 01:59:09 +00:00
Alexis Metaireau
2f915caff2 branch merge
Conflicts:
	pelican/generators.py
	pelican/settings.py
2011-01-05 18:25:14 +01:00
Alexis Metaireau
2f6300af46 Do not create a general function for "update_object_content". 2011-01-05 14:27:46 +01:00
Arnaud BOS
3ee595f927 Images support and add built files to gitignore 2011-01-05 13:32:54 +01:00