Skip to content

Commit a431755

Browse files
authored
Merge pull request #2427 from basho/dpb/new_404_page
Add a 404 page
2 parents 15b4b81 + 26cb9ab commit a431755

File tree

8 files changed

+146
-3
lines changed

8 files changed

+146
-3
lines changed

Diff for: dynamic/css/layout/_wireframe.scss

+6
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ $main-z-index : 100;
196196
padding-top : $banner-buffer-md-up;
197197
}
198198

199+
@include when-inside('.ERROR404') {
200+
@include narrow-from('sm') {
201+
text-align : center;
202+
}
203+
}
204+
199205
/**
200206
* Main Content Well
201207
* 1. Because some elements inside this <main> are given relative positioning

Diff for: dynamic/css/main.scss

+4
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@
4545
'pages/index',
4646
'pages/developing/getting-started',
4747
'pages/learning/use-cases';
48+
49+
// 7. Styles so shameful they get their own directory
50+
@import
51+
'shame/safari-text-flicker-fix';

Diff for: dynamic/css/shame/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Shame
2+
3+
If you write a rule that should not be written, a work-around for non-compliant
4+
browser behavior, a fix the standard should be fixing itself, a hack that makes
5+
you ashamed of yourself as you're writing it... That rule belongs here.
6+
7+
Hopefully the rules written here will be temporary (for some definition of
8+
"temporary"), and browsers and the CSS standard will eventually be robust enough
9+
that we don't need to be ashamed of ourselves. Until then, we should sequester
10+
the worst of our rules somewhere s.t. we know what should be fixed first.
11+
12+
This is not part of the 7-1 architecture, and so has no reference.

Diff for: dynamic/css/shame/_safari-text-flicker-fix.scss

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* An issue was observed in Safari where hovering over sub-headings -- which
3+
* would case a doc icon's opacity to transition from 0 to 1 -- was causing all
4+
* of the text in the main article to flicker. More specifically, it was losing,
5+
* and then regaining a certain amount of clarity.
6+
*
7+
* It turns this was caused by Safari changing the entire element from a 2D
8+
* object to a 3D object for the duration of the transition.
9+
*
10+
* This rule sets the entire element to a 3D object _at load time_ to prevent
11+
* the change from occurring. How stupid is that?
12+
*
13+
* The issue was last observed on Safari Version 10.0.3 (11602.4.8.0.1) running
14+
* in OS X 10.11.6 (15G1217) on a MacBook Pro (Retina, 15-inch, Mid 2014)
15+
* Fix found on http://stackoverflow.com/questions/30637358
16+
*/
17+
.main-article {
18+
-webkit-transform: translate3d(0, 0, 0);
19+
}

Diff for: dynamic/js/basho/selectors.coffee

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ generateVersionLists = () ->
7171

7272
# Fetch the Project Descriptions from the server, and do all the heavy lifting
7373
# inside the `success` callback.
74-
if project and project != "community" then $.getJSON('/data/project_descriptions.json',
74+
if project and project != "community" && project != "404"
75+
then $.getJSON('/data/project_descriptions.json',
7576
(data) ->
7677
project_data = data[project]
7778

Diff for: layouts/404.html

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!DOCTYPE html>
2+
3+
<!-- 404 Page
4+
========
5+
This template follows the style of the _default/single.html layout, though
6+
contains fewer of the dynamic elements found on the Primary Content pages.
7+
8+
Please see layouts/_default/single.html for a discussion on HTML style,
9+
format, and page layout.
10+
11+
{{ $project := "404" }}
12+
{{ $title := "404 - File Not Found" }}
13+
14+
15+
{{ .Scratch.Add "project" $project }}
16+
{{ .Scratch.Add "title" $title }}
17+
18+
19+
20+
{{ $HugoNode := . }}
21+
-->
22+
23+
<html class="no-js" lang="en">
24+
25+
26+
27+
{{ partial "head.html" $HugoNode }}
28+
29+
30+
31+
<body class="ERROR404">
32+
33+
34+
{{ partial "google-tag-manager.html" $HugoNode }}
35+
36+
37+
{{ partial "banner.html" $HugoNode }}
38+
39+
40+
41+
<!-- Content Navigation stand-in
42+
If content-navigation.html is ever modified, this section should be updated
43+
to account for the changes. -->
44+
<nav class="content-nav content-nav--top-size-half">
45+
46+
<div class="content-nav__fixed-top">
47+
<form id="searchbox_011972015458788978446:zgdcy4fa-o0" class="search" action="">
48+
49+
<span class="block float-left search__icon-container docs-icon--search">|</span>
50+
51+
<span class="block overflow">
52+
<input class="search__input" id="main-search" type="search" name="q" placeholder="Search">
53+
</span>
54+
55+
</form>
56+
57+
</div>
58+
59+
</nav>
60+
61+
62+
63+
<div class="content-well">
64+
65+
66+
<article class="main-article">
67+
68+
69+
{{ partial "article-front-matter.html" $HugoNode }}
70+
71+
<p>Sorry, but the page you were trying to view could not be found.</p>
72+
73+
<br>
74+
75+
<p>You may want to check out:</p>
76+
77+
<br>
78+
79+
<p><a href="/community">Our Community Pages</a></p>
80+
<p><a href="/riak/kv/latest">The Riak KV Docs</a></p>
81+
<p><a href="/riak/ts/latest">The Riak TS Docs</a></p>
82+
<p><a href="/riak/cs/latest">The Riak CS Docs</a></p>
83+
84+
<br>
85+
<br>
86+
<br>
87+
88+
89+
</article>
90+
91+
92+
{{ partial "footer.html" $HugoNode }}
93+
94+
95+
</div>
96+
97+
98+
<script src="/js/main.js" type="text/javascript"></script>
99+
100+
</body>
101+
</html>

Diff for: static/css/main.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: static/js/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)