404 Not Found status code

Use Harp to show a custom 404 page.


Whatever you’re making deserves a custom 404 page so you can provide useful information to visitors, and design it like the rest of your site.


Simply add a 404.jade, 404.ejs, 404.md or 404.html file in the root directory of your application.


If you initialize a new Harp application, a 404.jade file is generated automatically. To add a custom 404 page to an existing project, just add a 404 file in the root.

  |- 404.html
  |- index.html
  +- main.less

If you wanted your project to use the same layout, even for the 404 page, you application might look like the following:

  |- _layout.ejs
  |- index.ejs
  |- 404.md
  +- main.scss

Now, the _layout file will wrap both the index.ejs and 404.md.