From 3a4105218b116055280199d9cd48af63a2b156f7 Mon Sep 17 00:00:00 2001
From: Frederik Ring
Date: Wed, 2 Oct 2019 10:52:04 +0200
Subject: [PATCH 1/2] add nginx config for custom 404 page
---
build/proxy/nginx.conf | 7 +++++++
homepage/content/pages/404.md | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/build/proxy/nginx.conf b/build/proxy/nginx.conf
index e258490..568853e 100644
--- a/build/proxy/nginx.conf
+++ b/build/proxy/nginx.conf
@@ -45,6 +45,13 @@ http {
location /auditorium/ {
try_files $uri $uri/ /auditorium/index.html;
}
+
+ error_page 404 /404.html;
+ location = /404.html {
+ internal;
+ root /www/data;
+ add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive" always;
+ }
}
}
diff --git a/homepage/content/pages/404.md b/homepage/content/pages/404.md
index 5abceb5..5b0ceb5 100644
--- a/homepage/content/pages/404.md
+++ b/homepage/content/pages/404.md
@@ -1,7 +1,7 @@
Title: Page not found | offen
description: offen is a free and open source analytics software for websites and web applications that allows respectful handling of data.
-save_as: 404/index.html
-href: /404/
+save_as: 404.html
+href: /404.html
![Page not Found](/theme/images/content-404.webp){:class="image-text-560-315"}
From 039d8b3e6dd0987d1c436716fd1987bb1e67e228 Mon Sep 17 00:00:00 2001
From: Frederik Ring
Date: Wed, 2 Oct 2019 11:13:26 +0200
Subject: [PATCH 2/2] display build date in footer
---
homepage/pelicanconf.py | 4 ++++
homepage/theme/templates/base.html | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py
index 2008b43..ffa8816 100644
--- a/homepage/pelicanconf.py
+++ b/homepage/pelicanconf.py
@@ -1,3 +1,5 @@
+from datetime import datetime
+from calendar import month_name
# If your site is available via HTTPS, make sure SITEURL begins with https://
RELATIVE_URLS = False
@@ -7,6 +9,8 @@ PATH = 'content'
TIMEZONE = 'Europe/Berlin'
DEFAULT_LANG = 'en'
+BUILD_DATE = '{} {}'.format(month_name[datetime.today().month], datetime.today().year)
+
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html
index 1cd4b3b..18854a4 100644
--- a/homepage/theme/templates/base.html
+++ b/homepage/theme/templates/base.html
@@ -134,7 +134,7 @@