Closed tshepang closed 5 years ago
@tshepang that's because there is no other way to link to those pages. If you see the URL settings of Pelican you will notice you can customize the URL of article, tag or category page. But you cannot customize URL of categories and tags page.
That's why for article, you can use article.url
or for tag tag.url
.
But there is no variable tags.url
for tags.html page. This is why I have to hardcode it.
Hope it explains the reason.
This issue must be reported on Pelican?
Well it is not a bug.
It can be requested as an enhancement "Let users customize URL of archives, categories and tags pages".
I don't fully understand the issue, but have created a workaround for now: https://bitbucket.org/tshepang/patches/src/7e7dc47c/elegant.diff.
Thanks @tshepang for sharing your solution. That's a good solution.
Question is how do we know what user wants. Take article URL as an example. User can configure it in the pelican-conf
ARTICLE_URL = u'{slug}'
Articles URL will not have .html
in the end.
But user can also configure it to
ARTICLE_URL = u'{slug}.html'
The article URL will have .html
in the end. So you can configure the article URL from pelicanconf.py
.
Is there a way to configure Categories, Tags and Archives URL? No there isn't. So if we remove .html
like you did, it will not work for those users who want their URLs to end with an .html
.
Let me know what you think about it? Also feel free to ask if any point is unclear.
I am aware mine is an ugly work-around, that's why I'm not proposing that you include it.
BTW, I see that there's a TAGS_URL, TAGS_SAVE_AS and ARCHIVES_SAVE_AS settings. Wouldn't they help?
@tshepang excellent find.
I need to ask Pelican team why we don't have CATEGORIES_URL
, CATEGORIES_SAVE_AS
, and ARCHIVES_URL
. Something is amiss. I think we will be able to make a better decision after their clarification.
Thanks man!
koolnes
Yes, I've been following the discussion there.
Looks like this was already fixed in Pelican, only not documented?
this went stale, so closing
Is this still the case? updates are from some years ago, but still I do see hardcoded archives, tags and categories while my pelican setup does use /tags/ vs /tags.html and likelywise for the others
If this still happens, we should address it IMHO.
On my website, it does seem to still be the case, so re-opening.
I was trying to find a new theme that is responsive for mobile devices and doing initial 'simple' checks found this :/
@iranzo We have just expanded Elegant from a single maintainer to a community-driven projects and are currently picking up the pace again, so it’s a great time to get involved (see #173 for more).
I can’t promise we’ll be able to tick all your checkboxes, but if you see anything missing (or better yet, have a proposal/pull request), please do file an issue.
I saw it, but I'm not an expert in pelican (nor to talk about elegant), and so far just did some small patch some years ago for blue-penguin theme I'm currently using at my site.
Please do assign this to me as I think I can do it
I’m not even a coder and fixing stuff in Elegant (or any other Jinja-based theme) is very doable. So I’m sure you’ll rock it! :metal:
Hmmm, odd, it doesn’t seem like I can assign it to you, @iranzo. Can you try to assign it to yourself?
I’m not even a coder and fixing stuff in Elegant (or any other Jinja-based theme) is very doable. So I’m sure you’ll rock it!
Hmmm, odd, it doesn’t seem like I can assign it to you, @iranzo. Can you try to assign it to yourself?
Probably as I'm not member of the project staff you can't do that (I had a similar issue with a project I own)
That makes sense. I don’t have a lot of experience with admining a project that has several outside contributors.
I’ll assign myself then, so it’s my fault if this doesn’t push forward.
The way I understand it, as soon as your pull request gets merged, you should be able to be assigned issues as well.
@silverhook check https://iranzo.github.io/ and try the tags, categories, archives
I did submitted the PR, so it should be someone else to validate and merge :-)
I saw this in
templates/base.html
.