]> git.ipfire.org Git - ipfire.org.git/commitdiff
error-pages: Create some very simple static error pages
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jan 2024 16:26:30 +0000 (16:26 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Jan 2024 16:26:30 +0000 (16:26 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/error-pages/.gitignore [new file with mode: 0644]
src/error-pages/500.markdown [new file with mode: 0644]
src/error-pages/Gemfile [new file with mode: 0644]
src/error-pages/Gemfile.lock [new file with mode: 0644]
src/error-pages/_config.yml [new file with mode: 0644]
src/error-pages/_includes/main.sass [new file with mode: 0644]
src/error-pages/_layouts/error.html [new file with mode: 0644]

index 2df8b3a0598b31e9f5785a77d0df39ef419624a0..377128ad123843d055a3fc79f741f198b1a925c6 100644 (file)
@@ -1067,6 +1067,20 @@ static_netbootdir = $(staticdir)/netboot
 
 # ------------------------------------------------------------------------------
 
+EXTRA_DIST += \
+       src/error-pages/Gemfile \
+       src/error-pages/Gemfile.lock \
+       src/error-pages/_config.yml \
+       src/error-pages/_includes/main.sass \
+       src/error-pages/_layouts/error.html \
+       src/error-pages/500.markdown
+
+.PHONY: error-pages
+error-pages:
+       $(AM_V_GEN)cd src/error-pages && $(JEKYLL) build --quiet --incremental
+
+# ------------------------------------------------------------------------------
+
 dist_cron_DATA = \
        src/crontab/ipfire
 
diff --git a/src/error-pages/.gitignore b/src/error-pages/.gitignore
new file mode 100644 (file)
index 0000000..d8c03cd
--- /dev/null
@@ -0,0 +1,3 @@
+/.jekyll-cache
+/.jekyll-metadata
+/_site
diff --git a/src/error-pages/500.markdown b/src/error-pages/500.markdown
new file mode 100644 (file)
index 0000000..3f4da47
--- /dev/null
@@ -0,0 +1,5 @@
+---
+layout: error
+
+error-description: Internal Server Error
+---
diff --git a/src/error-pages/Gemfile b/src/error-pages/Gemfile
new file mode 100644 (file)
index 0000000..1bccf29
--- /dev/null
@@ -0,0 +1,33 @@
+source "https://rubygems.org"
+# Hello! This is where you manage which Jekyll version is used to run.
+# When you want to use a different version, change it below, save the
+# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
+#
+#     bundle exec jekyll serve
+#
+# This will help ensure the proper Jekyll version is running.
+# Happy Jekylling!
+gem "jekyll", "~> 4.3.1"
+# This is the default theme for new Jekyll sites. You may change this to anything you like.
+gem "minima", "~> 2.5"
+# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
+# uncomment the line below. To upgrade, run `bundle update github-pages`.
+# gem "github-pages", group: :jekyll_plugins
+# If you have any plugins, put them here!
+group :jekyll_plugins do
+  gem "jekyll-feed", "~> 0.12"
+end
+
+# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
+# and associated library.
+platforms :mingw, :x64_mingw, :mswin, :jruby do
+  gem "tzinfo", ">= 1", "< 3"
+  gem "tzinfo-data"
+end
+
+# Performance-booster for watching directories on Windows
+gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
+
+# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
+# do not have a Java counterpart.
+gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
diff --git a/src/error-pages/Gemfile.lock b/src/error-pages/Gemfile.lock
new file mode 100644 (file)
index 0000000..0dd3681
--- /dev/null
@@ -0,0 +1,79 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    addressable (2.8.1)
+      public_suffix (>= 2.0.2, < 6.0)
+    colorator (1.1.0)
+    concurrent-ruby (1.1.6)
+    em-websocket (0.5.1)
+      eventmachine (>= 0.12.9)
+      http_parser.rb (~> 0.6.0)
+    eventmachine (1.3.0.dev.1)
+    ffi (1.15.5)
+    forwardable-extended (2.6.0)
+    http_parser.rb (0.6.0)
+    i18n (1.10.0)
+      concurrent-ruby (~> 1.0)
+    jekyll (4.3.1)
+      addressable (~> 2.4)
+      colorator (~> 1.0)
+      em-websocket (~> 0.5)
+      i18n (~> 1.0)
+      jekyll-sass-converter (>= 2.0, < 4.0)
+      jekyll-watch (~> 2.0)
+      kramdown (~> 2.3, >= 2.3.1)
+      kramdown-parser-gfm (~> 1.0)
+      liquid (>= 4.0, < 6)
+      mercenary (>= 0.3.6, < 0.5)
+      pathutil (~> 0.9)
+      rouge (>= 3.0, < 5.0)
+      terminal-table (>= 1.8, < 4.0)
+      webrick (~> 1.7)
+    jekyll-feed (0.17.0)
+      jekyll (>= 3.7, < 5.0)
+    jekyll-sass-converter (2.2.0)
+      sassc (> 2.0.1, < 3.0)
+    jekyll-seo-tag (2.8.0)
+      jekyll (>= 3.8, < 5.0)
+    jekyll-watch (2.2.1)
+      listen (~> 3.0)
+    kramdown (2.4.0)
+      rexml
+    kramdown-parser-gfm (1.1.0)
+      kramdown (~> 2.0)
+    liquid (5.4.0)
+    listen (3.7.0)
+      rb-inotify (~> 0.9, >= 0.9.10)
+    mercenary (0.4.0)
+    minima (2.5.1)
+      jekyll (>= 3.5, < 5.0)
+      jekyll-feed (~> 0.9)
+      jekyll-seo-tag (~> 2.1)
+    pathutil (0.16.1)
+      forwardable-extended (~> 2.6)
+    public_suffix (4.0.6)
+    rb-inotify (0.10.1)
+      ffi (~> 1.0)
+    rexml (3.2.5)
+    rouge (3.30.0)
+    sassc (2.4.0)
+      ffi (~> 1.9)
+    terminal-table (3.0.2)
+      unicode-display_width (>= 1.1.1, < 3)
+    unicode-display_width (1.6.1)
+    webrick (1.8.1)
+
+PLATFORMS
+  x86_64-linux
+
+DEPENDENCIES
+  http_parser.rb (~> 0.6.0)
+  jekyll (~> 4.3.1)
+  jekyll-feed (~> 0.12)
+  minima (~> 2.5)
+  tzinfo (>= 1, < 3)
+  tzinfo-data
+  wdm (~> 0.1.1)
+
+BUNDLED WITH
+   2.3.15
diff --git a/src/error-pages/_config.yml b/src/error-pages/_config.yml
new file mode 100644 (file)
index 0000000..3e276df
--- /dev/null
@@ -0,0 +1,8 @@
+# Welcome to Jekyll!
+
+title: IPFire.org
+email: hostmaster@ipfire.org
+url: "https://www.ipfire.org"
+
+sass:
+    sass_dir: ../sass
diff --git a/src/error-pages/_includes/main.sass b/src/error-pages/_includes/main.sass
new file mode 100644 (file)
index 0000000..cafcabf
--- /dev/null
@@ -0,0 +1,2 @@
+// Import the main CSS styles
+@import "../sass/main.sass"
diff --git a/src/error-pages/_layouts/error.html b/src/error-pages/_layouts/error.html
new file mode 100644 (file)
index 0000000..c5e0f40
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+
+               <meta name="author" content="IPFire.org - IPFire Development Team" />
+
+               <title>{{ site.title }} - {% if page.title %}{{ page.title }}{% endif %}</title>
+
+               <!-- styling stuff -->
+               <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+               <style>
+                       {% capture css %}{% include main.sass %}{% endcapture %}
+                       {{ css | sassify }}
+               </style>
+       </head>
+
+       <body>
+               <nav class="navbar" role="navigation" aria-label="main navigation">
+                       <div class="container">
+                               <div class="navbar-brand">
+                                       <a class="navbar-item is-size-4" href="/">
+                                               <strong>
+                                                       IPFire<span class="has-text-primary">_</span>
+                                               </strong>
+                                       </a>
+                               </div>
+                       </div>
+               </nav>
+
+               <div class="hero is-primary is-fullheight-with-navbar">
+                       <div class="hero-body">
+                               <div class="container">
+                                       <p class="title">Oops, Something Went Wrong</p>
+
+                                       {% if page.error-description %}
+                                               <p class="subtitle">{{ page.error-description }}</p>
+                                       {% endif %}
+                               </div>
+                       </div>
+
+                       {{ content }}
+               </div>
+       </body>
+</html>