Skip to content

Commit

Permalink
Merge pull request kubernetes#23753 from sftim/20200908_tidy_404_page
Browse files Browse the repository at this point in the history
Tidy 404 Not Found error page
  • Loading branch information
k8s-ci-robot committed Sep 14, 2020
2 parents f53a4c7 + 928c038 commit 9ec9ebb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
8 changes: 8 additions & 0 deletions assets/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ section {
}
}

body.td-404 main .error-details {
max-width: 1100px;
margin-left: auto;
margin-right: auto;
margin-top: 4em;
margin-bottom: 0;
}

/* HEADER */

.td-navbar {
Expand Down
3 changes: 3 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ other = "Latest version"
[docs_version_other_heading]
other = "Older versions"

[error_404_were_you_looking_for]
other = "Were you looking for:"

[examples_heading]
other = "Examples"

Expand Down
35 changes: 10 additions & 25 deletions layouts/404.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
{{ define "main" }}
{{ partial "handle-version-switch-404.html" . }}
<div class="container-404">
<h4>
Perhaps you were looking for:
</h4>

<br />
<br />

<ul>
<li>
<a href="/docs">
The Kubernetes documentation
</a>
</li>
<li>
<a href="/blog">
The Kubernetes blog
</a>
</li>
<li>
<a href="/community">
The Kubernetes community
</a>
</li>
<section id="error-404" class="error-details">
<p>
{{ T "error_404_were_you_looking_for" }}
</p>
<ul id="error-sections">
{{ $sections := slice "docs" "blog" "training" "partners" "community" "case-studies" }}
{{ range $sections }}
{{ with site.GetPage "section" . }}<li><a href="{{ .RelPermalink }}" data-proofer-ignore>{{ .Title }}</a></li>{{ end }}
{{ end }}
</ul>
</div>
</section>
{{ end }}

0 comments on commit 9ec9ebb

Please sign in to comment.