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

Feature Request: 404 page #327

Closed
mavahedinia opened this issue Aug 17, 2016 · 6 comments
Closed

Feature Request: 404 page #327

mavahedinia opened this issue Aug 17, 2016 · 6 comments
Assignees
Milestone

Comments

@mavahedinia
Copy link

for user experience, it's better to have a 404 page designed for blog! It is better to be compiled with hexo, but we can take advantage of .htaccess to define custom 404 page!

@LouisBarranqueiro
Copy link
Owner

Yeah buddy!

@darekkay
Copy link
Contributor

While it would be a nice-to-have, it's quite simple to create a custom 404 page in Hexo, without adjusting the theme. Create 404.md in the source folder, so Hexo generates a corresponding 404.html. Now you can configure your web server to use this page for 404 by default.

That's how it looks like on my page.

@LouisBarranqueiro
Copy link
Owner

yeah, you are right @darekkay. Could you add a section in the user documentation to describe how you did it step by step?

@darekkay
Copy link
Contributor

@LouisBarranqueiro
Sure, however I just noticed it's not as simple as I described it. By default, meta and post actions are rendered as well, which looks weird on a 404 page. So I have added two front matter options to disable those:

title: Whoops!
hideMeta: true
hideActions: true
comments: false     # this one already exists

If this is something you would like to include in your project, I can create a PR ;)

@LouisBarranqueiro LouisBarranqueiro self-assigned this Mar 25, 2017
@LouisBarranqueiro
Copy link
Owner

yes, create the PR, I will review it :)

@darekkay
Copy link
Contributor

Sure thing: #399

LouisBarranqueiro pushed a commit that referenced this issue Apr 2, 2017
* Add front-matter options to hide post meta and actions.

This makes custom 404 error pages look more clean (#327).

* Rename front-matter settings to match the code style. Add more 404 tutorial links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants