From 779cce9f9d70b6eb4db1be836bab3c28aa10090b Mon Sep 17 00:00:00 2001
From: Nathan Upchurch
Date: Fri, 29 Mar 2024 14:19:01 -0500
Subject: [PATCH] Fix my HTML and integrate prettier
---
_includes/header.njk | 9 ++-
_includes/layouts/post.njk | 16 +++--
_includes/mastodonComments.njk | 1 +
_includes/nextLast.njk | 107 ++++++++++++++++++---------------
content/about/index.md | 10 +--
content/blog/patience.md | 6 +-
eleventy.config.js | 12 +++-
package.json | 3 +-
public/css/code.css | 3 +-
9 files changed, 102 insertions(+), 65 deletions(-)
diff --git a/_includes/header.njk b/_includes/header.njk
index a4b88d1..c5c8b1e 100644
--- a/_includes/header.njk
+++ b/_includes/header.njk
@@ -1,5 +1,12 @@
Skip to main content
-
+
+
+
{% if not hideNav %}{% include "nav.njk" %}{% endif %}
diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk
index 14cb1bf..722303d 100644
--- a/_includes/layouts/post.njk
+++ b/_includes/layouts/post.njk
@@ -9,13 +9,13 @@ layout: layouts/base.njk
diff --git a/_includes/mastodonComments.njk b/_includes/mastodonComments.njk
index bd963d6..4d3921b 100644
--- a/_includes/mastodonComments.njk
+++ b/_includes/mastodonComments.njk
@@ -11,6 +11,7 @@
Reply on Mastodon to comment »
+
+This is my personal website and blog, a little corner of the internet where I can talk about whatever I like without worrying about maintaining a ‘personal brand’, or constraining subject matter to those topics which might help advance my career or establish me as a ‘thought leader’. I’m here to express myself as a human and have fun writing about topics I enjoy. If you’d like to learn more about my professional accomplishments and work, I’ll link my professional website here soon.
About this website
-This website is made with the 11ty static site generator, free and open source variable typefaces Manrope and Fraunces, along with plain-old HTML, CSS, and some vanilla JavaScript for the web components that I built to handle comments. I used the handy calculators on utopia.fyi to help me implement fluid typography and spacing.
+
This website is made with the 11ty static site generator, free and open source variable typefaces Manrope and Fraunces, along with plain-old HTML, CSS, and some vanilla JavaScript for the web components that I built to handle comments. I used the handy calculators on utopia.fyi to help me implement fluid typography and spacing.
-I don’t collect any of your personal information, full-stop. All webfonts, icons, and images are hosted locally (these things can sometimes be used to track people across the internet otherwise). I use umami, an open source, privacy-respecting analytics tool, to see how many people visit this website.
+I don’t collect any of your personal information, full-stop. All webfonts, icons, and images are hosted locally (these things can sometimes be used to track people across the internet otherwise). I use umami, an open source, privacy-respecting analytics tool, to see how many people visit this website.
-Miss when the internet was fun? Find more interesting personal blogs at blogroll.org, or ooh.directory.
+Miss when the internet was fun? Find more interesting personal blogs at blogroll.org, or ooh.directory.
Contact Me
If you would like to say something nice, ask a question, or simply follow me on the fediverse, here’s where you can find me.
diff --git a/content/blog/patience.md b/content/blog/patience.md
index d9ca127..c3e6074 100644
--- a/content/blog/patience.md
+++ b/content/blog/patience.md
@@ -10,8 +10,10 @@ imageURL: /img/dragons_blood_incense_copy.avif
imageAlt: A small piece of a coreless, Japanese-style incense stick burning in a black cast-iron burner.
mastodon_id: "111732713202024407"
---
-Some time ago, maybe a year or so, I extruded a batch of incense sticks from some ingredients I thought might go well together: sandalwood, cinnamon, dragon's blood resin, a touch of Hojari frankincense for acidity, and some tonka bean for sweetness, if I recall correctly. After leaving the sticks to dry overnight, I was disappointed to see that they didn't stay lit; the stick would shrink behind the ember, and it would fizzle out in short order. Even worse, the little scent I was able to detect during the short burn was terrible: acrid and smoky. Dejected, I put the sticks away, returning to attempt to burn a small fragment every few days or so before I lost interest entirely. A few months later, the tube of crooked red incense sticks caught my eye, and I once again attempted to burn a stick. To my surprise, it stayed lit throughout the entire burn. The fragrance had transformed also, from leafy-campfire to a simple, warm, slightly sweet, and medicinal fragrance. While this was enough of an improvement to encourage me to light one every now and then, I remained disappointed that the fragrance was so far from what I'd hoped to achieve. After half-heartedly burning each stick in the little plastic tube that housed them over a period of weeks, the tube disappeared into a basket on the shelf beneath my coffee table amidst a mess of bundled cables and game-controllers, never to be seen again – until just a few days ago.
+Some time ago, maybe a year or so, I extruded a batch of incense sticks from some ingredients I thought might go well together: sandalwood, cinnamon, dragon's blood resin, a touch of Hojari frankincense for acidity, and some tonka bean for sweetness, if I recall correctly. After leaving the sticks to dry overnight, I was disappointed to see that they didn't stay lit; the stick would shrink behind the ember, and it would fizzle out in short order. Even worse, the little scent I was able to detect during the short burn was terrible: acrid and smoky. Dejected, I put the sticks away, returning to attempt to burn a small fragment every few days or so before I lost interest entirely.
+
+A few months later, the tube of crooked red incense sticks caught my eye, and I once again attempted to burn a stick. To my surprise, it stayed lit throughout the entire burn. The fragrance had transformed also, from leafy-campfire to a simple, warm, slightly sweet, and medicinal fragrance. While this was enough of an improvement to encourage me to light one every now and then, I remained disappointed that the fragrance was so far from what I'd hoped to achieve. After half-heartedly burning each stick in the little plastic tube that housed them over a period of weeks, the tube disappeared into a basket on the shelf beneath my coffee table amidst a mess of bundled cables and game-controllers, never to be seen again – until just a few days ago.
[](/img/dragons_blood_incense_copy.avif)
-While rustling around in search of a controller, I discovered the thin plastic tube, noticing two small fragments of incense sliding about as I lifted the tube from the basket. As I lit the first fragment this morning, I was met with a wonderfully clear impression of dragon's blood, uplifted by the bright citrus of Hojari frankincense, on a sweet, warm, woody base; my incense had turned out well after all. Unfortunately, the recipe, written on the tube in dry-erase marker, had long worn off; thinking the batch was a failure, I hadn't recorded it anywhere else. Burning those last two fragments today was bittersweet; all I had needed to do was wait. I'm frustrated about a number of things here, but there is something oddly gratifying about the situation. By failing to record the recipe, I got to experience something rare and unique today. In those peaceful, fragrant moments, I experienced something lovely for the first and last time – and I learned a thing or two about patience.
+While rustling around in search of a controller, I discovered the thin plastic tube, noticing two small fragments of incense sliding about as I lifted the tube from the basket. As I lit the first fragment this morning, I was met with a wonderfully clear impression of dragon's blood, uplifted by the bright citrus of Hojari frankincense, on a sweet, warm, woody base; my incense had turned out well after all. Unfortunately, the recipe, written on the tube in dry-erase marker, had long worn off; thinking the batch was a failure, I hadn't recorded it anywhere else. Burning those last two fragments today was bittersweet; all I had needed to do was wait. I'm frustrated about a number of things here, but there is something oddly gratifying about the situation. By failing to record the recipe, I got to experience something rare and unique today. In those peaceful, fragrant moments, I experienced something lovely for the first and last time — and I learned a thing or two about patience.
diff --git a/eleventy.config.js b/eleventy.config.js
index f015dd9..c3388d7 100644
--- a/eleventy.config.js
+++ b/eleventy.config.js
@@ -7,13 +7,14 @@ const pluginRss = require("@11ty/eleventy-plugin-rss");
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const pluginBundle = require("@11ty/eleventy-plugin-bundle");
const pluginNavigation = require("@11ty/eleventy-navigation");
+const prettier = require("prettier");
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const figoptions = {
figcaption: true
};
-module.exports = function(eleventyConfig) {
+module.exports = eleventyConfig => {
// Helper Functions
const multiReplace = (text, replacementTable) => {
@@ -22,6 +23,15 @@ module.exports = function(eleventyConfig) {
return newText;
};
+ // Transforms
+ eleventyConfig.addTransform("prettier", function (content, outputPath) {
+ if (outputPath && outputPath.endsWith(".html")) {
+ return prettier.format(content, {parser: "html", bracketSameLine: true, vueIndentScriptAndStyle: true, singleAttributePerLine: true, htmlWhitespaceSensitivity: "ignore"});
+ } else {
+ return content;
+ }
+ });
+
eleventyConfig.addWatchTarget("content/**/*.{svg,webp,png,jpeg}");
// Official plugins
diff --git a/package.json b/package.json
index b10f40d..1061716 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
},
"dependencies": {
"markdown-it-footnote": "^3.0.3",
- "markdown-it-image-figures": "^2.1.1"
+ "markdown-it-image-figures": "^2.1.1",
+ "prettier": "^3.2.5"
}
}
diff --git a/public/css/code.css b/public/css/code.css
index 752d454..2444e66 100644
--- a/public/css/code.css
+++ b/public/css/code.css
@@ -1,5 +1,4 @@
-code[class*="language-"],
-pre[class*="language-"] {
+code[class*="language-"], pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);