ametaireau/pelican — pull request #414 by traeblain (2012-07-10 21:41:43+00:00)
Title: Fix for page_name usage to follow AUTHOR_URL, TAG_URL, and CATEGORY_URL definition.

First, it includes documentation changes as outlined in #387.

Now. This fixes issue #385.

Behavior:
Following @justinmayer 's flow the current master results are:

```html
»
```
My page_name-fix branch results:
```html
»
```
So I claim this fixes a bug in the current master in which `Alexis Métaireau2.html` doesn't exist and therefore yields a 404. `alexis-metaireau2.html` is actually what the link should point to.

Now if you add different item page_name yields everything before the {slug}:
```
When:
CATEGORY_URL = 'cat/{slug}.html'
Results:
»
```
So what this did is take the .html (or if anything else like: .htm | .asp | / | /?q=funnyquery) off the end. So just like before, it requires the pagination.html template to re-add the .html. Just like what is currently required in the Master. Therefore the change doesn't break any current pagination template (to my knowledge), except fix the Author "bug" I previously explained.

So I think this gives you the same logic and behavior as what is currently implied in the Master branch, but honors the URL that the settings file may change.

Finally, looking through this I also changed the documentation's settings.rst. I found that in settings.py the default used `{slug}` for all the _URL items, yet the documentation says you should use `{name}`. I felt this was inconsistent and should all follow the same convention. They should follow the `{slug}` as that's what is used everywhere else and still easy to understand. This could cause some heartache for people that are currently using `{name}` and upgrading as there might be some odd behavior.

I will close #387 as it's included here.