From 9a800760f34b648469d95769f8130a3eaf958b1b Mon Sep 17 00:00:00 2001 From: Johan Brook Date: Mon, 8 Apr 2024 12:54:39 +0200 Subject: [PATCH] Remove CSS for CSS Naked Day (April 9th) --- _config.ts | 6 ++++++ src/_includes/layouts/main.njk | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/_config.ts b/_config.ts index 1385b5efd..b11e026c7 100644 --- a/_config.ts +++ b/_config.ts @@ -156,6 +156,12 @@ site.use(typeset({ scope: '.prose' })) .data('pageSlug', function (this: ThisContext) { return this.ctx.url.replaceAll('/', ''); }) + .data('isCSSNakedDay', () => { + // https://css-naked-day.github.io + const now = new Date(); + + return now.getMonth() == 3 && now.getDate() == 9; + }) .data('parent', function (this: ThisContext) { switch (this.ctx.page.data.type) { case 'post': diff --git a/src/_includes/layouts/main.njk b/src/_includes/layouts/main.njk index 48984ca1c..8cae02ba7 100644 --- a/src/_includes/layouts/main.njk +++ b/src/_includes/layouts/main.njk @@ -21,7 +21,11 @@ - + {% if isCSSNakedDay() %} + + {% else %} + + {% endif %} @@ -67,6 +71,13 @@ + {% if isCSSNakedDay() %} + +
+ {% endif %} +
{% include "nav-mobile.njk" %}