Skip to content

Commit

Permalink
Remove CSS for CSS Naked Day (April 9th)
Browse files Browse the repository at this point in the history
  • Loading branch information
brookback committed Apr 8, 2024
1 parent f1039a9 commit 9a80076
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
13 changes: 12 additions & 1 deletion src/_includes/layouts/main.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
<meta name="author" content="{{ meta.author }}">

<!-- Styles-->
<link rel="stylesheet" href="/johan.css">
{% if isCSSNakedDay() %}
<!-- Naked Day has no styles: https://css-naked-day.github.io -->
{% else %}
<link rel="stylesheet" href="/johan.css">
{% endif %}

<!-- Feeds -->
<link rel="alternate" type="application/rss+xml" title="Johan Brook: Posts feed (RSS)" href="/writings.xml">
Expand Down Expand Up @@ -67,6 +71,13 @@
<body>
<a href="#main" class="visually-hidden skip-link">Skip to content</a>

{% if isCSSNakedDay() %}
<aside>
<h1>Do you think my site is looking weird? That's because I've removed all styling only for today, <time>April 9th</time>, because it's <a href="https://css-naked-day.github.io">CSS Naked Day</a>!</h1>
</aside>
<hr />
{% endif %}

<div class="Content{% if wide %} wide{% endif %}">

{% include "nav-mobile.njk" %}
Expand Down

0 comments on commit 9a80076

Please sign in to comment.