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

Made a 404 page for publify with relevant links #623

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jacemonje
Copy link
Contributor

screen shot 2015-06-25 at 2 38 32 pm

The stock rails 404 looks really bad so I took the liberty of making a new one

<p>If you are the application owner check the logs for more information.
<br>
<br>
<a href="http://localhost:3000/">Home</a> |
Copy link
Member

Choose a reason for hiding this comment

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

This link won't work in a production environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'll just remove it?

Copy link
Member

Choose a reason for hiding this comment

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

Tricky. You could simply change the links to just ba a path: /, /notes, and /archives, but in particular notes may not be relevant, and this will break if the blog is not located at the root of the web server.

Removing the links is probably the best option.

@jacemonje
Copy link
Contributor Author

I'll go with removing the links instead. Point about the blog not being in the root +1

@fdv
Copy link
Member

fdv commented Jun 29, 2015

Since our routing system has a catch all, it's easy to render a 404 page and use an erb template. That way, you can build the links from the blog settings. That's what I've done on my own blog, and the 404 page benefits from the blog caching.

<p>You may have mistyped the address or the page may have moved.</p>
</div>
<p>If you are the application owner check the logs for more information.</p>
<p>If you are the application owner check the logs for more information.
<br>
Copy link
Contributor

Choose a reason for hiding this comment

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

This <br> could be removed, unless you're using it to force an extra line

@jacemonje
Copy link
Contributor Author

@mvz I'll remove the Publify heading? IMHO it adds a nice touch to the page.

@mvz
Copy link
Member

mvz commented Jun 30, 2015

IMHO it adds a nice touch to the page.

It looks nice, but it seems a bit too prominent. I would rather see my blog's name there :-). Following @fdv's suggestion, you could do that, and also add nice links.

TL;DR: I like the design, I would love to have both the links and the smaller heading, but both should be dynamic.

@fdv, is anything more needed than just moving the 404 to a template inside app/views?

@fdv
Copy link
Member

fdv commented Jun 30, 2015

In my theme, the 404 page is in views/errors/404.html.erb

Need to test that with 500 as well when I get time to do not work not family things.

@jacemonje
Copy link
Contributor Author

I see. I'll work on moving public/404.html to views/errors with the changes you guys want and I'll start on the 500 as well 👍 Making a new branch and PR for this.

@jacemonje
Copy link
Contributor Author

@fdv @mvz Pardon the newbie question, but how did you guys implement the custom error pages without any controllers nor routing? I think I'm missing something crucial 😭

@jacemonje
Copy link
Contributor Author

Just to note: I think the internationalization and translation keys are broken in the views/errors/404.html.erb. The second line should return "The page you are looking for has moved or does not exist." but just prints whatever is inside the parenthesis.

en.yml:
screen shot 2015-07-02 at 9 22 50 am

views/errors/404.html.erb
screen shot 2015-07-02 at 9 22 59 am

rendered 404
screen shot 2015-07-02 at 9 23 15 am

Will try to fix this along with the error pages.

@malachaifrazier
Copy link
Contributor

Are there any updates relating to this PR? @jacemonje @mvz

@mvz
Copy link
Member

mvz commented May 24, 2017

@malachaifrazier not really, no. This should probably go to publify_core for the 9.0 release.

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

Successfully merging this pull request may close these issues.

None yet

5 participants