From da7e1300bd6e3ff4328883dab84adb493f79ecf9 Mon Sep 17 00:00:00 2001 From: Carlos Gauci Date: Tue, 18 Oct 2022 12:24:38 +0200 Subject: [PATCH] add 404 page --- themes/haystack/assets/sass/main.scss | 2 +- themes/haystack/assets/sass/pages/404.scss | 30 +++++++++++++++++++ themes/haystack/layouts/404.html | 19 ++++++++++++ themes/haystack/layouts/_default/404.html | 6 ---- themes/haystack/layouts/partials/footer.html | 18 +++++++++-- themes/haystack/layouts/partials/header.html | 19 ++++++++++-- .../haystack/layouts/partials/site-logo.html | 8 ++--- 7 files changed, 84 insertions(+), 18 deletions(-) create mode 100644 themes/haystack/assets/sass/pages/404.scss create mode 100644 themes/haystack/layouts/404.html delete mode 100644 themes/haystack/layouts/_default/404.html diff --git a/themes/haystack/assets/sass/main.scss b/themes/haystack/assets/sass/main.scss index 62bba771..719450f1 100644 --- a/themes/haystack/assets/sass/main.scss +++ b/themes/haystack/assets/sass/main.scss @@ -20,4 +20,4 @@ /** * Pages */ -@import "pages/index", "pages/tutorials", "pages/community"; +@import "pages/index", "pages/tutorials", "pages/community", "pages/404"; diff --git a/themes/haystack/assets/sass/pages/404.scss b/themes/haystack/assets/sass/pages/404.scss new file mode 100644 index 00000000..723b1140 --- /dev/null +++ b/themes/haystack/assets/sass/pages/404.scss @@ -0,0 +1,30 @@ +.error-page .inner { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.75rem; + + .text { + > span { + display: block; + font-size: var(--h1-size); + line-height: 1.2; + text-align: center; + } + + > p { + text-align: center; + } + } + + .buttons { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.75rem; + + .btn { + transform: scale(0.85); + } + } +} \ No newline at end of file diff --git a/themes/haystack/layouts/404.html b/themes/haystack/layouts/404.html new file mode 100644 index 00000000..844f0063 --- /dev/null +++ b/themes/haystack/layouts/404.html @@ -0,0 +1,19 @@ +{{ define "main" }} +
+
+
+
+ 404 + +

Sorry, the page you were looking for was not found 😔

+
+ +
+ {{ partial "arrow-button" (dict "context" . "type" "link" "text" "Back to Homepage" "url" "/" "color" "green") }} + {{ partial "arrow-button" (dict "context" . "type" "link" "text" "Documentation" "url" "https://docs.haystack.deepset.ai/docs" "color" "green") }} + {{ partial "arrow-button" (dict "context" . "type" "link" "text" "Deepset Blog" "url" "https://www.deepset.ai/blog" "color" "green") }} +
+
+
+
+{{ end }} diff --git a/themes/haystack/layouts/_default/404.html b/themes/haystack/layouts/_default/404.html deleted file mode 100644 index b2ce0699..00000000 --- a/themes/haystack/layouts/_default/404.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ define "main" }} -
- 404 Not Found. - Home -
-{{ end }} diff --git a/themes/haystack/layouts/partials/footer.html b/themes/haystack/layouts/partials/footer.html index 204ed607..2730da1f 100644 --- a/themes/haystack/layouts/partials/footer.html +++ b/themes/haystack/layouts/partials/footer.html @@ -1,8 +1,20 @@ {{/* Website Footer */}} + +{{/* Default color */}} +{{ $theme := "light" }} + +{{/* Get color from frontmatter if specified */}} +{{ with .Params.Footer }} + {{ $theme = . }} +{{ end }} + +{{/* Set to dark on 404 page since there is no frontmatter */}} +{{ if eq .Page.Kind "404" }} + {{ $theme = "dark" }} +{{ end }} +