summary refs log tree commit diff
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2023-08-17 12:21:14 -0500
committerStarfall <us@starfall.systems>2023-08-17 12:24:10 -0500
commita369e660f5b387f2e68288518ac0130945b6affd (patch)
tree94f58b7b969efe95ab1da176a9f46ef69b2cf49a
parent246d9537a7edf8d93f75decd83872374813449df (diff)
add excerpts to blog posts
-rw-r--r--eleventy.config.js11
-rw-r--r--package-lock.json1
-rw-r--r--src/blog.njk2
-rw-r--r--src/blog/centralization-through-decentralization.md1
-rw-r--r--src/blog/java-timezones.md2
-rw-r--r--src/blog/lament-for-the-commons.md3
-rw-r--r--src/feed.njk2
7 files changed, 16 insertions, 6 deletions
diff --git a/eleventy.config.js b/eleventy.config.js
index dd31cc3..07da99d 100644
--- a/eleventy.config.js
+++ b/eleventy.config.js
@@ -1,7 +1,12 @@
 const toml = require('@iarna/toml')
+const markdown = require("markdown-it")
 const eleventyNavigation = require('@11ty/eleventy-navigation')
 const eleventyRss = require('@11ty/eleventy-plugin-rss')
 
+const MD_OPTIONS = { 
+	html: true,
+};
+
 filter_local_date = function(date) {
 	// yyyy-MM-dd
 	return date.getFullYear() + '-'
@@ -15,7 +20,10 @@ filter_rfc3339_datetime = function(date) {
 	return date.toISOString().replace('T', ' ');
 }
 
+
 module.exports = function(eleventyConfig) {
+	eleventyConfig.setLibrary('md', markdown(MD_OPTIONS));
+
 	eleventyConfig.addPlugin(eleventyNavigation)
 	eleventyConfig.addPlugin(eleventyRss)
 
@@ -25,6 +33,9 @@ module.exports = function(eleventyConfig) {
 
 	eleventyConfig.addFilter('local_date', filter_local_date)
 	eleventyConfig.addFilter('rfc3339_datetime', filter_rfc3339_datetime)
+	eleventyConfig.addFilter('md', str => {
+		return markdown(MD_OPTIONS).render(str);
+	})
 
 	eleventyConfig.setFrontMatterParsingOptions({
 		engines: {
diff --git a/package-lock.json b/package-lock.json
index 4e73830..a895bde 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,7 +5,6 @@
 	"requires": true,
 	"packages": {
 		"": {
-			"name": "eleventy-playground",
 			"hasInstallScript": true,
 			"license": "UNLICENSED",
 			"devDependencies": {
diff --git a/src/blog.njk b/src/blog.njk
index 9eac34d..b353545 100644
--- a/src/blog.njk
+++ b/src/blog.njk
@@ -32,7 +32,7 @@ order = 1
 		{{ post.date | local_date }}
 	</time>
 	{%- if post.data.page.excerpt -%}
-		<p>{{ post.data.page.excerpt | safe }}
+		<p>{{ post.data.page.excerpt | md | safe }}
 	{%- endif -%}
 </article>
 {% endfor %}
diff --git a/src/blog/centralization-through-decentralization.md b/src/blog/centralization-through-decentralization.md
index aa6d19d..2cc1513 100644
--- a/src/blog/centralization-through-decentralization.md
+++ b/src/blog/centralization-through-decentralization.md
@@ -5,6 +5,7 @@ categories = [ "software" ]
 ---
 An opinion piece was recently published in Wired magazine titled ["The Hidden Dangers of the Decentralized
 Web"](https://www.wired.com/story/the-hidden-dangers-of-the-decentralized-web/). It makes a lot of basic factual errors, conflates valid reasons to mistrust centralized social media with antisemitic conspiracy theories and grifts, and somehow even manages to make basic security practice out as conspiratorial. I'm not all that interested in giving it the time of day, except for one paragraph that stuck out to me.
+---
 
 > While the platforms offered by Meta and Alphabet are certainly not without issue, it is hard to deny the convenience of their established existence, which makes it possible to communicate, be entertained, shop, and more all in the same place. By contrast, users of decentralized platforms will need to download a slew of apps for everything they want to do online, because these features will no longer all exist in one place.
 
diff --git a/src/blog/java-timezones.md b/src/blog/java-timezones.md
index dd135d4..b33f4f7 100644
--- a/src/blog/java-timezones.md
+++ b/src/blog/java-timezones.md
@@ -6,7 +6,7 @@ categories = [ "software" ]
 Recently ran into an issue at work that we couldn't find a direct answer to anywhere on the Internet (thanks to the terrible state of search in the modern day after Search Engine Optimization and Large Language Models have screwed it over, but that's another topic...) relating to three-letter abbreviations for timezones.
 
 Long story short, use canonical timezone names [from tzdb](http://web.cs.ucla.edu/~eggert/tz/tz-link.htm) like "America/New\_York" instead of abbreviations like "ET".
-
+---
 The abbreviations like EST, CDT, CET, BST... mostly don't work any more, and for good reasons. Is MST Malaysian Standard Time (UTC+8) or North America Mountain Standard Time (UTC-7)? They might be standardized within a given nation's borders, but not worldwide. So, if you run across an error that looks like *this* when trying to parse a date:
 
 ```java
diff --git a/src/blog/lament-for-the-commons.md b/src/blog/lament-for-the-commons.md
index a75a530..6b88311 100644
--- a/src/blog/lament-for-the-commons.md
+++ b/src/blog/lament-for-the-commons.md
@@ -2,11 +2,10 @@
 title = "Lament for the Commons"
 date = 2023-07-03T14:00:00-05:00
 ---
-
 > "The old world is dying, and the new world struggles to be born: now is the time of monsters." -- Antonio Gramsci
 
 It might be slightly overblown to be quoting an Italian communist imprisoned by Mussolini to criticise the decisions made by corporate social media this past month or so, but given their contributions to fascism globally, maybe it isn't... Either way, it has been interesting to see them all seemingly competing for 'worst decision'.
-
+---
 Reddit shut off most of the clients that other people did *for* them, making all that effort and work rather pointless, and now [blind Reddiors can't moderate r/blind](https://www.reddit.com/r/Blind/comments/14nzwkm/) despite assurances that accessibility apps wouldn't be affected and the accessibility of the official app would be improved.
 
 Twitter, not to be one-upped, has now disabled the ability to view anything while not logged in, and paywalled actually being able to use the site. Ironically, even [the announcement](https://twitter.com/elonmusk/status/1675187969420828672) isn't viewable. 600 tweets a day is, well, pratically nothing? On the Fediverse, our friends who actually post daily (sometimes to stream of consciousness levels) and have conversations average about 45-60 posts a day. We aren't particularly active anywhere and still manage to hit an average of 9.
diff --git a/src/feed.njk b/src/feed.njk
index 8d21cef..b9b5838 100644
--- a/src/feed.njk
+++ b/src/feed.njk
@@ -28,7 +28,7 @@ blogurl = "https://starfall.systems/blog/"
 		<link href="{{ absolutePostUrl }}"/>
 		<id>{{ absolutePostUrl }}</id>
 		{%- if post.data.page.excerpt %}
-		<summary>{{- post.data.page.excerpt -}}</summary>
+		<summary type="html">{{- post.data.page.excerpt | md | htmlToAbsoluteUrls(absolutePostUrl) -}}</summary>
 		{% endif -%}
 		<content type="html">
 			{{- post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) -}}