Skip to content

Commit 140983e

Browse files
committed
Add Development Mode warning.
Adds a transparent warning to the top right of the page when in development environment. This is the default jekyll environment so in the action I'm setting it to production for the real deal, though nothing acts on the "production" value currently. Swaps the favicon for a grayscale version to distinguish it. We are considering deploying a development verstion of the website continuously to GitHub pages somewhere, so we need a way to disambiguate from the main page in case someone stumbles on it. It will also make it immediately clear when developing locally that we are looking at a dev deployment. Signed-off-by: Robert Young <[email protected]>
1 parent 75bfac3 commit 140983e

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
-u "$(id -u):$(id -g)" \
7171
-v "$(pwd):/site" \
7272
localhost:5000/kroxy-jekyll:latest \
73-
bash -c 'eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/ && bundle exec jekyll build --config=_config.yml,_config-overrides.yml'
73+
bash -c 'eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/ && JEKYLL_ENV=production bundle exec jekyll build --config=_config.yml,_config-overrides.yml'
7474
env:
7575
JEKYLL_ENV: production
7676
- name: Upload artifact

_layouts/default.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1+
{%- assign favicon = '/favicon.ico' -%}
2+
{% if jekyll.environment == "development" %}
3+
{%- assign favicon = '/snapshot-favicon.ico' -%}
4+
{% endif %}
15
<!doctype html>
26
<html lang="en">
37
<head>
48
<meta charset="utf-8">
59
<meta name="viewport" content="width=device-width, initial-scale=1">
610
<title>{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }} | {{ site.description }}</title>
7-
<link rel="icon" href="{{ '/favicon.ico' | absolute_url }}" type="image/x-icon" />
11+
<link rel="icon" href="{{ favicon | absolute_url }}" type="image/x-icon" />
812
<link rel="stylesheet" href="{{ '/css/style.css' | absolute_url }}" />
913
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.1/font/bootstrap-icons.min.css" integrity="sha512-oAvZuuYVzkcTc2dH5z1ZJup5OmSQ000qlfRvuoTTiyTBjwX1faoyearj8KdMq0LgsBTHMrRuMek7s+CxF8yE+w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
1014
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js" integrity="sha512-X/YkDZyjTf4wyc2Vy16YGCPHwAY8rZJY+POgokZjQB2mhIRFJCckEGc6YyX9eNsPfn0PzThEuNs+uaomE5CO6A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
1115
{% seo %}
1216
</head>
1317
<body class="d-flex flex-column min-vh-100" data-bs-theme="light">
18+
{% if jekyll.environment == "development" %}
19+
<div class="dev-watermark">Development Mode</div>
20+
{% endif %}
1421
{% include nav.html %}
1522
<div class="container-fluid px-0 krx-content" data-bs-theme="light">
1623
{{ content }}

_sass/kroxylicious.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,19 @@ b.conum * {
290290
.conum:not([data-value]):empty {
291291
display: none
292292
}
293+
294+
.dev-watermark {
295+
position: fixed;
296+
top: 0;
297+
right: 0;
298+
z-index: 9999;
299+
300+
padding: 5px 10px;
301+
background: rgba(255, 193, 7, 0.5);
302+
color: #000;
303+
font-family: $font-family-sans-serif;
304+
font-size: 1.1em;
305+
font-weight: bold;
306+
307+
pointer-events: none; /* Clicks will "pass through" the watermark */
308+
}

snapshot-favicon.ico

14.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)