ametaireau/pelican — pull request #283 by draftcode (2012-03-24 06:27:04+00:00)
Title: DEFAULT_CATEGORY is ignored.

When you specified ARTICLE_DIR in your settings, DEFAULT_CATEGORY is ignored and ARTICLE_DIR's direcotry name is used instead. For example, let us assume we have the following files:

./conf.py
./articles/some_article.rst
./articles/MyCategory/another_article.rst

and the settings:

PATH = "."
ARTICLE_DIR = "articles"
DEFAULT_CATEGORY = "Misc"

In this situation, the category of `some_article.rst` should be `Misc` and the category of `another_article.rst` should be `MyCategory` (unless otherwise specified in these files). But when we run pelican, `some_article.rst` is filed under the category `articles`. This is because `ArticlesGenerator.generate_context` use `DEFALT_CATEGORY` if the article file is placed right under the `PATH` directory, not `ARTICLE_DIR`.

I changed `generate_context` to use `ARTICLE_DIR` rather than `PATH`, and wrote a test related to articles' categories.