getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.48k stars 1.81k forks source link

customized tag url fails pagination in tag page #486

Closed CNBorn closed 12 years ago

CNBorn commented 12 years ago

I have such settings in pelican config:

TAG_URL = 'tag/{name}/' TAG_SAVE_AS = 'tag/{name}/index.html'

which will make my tag page like this:

/blog/tag/tag_name/

but when i do pagination, the link lead to

/blog/tag/tag_name2.html

which lead to a 404.

CNBorn commented 12 years ago

I solved the problem I was encountering by modified templates/pagination.html.

there are the procedures that you can reproduce the problem.

My URL settings is the following

ARTICLE_URL = '{date:%Y}/{date:%m}/{slug}/' ARTICLE_SAVE_AS = '{date:%Y}/{date:%m}/{slug}/index.html' TAG_URL = 'tag/{name}/' TAG_SAVE_AS = 'tag/{name}/index.html' PAGE_URL = 'pages/{slug}/' PAGE_SAVE_AS = 'pages/{slug}/index.html' CATEGORY_URL = 'category/{name}/' CATEGORY_SAVE_AS = 'category/{name}/index.html' AUTHOR_SAVE_AS = False

hence I could make my blog's url like

http://cnborn.net/blog/2012/08/buddhism-101/

instead of (the default setting)

http://cnborn.net/blog/buddhism-101.html

the index pagination url becomes:

http://cnborn.net/blog/

http://cnborn.net/blog/index2.html

the tag pagination url becomes:

http://cnborn.net/blog/tag/cambodia/

http://cnborn.net/blog/tag/cambodia/index2.html

but the template I'm using currently don't support my tag pagination well. It always look for /tag/cambodia2/

I have to modify templates/pagination.html accordingly to fit my url settings. here is how I've done.

My question is, when we are changing the URL settings as we want, we DO have to change the template/pagination in order to get our pagination works in our customized way, is it a little bit annoying?

CNBorn commented 12 years ago

This problem is somehow duplicate of page_name in Tag and Category pages does not honor TAG_URL/CATEGORY_URL setting and Fix for page_name usage to follow AUTHOR_URL, TAG_URL, and CATEGORY_URL definition.