1
0
Fork 0
forked from github/pelican
Commit graph

77 commits

Author SHA1 Message Date
Justin Mayer
30c2490f88 Merge pull request #862 from avaris/emacs-autoreload
ignore emacs lock files and exception handling for watchers
2013-04-22 20:04:24 -07:00
Deniz Turgut
be8837963a ignore emacs lock files and exception handling for watchers 2013-04-22 20:50:11 -04:00
Deniz Turgut
2790446906 adds a 'strftime' jinja fiter that uses LOCALE 2013-04-21 18:00:12 -04:00
Deniz Turgut
e86f4eedcf bugfix and tests for no settings path (no -s option) 2013-04-19 23:35:09 -04:00
Deniz Turgut
5ccbbcc7d1 add feedback to user and refactor 'autoreload' code 2013-04-19 13:35:20 -04:00
Rogdham
3aea29fb2b Fix bug with MacOS in utils.strftime
Force using C89 directives (i.e. mentioned in the Python documentation).
2013-04-17 21:24:45 +01:00
Deniz Turgut
48f7132ba8 refactored utils.strftime 2013-04-16 20:53:27 -04:00
Deniz Turgut
bc4bd773a0 remove unittest2 and fix various warnings in py3 2013-04-13 16:36:05 -04:00
unknown
8e254e8cd7 Fixed path_to_url when os.sep is not '/'. 2013-04-12 15:44:53 +08:00
Rogdham
eb640b09e6 Add translation metadata support.
Allows user to control which posts are the translations independently of the
DEFAULT_LANG setting.
2013-04-06 18:36:37 +01:00
Irfan Ahmad
385a18563c Fixes #630 2013-03-23 20:16:31 -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
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
33c60a78cd pelican/utils: Add split_all() and rework static URL generation
I think the conversion from native paths to URLs is best put off until
we are actually trying to generate the URL.  The old handling
(introduced in 2692586, Fixes #645 - Making cross-content linking
windows compatible, 2012-12-19) converted the path at StaticContent
initialization, which left you with a bogus StaticContent.src.

Once we drop the 'static' subdirectory, we will be able to drop the
`dest` and `url` parts from the StaticGenerator.generate_context()
handling, which will leave things looking a good deal cleaner than
they do now.
2013-03-10 23:21:38 -07:00
Alexis Métaireau
14cf5f014c Some doc + various enhancements 2013-03-10 22:57:08 -07:00
Joseph Reagle
92e9f3b313 bom detection and removal 2013-03-03 22:33:16 -08:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08:00
dave mankoff
21ad904abc format exceptions as strings 2013-02-10 20:21:28 -05:00
dave mankoff
5737534302 fix string formatting errors 2013-02-10 20:17:06 -05:00
dave mankoff
bc2bc7a330 git merge upstream/master 2013-01-28 21:41:42 -05:00
Rıdvan Örsvuran
0288bf1f68 added IGNORE_FILES setting for autoreload 2013-01-23 01:02:46 +01:00
Bruno Binet
6233f5a409 Merge pull request #667 from wking/page-path
Consolidate Path.filename and and StaticContent.filepath as `source_path`.
2013-01-18 07:30:03 -08:00
W. Trevor King
ec50e18a3e utils: Add deprecated_attribute decorator 2013-01-18 08:48:21 -05:00
W. Trevor King
c3c3037a1d utils: Teach mkdir_p to fail if the existing target isn't a directory
Existing symlinks to directories will still pass, because isdir()
follows symbolic links.
2013-01-18 08:32:55 -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
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
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
Simon
088c810b00 Change the way to compute relative paths to avoid the leading .././ when using
relative urls.
2012-11-29 21:50:46 +01:00
Bruno Binet
324c7c3674 Merge branch 'bstpierre-files-to-copy-missing-dir' 2012-10-25 14:25:03 +02:00
Bruno Binet
b6cc6bd2d4 remove useless try/except clause
exception will be caught and logged later in Pelican stack
2012-10-25 14:24:17 +02:00
Brendan Wholihan
bc0f7ae4f6 Amended utils copy so that a warning is produced if a source file is not found in FILES_TO_COPY whilst copying. eg if there is a typo in the file name, or the file is moved. 2012-10-20 16:35:24 +01:00
Brian St. Pierre
01293dedaa Fix #530: FILES_TO_COPY error when dest dir missing
If the destination directory specified by FILES_TO_COPY does not
exist, site generation crashes with a CRITICAL error. This creates the
destination if it does not exist.
2012-10-02 19:17:43 -04:00
Brian St. Pierre
15875b8bd1 Fix DELETE_OUTPUT_DIRECTORY crash when no output dir 2012-10-02 08:51:31 -04:00
Wladislaw Merezhko
0c2625e59d Change name of utils.open function to pelican_open and refactor this change across project. 2012-09-08 13:07:51 +03:00
tBunnyMan
a37ba369ef Implemented better "valid files not found" behavior.
Used an exception so show error state.
Used a bool flag to make sure the error is only shown once PER error.
Updated tests to check for the correct Exception raised
2012-08-23 12:44:22 -07:00
tBunnyMan
86da6d1f2e Check for value error caused by no valid files found with files_changed
This causes an infinite loop when in auto-reload
Fix #467
Fix #451
Fix #443
2012-08-23 11:05:07 -07:00
Leonard Huang
6f40e452e1 Add unidecode for translating slugs in asian languages 2012-07-16 11:36:20 +08:00
dave mankoff
3c30425276 Merge branch 'master' of git://github.com/ametaireau/pelican 2012-07-09 22:15:04 -04:00
tBunnyMan
4427424db3 Changed debugging reporting to post file deletion instead of pre file deletion per request. 2012-07-04 15:20:15 -07:00
tBunnyMan
d589450200 Change behavior of DELETE_OUTPUT_DIRECTORY to purge contents of the directory, not the directory itself.
Added Debug level logging for each deletion
Added error level logging when a delete has an exception
Built a test case for clean_output_directory in tests.utils.py
Updated `settings` in documentation to reflect new behavior
Removed the tip from the bottom of getting started since this setting should no longer break web servers pointing to the output directory.
2012-07-04 12:32:20 -07:00
dave mankoff
caa4442abb re-import cgi. properly turn utils.open into a context manager 2012-06-20 19:59:32 -04:00
Alexis Metaireau
ed8b8bc27e Also reload when the settings file changes.
Fix for #360
2012-06-10 00:24:26 +02:00
Simon
4a0d4461e1 Apply typogrify on the title.
As it is done when reading the file, we need to remove html tags for the
permalink and the slug (this is done here for the notmyidea and simple themes).

While modifying the themes I also replaced the `pagename` template tag with
`article.url` (`pagename` was an empty variable, no more used ?).
2012-05-07 12:26:17 +02:00
Alexis Metaireau
ebe5c0b2bf Enhance warnings. Fix #196 2012-04-01 13:37:35 +02: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
Simon
39bdbcfd86 files_changed: cleanup and add a test 2012-03-14 12:36:55 +01:00
draftcode
2827a6df47 Fixed some typos. 2012-03-12 01:22:54 +09:00
Alexis Metaireau
c393b011c4 cleaning 2012-03-11 15:50:53 +01: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