Skip to content

Commit f1249e5

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. 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 <robeyoun@redhat.com>
1 parent f51dd04 commit f1249e5

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

.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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
{% seo %}
1212
</head>
1313
<body class="d-flex flex-column min-vh-100" data-bs-theme="light">
14+
{% if jekyll.environment == "development" %}
15+
<div class="dev-watermark">Development Mode</div>
16+
{% endif %}
1417
{% include nav.html %}
1518
<div class="container-fluid px-0 krx-content" data-bs-theme="light">
1619
{{ 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+
}

0 commit comments

Comments
 (0)