Skip to content

Commit 42fa00a

Browse files
committed
22.2
[til] - new entry: certs-renewal - correctly sort entries and tags - better content styling - new shortcode for the addition of formatted images [treemap] - fix duplicated nodes [general] - other minor changes and fixes
1 parent b7f1df2 commit 42fa00a

16 files changed

Lines changed: 149 additions & 64 deletions

File tree

.eleventy.js

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
const { EleventyRenderPlugin } = require("@11ty/eleventy");
32
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
43
const Nunjucks = require("nunjucks");
@@ -12,47 +11,52 @@ const { qka, quizButtons, quizQuestions } = require('./src/static/js/building/qu
1211
const { buildVersionTag, buildKeywords } = require("./src/static/js/building/package.js");
1312

1413
module.exports = function (eleventyConfig) {
15-
eleventyConfig.addPlugin(EleventyRenderPlugin);
16-
eleventyConfig.addPlugin(eleventyNavigationPlugin);
17-
18-
eleventyConfig.addPassthroughCopy("./src/static/js");
19-
eleventyConfig.addPassthroughCopy("./assets");
20-
eleventyConfig.addPassthroughCopy("**.json");
21-
eleventyConfig.setDataFileSuffixes([".data", ""]);
22-
eleventyConfig.setQuietMode(true);
23-
eleventyConfig.setServerOptions({ watch: ["src/static/css/**"], port: 8088 });
24-
25-
eleventyConfig.addShortcode("breadcrumbs", function (navPages) { return buildBreadcrumbs(navPages, this.page) });
26-
eleventyConfig.addShortcode("treemap", function (navPages) { return buildTreemap(navPages) });
27-
eleventyConfig.addShortcode("changelog", (data, pkg) => buildChangelog(data, pkg));
28-
29-
eleventyConfig.addShortcode("tilTags", (data) => buildTagWall(data));
30-
eleventyConfig.addShortcode("tilRecents", (data) => getRecents(data));
31-
eleventyConfig.addShortcode("tilRelated", (data, current) => getRelated(data, current));
32-
eleventyConfig.addShortcode("tilTimestamps", buildTimestamps);
33-
34-
eleventyConfig.addShortcode("qka", (data) => qka(data));
35-
eleventyConfig.addShortcode("quizButtons", (json) => quizButtons(json));
36-
eleventyConfig.addShortcode("quizQuestions", (json) => quizQuestions(json));
37-
38-
eleventyConfig.addShortcode("addScript", (filename) => addAsset("script", filename));
39-
eleventyConfig.addShortcode("addStyle", (filename) => addAsset("style", filename));
40-
41-
eleventyConfig.addShortcode("keywords", (pkg) => buildKeywords(pkg));
42-
eleventyConfig.addShortcode("version", (pkg) => buildVersionTag(pkg));
43-
44-
eleventyConfig.addShortcode("reference", (url, num) => `<a href="${url}" class="reference" target="_blank" rel="noopener noreferrer">[${num}]</a>`);
45-
46-
eleventyConfig.setLibrary("njk", new Nunjucks.Environment(
47-
new Nunjucks.FileSystemLoader("./"),
48-
{ lstripBlocks: true, trimBlocks: true }
49-
));
50-
51-
return {
52-
dir: {
53-
input: "src",
54-
includes: "templates",
55-
data: "content/data"
56-
}
57-
};
14+
eleventyConfig.addPlugin(EleventyRenderPlugin);
15+
eleventyConfig.addPlugin(eleventyNavigationPlugin);
16+
17+
eleventyConfig.addPassthroughCopy("./src/static/js");
18+
eleventyConfig.addPassthroughCopy("./assets");
19+
eleventyConfig.addPassthroughCopy("**.json");
20+
21+
eleventyConfig.setDataFileSuffixes([".data", ""]);
22+
eleventyConfig.setQuietMode(true);
23+
eleventyConfig.setServerOptions({ watch: ["src/static/css/**"], port: 8088 });
24+
25+
eleventyConfig.addShortcode("breadcrumbs", buildBreadcrumbs);
26+
eleventyConfig.addShortcode("treemap", buildTreemap);
27+
eleventyConfig.addShortcode("changelog", buildChangelog);
28+
29+
eleventyConfig.addShortcode("tilTags", buildTagWall);
30+
eleventyConfig.addShortcode("tilRecents", getRecents);
31+
eleventyConfig.addShortcode("tilRelated", getRelated);
32+
eleventyConfig.addShortcode("tilTimestamps", buildTimestamps);
33+
34+
eleventyConfig.addShortcode("qka", qka);
35+
eleventyConfig.addShortcode("quizButtons", quizButtons);
36+
eleventyConfig.addShortcode("quizQuestions", quizQuestions);
37+
38+
eleventyConfig.addShortcode("addScript", (filename) => addAsset("script", filename));
39+
eleventyConfig.addShortcode("addStyle", (filename) => addAsset("style", filename));
40+
41+
eleventyConfig.addShortcode("keywords", buildKeywords);
42+
eleventyConfig.addShortcode("version", buildVersionTag);
43+
44+
eleventyConfig.addShortcode("ref", (url, num) => `<a href="${url}" class="ref" target="_blank" rel="noopener noreferrer">[${num}]</a>`);
45+
eleventyConfig.addShortcode("tilImg", (file, alt) => `<figure class="til-img">
46+
<img src="/assets/media/projects/til/${file}" alt="${alt}" />
47+
<figcaption class="til-img-alt">${alt}</figcaption>
48+
</figure>`);
49+
50+
eleventyConfig.setLibrary("njk", new Nunjucks.Environment(
51+
new Nunjucks.FileSystemLoader("./"),
52+
{ lstripBlocks: true, trimBlocks: true }
53+
));
54+
55+
return {
56+
dir: {
57+
input: "src",
58+
includes: "templates",
59+
data: "content/data"
60+
}
61+
};
5862
};
31.5 KB
Loading
13.5 KB
Loading
65.3 KB
Loading

assets/media/projects/til/kuma.png

4.48 KB
Loading
13.4 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/content/collections/projects/mier.info.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ the github repo is connected to firebase hosting through CI/CD using github acti
4242
- the [**treemap**](/treemap/) is generated in a similar way to the breadcrumbs,
4343
using the eleventy collections and processed with javascript to generate the
4444
html treemap.
45+
- the [**quizzes**](/quizzes/) are generated using a json file and processed
46+
with javascript to generate the html quiz, including listeners and animations.
47+
- the [**til**](/til/) (today i learned) posts are handled using markdown files
48+
and processed with custom javascript. the tagging system, related posts and
49+
timedates need this processing to be displayed correctly.
4550

4651
<br>
4752

@@ -58,7 +63,6 @@ from December 1st to January 7th every year, there is snow falling
5863
several other inspirations:
5964
- [mschf](https://mschf.com/)
6065
- [crlf.link](https://crlf.link/)
61-
- [stacksorted](https://stacksorted.com/)
6266
- [dmaorg / clancy's blog](http://dmaorg.info/)
6367
- [ramsus' portfolio](https://rsms.me/)
6468
- [eduardorl's portfolio](https://eduardorl.vercel.app/)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "wait, how did I use to manage certs for this service?"
3+
tags: ["docker", "certs", "services", "nginx"]
4+
eleventyNavigation:
5+
key: "certs-renewal"
6+
keywords: ["certificates", "certbot", "sonarqube", "services", "docker", "nginx"]
7+
created: 2024-08-25
8+
---
9+
10+
oops, the certificates for this service are about to expire.
11+
12+
{% tilImg 'kuma.png', 'dashboard showing the expiration date of the certificates' %}
13+
<br>
14+
{% tilImg 'email.png', 'Let\'s Encrypt certification expiration notice' %}
15+
16+
yeah, I probably should set up alerts for that, but I'll do that later.
17+
for now, let's just fix this quickly.
18+
if I remember correctly, I used `certbot` to manage the certs, so it should be
19+
a couple of commands
20+
{% ref 'https://stackoverflow.com/questions/42591165/how-to-renew-only-one-domain-with-certbot', '1' %}
21+
and we're done.
22+
23+
```sh
24+
sudo su
25+
certbot renew
26+
```
27+
28+
{% tilImg 'success.png', 'success message from certbot' %}
29+
30+
alright, that was easy. now I just need to restart the nginx container and
31+
we're good to go.
32+
33+
{% tilImg 'invalid.png', 'firefox warning for invalid certificates' %}
34+
35+
wait, the certs aren't updated yet... oh, right, I need to copy the certs to the
36+
path mounted by the container so that it has the proper certs.
37+
38+
```sh
39+
sudo su
40+
cd /etc/letsencrypt/live/<domain>/
41+
cp *.pem <container-certs-dir>/ # do not use mv
42+
chown 1000:1000 <container-certs-dir>/*.pem
43+
docker restart <container-name>
44+
```
45+
46+
and that's it. the service should be up and running with the new certificates :D
47+
48+
{% tilImg 'fixed.png', 'certs are now fixed and the downtime is over!' %}

src/content/collections/til/ios-event-bubbling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ sections.forEach(({ button, section }) => {
3131
```
3232

3333
after some investigation
34-
{% reference 'https://www.quirksmode.org/blog/archives/2010/09/click_event_delegation.html', '1' %}
35-
{% reference 'https://www.sitepoint.com/community/t/handling-click-in-the-safari-browser/417837', '2' %}
34+
{% ref 'https://www.quirksmode.org/blog/archives/2010/09/click_event_delegation.html', '1' %}
35+
{% ref 'https://www.sitepoint.com/community/t/handling-click-in-the-safari-browser/417837', '2' %}
3636
(and Claude's help), I found out that the issue was related to
3737
[*event bubbling*](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_bubbling_and_capture).
3838
By simply moving the event listener from the `window` object to the `document`

0 commit comments

Comments
 (0)