CSS Naked Day changes
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m57s
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m57s
This commit is contained in:
parent
15abe350df
commit
707283da51
@ -16,5 +16,13 @@ module.exports = function(eleventyConfig) {
|
|||||||
'hour12': true
|
'hour12': true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
eleventyConfig.addGlobalData('isCSSNakedDay', () => {
|
||||||
|
const dateObj = new Date();
|
||||||
|
|
||||||
|
return dateObj.getMonth() === 3 && dateObj.getFullYear() === 2024 && dateObj.getDate() === 9;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// eleventyConfig.addFilter('rfc3339', date => new Date(date).toISOString());
|
// eleventyConfig.addFilter('rfc3339', date => new Date(date).toISOString());
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,10 @@
|
|||||||
{% if includePrism %}
|
{% if includePrism %}
|
||||||
<link rel="stylesheet" type="text/css" href="/assets/css/prism.min.css">
|
<link rel="stylesheet" type="text/css" href="/assets/css/prism.min.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not isCSSNakedDay %}
|
||||||
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css">
|
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css">
|
||||||
|
{% endif %}
|
||||||
<link rel="alternate" type="application/rss+xml" title="LewisDale.Dev" href="{{ feed.rss if feed.rss else "/rss.xml" }}">
|
<link rel="alternate" type="application/rss+xml" title="LewisDale.Dev" href="{{ feed.rss if feed.rss else "/rss.xml" }}">
|
||||||
<link rel="alternate" type="application/atom+xml" title="LewisDale.Dev Atom Feed" href="{{ feed.atom if feed.atom else "/atom.xml" }}">
|
<link rel="alternate" type="application/atom+xml" title="LewisDale.Dev Atom Feed" href="{{ feed.atom if feed.atom else "/atom.xml" }}">
|
||||||
<link rel="alternate" type="application/json" title="LewisDale.Dev JSON Feed" href="{{ feed.json if feed.json else "/feed.json" }}">
|
<link rel="alternate" type="application/json" title="LewisDale.Dev JSON Feed" href="{{ feed.json if feed.json else "/feed.json" }}">
|
||||||
|
31
src/blog/posts/2024/4/css-naked-day.md
Normal file
31
src/blog/posts/2024/4/css-naked-day.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
title: It's CSS Naked Day
|
||||||
|
description: My blog is going naked for CSS naked day
|
||||||
|
tags:
|
||||||
|
- css
|
||||||
|
date: 2024-04-09T07:11:20.550Z
|
||||||
|
---
|
||||||
|
|
||||||
|
It's [CSS Naked Day](https://css-naked-day.github.io/)[^1], so to celebrate I've stripped all of the CSS from my blog.
|
||||||
|
|
||||||
|
I've added a quick Nunjucks shortcode to make it easier, so the CSS should automagically reappear tomorrow morning:
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```js
|
||||||
|
eleventyConfig.addGlobalData('isCSSNakedDay', () => {
|
||||||
|
const dateObj = new Date();
|
||||||
|
|
||||||
|
return dateObj.getMonth() === 3 && dateObj.getFullYear() === 2024 && dateObj.getDate() === 9;
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
```html
|
||||||
|
{% if not isCSSNakedDay %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="/assets/css/styles.css">
|
||||||
|
{% endif %}
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
Thankfully I've not spotted any terrible layouts (yet) due to missing CSS, which I'm happy about. The colour scheme changer is a bit redundant though. I've also left the FontAwesome and Prism CSS files in, just because otherwise things'll stop rendering at all there which wouldn't be great for a lot of posts.
|
||||||
|
|
||||||
|
[^1]: Please only strip the CSS from your own websites, not your employers'
|
Loading…
Reference in New Issue
Block a user