ametaireau/pelican — pull request #341 by m-r-r (2012-05-12 10:09:26+00:00)
Title: Trailing slashes removed to avoid category bug

Hello,

There was a bug with the category names:
When there was articles in the `ARTICLE_DIR`, those article wasn't put in the `DEFAULT_CATEGORY` but in a category whose the name was the `dirname()` of the `ARTICLE_DIR`.

For example , `content/foo/bar.md` was in the `foo` category but `content/bar.md` was in the `content` category instead of the `DEFAULT_CATEGORY` ...

The reason was at [`pelican/generators.py`, line 264](https://github.com/m-r-r/pelican/blob/trailing-slashes/pelican/generators.py#L264):
The test was always false, because there was trailing slashes in the `self.settings['ARTICLE_DIR']` variable…
I used `os.path.normpath` to remove the slashes and added a comment to avoid someone remove `normpath` by error, so now it shoud works :-)