Skip to content

Commit

Permalink
Add simple 404 page (#737)
Browse files Browse the repository at this point in the history
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
  • Loading branch information
rparrett and cart authored Sep 1, 2023
1 parent 08d1aeb commit caa2704
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
15 changes: 15 additions & 0 deletions sass/pages/_404.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.fourohfour {
text-align: center;

h1 {
font-size: 8rem;
margin: 0;
}
p {
margin: 0 0 15px 0;
font-size: 1.5rem;
}
img {
width: 220px;
}
}
17 changes: 9 additions & 8 deletions sass/site.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
@charset "utf-8";

// Core
@import 'functions';
@import 'vars';
@import 'mixins';
@import "functions";
@import "vars";
@import "mixins";

// Fonts
@import 'fonts/firamono';
@import 'fonts/firasans';
@import "fonts/firamono";
@import "fonts/firasans";

// Elements
// - HTML element tweaks: html, body, a, ul, li…
@import 'elements/html';
@import 'elements/body';
@import "elements/html";
@import "elements/body";

// CSS utility classes
@import 'utils';
@import "utils";

// Components
// - Repeating visual patterns: buttons, cards, menus…
Expand Down Expand Up @@ -54,3 +54,4 @@
@import "pages/features";
@import "pages/content";
@import "pages/migration_guide";
@import "pages/404";
8 changes: 8 additions & 0 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "layouts/base.html" %}
{% block content %}
<div class="fourohfour">
<h1>404</h1>
<p>Sorry, we couldn't find that page.</p>
<img src="assets/bevy_icon_dark.svg" alt="Bevy logo">
</div>
{% endblock content %}
2 changes: 2 additions & 0 deletions templates/layouts/base.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% import "macros/header.html" as header_macros %}
{% import "macros/public_draft.html" as public_draft %}

{% set current_path = current_path | default(value="/") %}

{% if section and section.title %}
{% if section.path is starting_with("/learn/book/") %}
{% set page_title = "Bevy Book: " ~ section.title %}
Expand Down

0 comments on commit caa2704

Please sign in to comment.