Skip to content
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

Nginx 404 fix #280

Closed
wants to merge 3 commits into from
Closed

Conversation

crabdancing
Copy link

Fix for #276.

Copy link
Member

@iranzo iranzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iranzo iranzo requested a review from talha131 April 12, 2019 14:00
@talha131 talha131 force-pushed the next branch 5 times, most recently from 404d27b to caf8ef5 Compare June 23, 2019 15:36
@talha131 talha131 closed this Jun 30, 2019
@talha131 talha131 added this to the 2019 - Q3 milestone Jun 30, 2019
@talha131 talha131 reopened this Jun 30, 2019
@silverhook
Copy link
Member

AFAIR, whether the tags, categories and archives have an .html extension or not in their URL is a user setting in Pelican.

http://docs.getpelican.com/en/stable/settings.html#url-settings

As long as this fix does not break some other use case, it LGTM as well.

@talha131
Copy link
Member

talha131 commented Jul 1, 2019

I will merge it manually. Nonetheless, question is why we need this patch or the one earlier merged a585719?

whether the tags, categories and archives have an .html extension or not in their URL is a user setting in Pelican.

If it's a user setting then we don't need a585719 either.

@talha131 talha131 self-assigned this Jul 1, 2019
@astraindev
Copy link

astraindev commented Jul 24, 2019

I will merge it manually. Nonetheless, question is why we need this patch or the one earlier merged a585719?

whether the tags, categories and archives have an .html extension or not in their URL is a user setting in Pelican.

If it's a user setting then we don't need a585719 either.

By default, Pelican adds .html when generating the files. And the Elegant source code does not follow this default. Just try a pelican-quickstart and see. Clearly, you can see the tags.html, categories.html, and archives.html in the output folder - with or without Elegant as a theme. Now look at the Elegant source code and note the default('tags'), `default('archives'), 'default('categories') in the code (in master and next branch). The two do not match at all. That is, to get rid of the default .html extension, like coded in Elegant, the user has to change the default pelicanconf.py file.

It may be a user setting but the source code of Elegant should follow the actual Pelican default for when the setting is not in use in the pelicanconf.py file. The Nginx, twisted, Apache 404 error will no longer occur. And, remember, the only reason it does not occur with pelican -l is that the webserver adds a .html when the URL is not found.

(venv) geek@andy:~/src/GeekingOutWith$ pelican -l
WARNING: Unable to find `/someurl` or variations:
  | /someurl.html
  | /someurl/index.html
  | /someurl/
  | /someurl

If it did not do this type of behavior, this 404 error would have popped up from the very beginning.

Having said that, I do agree that you do not need the a585719. The way it is coded in the master and next branches is way better, in my opinion.

talha131 added a commit that referenced this pull request Aug 10, 2019
… 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
@talha131
Copy link
Member

@all-contributors please add @alxpettit for code

@allcontributors
Copy link
Contributor

@talha131

I've put up a pull request to add @alxpettit! 🎉

@talha131
Copy link
Member

Close via #480

@talha131 talha131 closed this Aug 10, 2019
@talha131
Copy link
Member

@andrewdstrain great explanation. Very helpful.

@all-contributors please add @andrewdstrain for code and userTesting

@allcontributors
Copy link
Contributor

@talha131

I've put up a pull request to add @andrewdstrain! 🎉

talha131 pushed a commit that referenced this pull request Aug 22, 2019
# [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.
@talha131
Copy link
Member

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants