-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the archives, tags and categories didn't display on a nginx server #276
Comments
@josephzjw You will have to provide source code of your blog along with the configuration file so that we can test and try to reproduce the issue at our end. But first, we had a similar issue sometime ago. Please go through it and see if it helps. |
It works when I followed the instructions you provided #250 Thanks! |
@josephzjw hmm, can you please write here what worked for you. We may need to add it to documentation. |
I followed the solution of azzamsa, add the three line codes below at the pelicanconf.py
Then I use |
Thank you @josephzjw We will look into it in detail. According to my understanding Elegant should have worked out of the box. We will either fix our code or update our documentation. |
I can confirm this issue. The reason it happens is because the nav bar is rendered with links pointing to e.g. To fix this, I just added an explicit <li {% if page_name == 'categories' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ CATEGORIES_URL|default('categories.html') }}">Categories</a></li>
<li {% if page_name == 'tags' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ TAGS_URL|default('tags.html') }}">Tags</a></li>
<li {% if page_name == 'archives' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ ARCHIVES_URL|default('archives.html') }}">Archives</a></li> You should be able to do the same in a commit and get it working on nginx without interfering with functionality on other servers, I believe. Edit: I went ahead and made a pull request. Hope it's useful! :) Edit 2: looks like although my pull request fixes the problem with the menu buttons, there are still broken links elsewhere. For instance |
This issue doesn't affect just Nginx and josephzjw's fix, above, shouldn't be needed because the templates give the wrong default values. alxpettit's fix does work but more files need to be changed than just To generate the issue: Try If you look at the source code, you see code like this:
The problem is in the This Diff is how I fixed the problem in the template code of the Elegant theme. |
Thank you @andrewdstrain. I will look into it in detail and get back to you. |
… some servers In the first version of the theme, we had hard coded ".html" to URLs like "tags.html". Later it was made configurable via ARCHIVES_URL, CATEGORIES_URL, and TAGS_URL. But the default values of these variables were incorrectly set to "tags", "categories" and "archives". This broke on several servers that didn't append ".html" to URLs automatically. With this patch, the default value of these variables is "*.html". This theme should work out of the box on all servers. BREAKING CHANGE: To enable clean URLs for tags, categories and archives, first configure your server to support clean URLs. Then set `TAGS_URL`, `CATEGORIES_URL` and `ARCHIVES_URL` to `"tags"`, `"categories"` and `"archives"` respectively. fix #280 fix #276
I have fixed this issue in here It's available on the next branch. It will release to master in couple of days. @andrewdstrain I am specially thankful to you for explaining the issue in detail. If you greatly appreciate if you can manage sometime to review my fix. This is the commit which fixes the issue 3c7df6a |
@all-contributors please add @josephzjw for bug |
I've put up a pull request to add @josephzjw! 🎉 |
# [4.0.0](V3.2.0...V4.0.0) (2019-08-22) ### Bug Fixes * **admonition:** an artifact in border behind the title ([88113c3](88113c3)) * **admonition:** reduce border radius to match radii of other components ([de08d20](de08d20)), closes [#490](#490) * **admonition:** remove box shadow ([d059db8](d059db8)), closes [#490](#490) * **admonition:** remove text-shadow from heading ([1c889da](1c889da)), closes [#490](#490) * **clean URL:** default URL of categories, tags and archives fails on some servers ([3c7df6a](3c7df6a)), closes [#280](#280) [#276](#276) * **comments:** W3C validation errors ([76a1f26](76a1f26)) * **disqus:** remove SITEURL condition to show Disqus comments section ([753d5a5](753d5a5)) * **lang:** do not override default value of DEFAULT_LANG set by Pelican ([d6c60c2](d6c60c2)) * **social:** reduce icon sizes in the sidebar ([c769ba3](c769ba3)) * **social:** use nofollow for social links in the sidebar ([50cff87](50cff87)) * **social:** W3C validation error ([ec4521e](ec4521e)) * **table:** reduce border radius to match radii of other components ([7eaaa96](7eaaa96)) * **w3c validation:** remove incorrect usage of article tag ([e8231e0](e8231e0)), closes [#251](#251) * **w3c validation:** remove obsolete charset attribute ([8deb285](8deb285)), closes [#251](#251) * **w3c validation:** remove redundant article tag ([d07c27e](d07c27e)), closes [#251](#251) * **w3c validation:** remove redundant sections without heading ([df9221f](df9221f)), closes [#251](#251) * **w3c validation:** remove type and language attributes ([b700224](b700224)), closes [#251](#251) * **w3c validation:** update CSS rules ([0b78d46](0b78d46)), closes [#251](#251) ### Features * **404:** auto fill search box with URL fragment that was not found ([c0a7f47](c0a7f47)) * **admonition:** add box shadow ([246f826](246f826)) * **admonition:** border color should match the title color ([1adadbe](1adadbe)) * **admonition:** increase contrast of title ([7fb82cc](7fb82cc)) * **admonition:** use svg image instead of font-awesome icon ([e7c4029](e7c4029)), closes [#487](#487) * **clean url:** support clean URL for search page ([088791e](088791e)) * **comments:** add support for utterances comment system ([a2151cc](a2151cc)), closes [#288](#288) * **quotes:** improve style and remove font-awesome for quote icon ([9ef3ac8](9ef3ac8)), closes [#487](#487) * **social:** add icons for 7 more websites ([8dcf8fa](8dcf8fa)), closes [#494](#494) * **social:** use svg icons instead of font-awesome ([19f458b](19f458b)) * **table:** add style rule to make tables pop out ([6a8500b](6a8500b)), closes [#440](#440) ### Performance Improvements * **admonition:** add attributes to svg iamges ([a740a60](a740a60)) * **requests:** remove font awesome ([7c20145](7c20145)), closes [#487](#487) ### BREAKING CHANGES * **requests:** We have removed font awesome. Now we use svg images for all icons. This will result in one less web request, which in turn will improve your websites performance. * **social:** Style customization and configuration of social icons in the sidebar has changed. New icons have better colors and bigger sizes. * **clean URL:** To enable clean URLs for tags, categories and archives, first configure your server to support clean URLs. Then set `TAGS_URL`, `CATEGORIES_URL` and `ARCHIVES_URL` to `"tags"`, `"categories"` and `"archives"` respectively.
🎉 This issue has been resolved in version 4.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
When I use
pelican -l
in the localhost everything is okay, but when I publish the output to the nginx server it shows 404 not found error. Other pages are correct. I found that all the archives, tags and categories are directories in the output file. Their names are archive, tag and category. Is it mismatched with the name that cause the problem?When I switch to another theme with tag and archive available, everything is okay... So I guess the problem is not my configuration of nginx server...
The text was updated successfully, but these errors were encountered: