From 39b932a70832ec47efe2257e640cf3c964fe4011 Mon Sep 17 00:00:00 2001
From: David Eisinger
Date: Tue, 4 Apr 2023 20:15:46 -0400
Subject: [PATCH] Store references as metadata
---
bin/backup | 31 ++++++++-----------
...com-yw1bcq.txt => craigmod-com-avmku7.txt} | 17 +++++-----
.../journal/dispatch-1-march-2023/index.md | 23 +++++++++-----
.../journal/dispatch-2-april-2023/index.md | 23 +++++++++-----
themes/v2/layouts/index.html | 3 +-
themes/v2/layouts/journal/single.html | 19 ++++++++++++
6 files changed, 74 insertions(+), 42 deletions(-)
rename content/journal/dispatch-1-march-2023/{craigmod-com-yw1bcq.txt => craigmod-com-avmku7.txt} (98%)
diff --git a/bin/backup b/bin/backup
index c400484..a3f6e24 100755
--- a/bin/backup
+++ b/bin/backup
@@ -2,25 +2,18 @@
require "uri"
require "digest"
+require "time"
-filename, *urls = ARGV
+path, *urls = ARGV
-unless filename && urls.any?
- warn "Please supply a filename and url"
+unless path && urls.any?
+ warn "Please supply a path and url"
exit 1
end
-path = filename.sub(File.basename(filename), "")
-content = File.read(filename)
+puts "references:"
urls.each do |url|
- link_id = content.scan(/\[(\d+)\]: #{url}/).first.first
-
- unless link_id
- warn "Link not found"
- exit 1
- end
-
page_content = `curl -s #{url}`
text_content = `w3m #{url}`
@@ -41,12 +34,14 @@ urls.each do |url|
.join
.downcase
- link_filename = "#{URI.parse(url).host.gsub(".", "-")}-#{hash}.txt"
+ filename = "#{URI.parse(url).host.gsub(".", "-")}-#{hash}.txt"
- File.write("#{path}/#{link_filename}", text_content)
+ File.write("#{path}/#{filename}", text_content)
- content.gsub!(/\[#{link_id}\]([^:])/, "[#{link_id}][^#{link_id}-backup]\\1")
- content << "\n[^#{link_id}-backup]: \"#{title}\"; backed up #{Time.now.utc}"
+ puts <<~STR
+ - title: "#{title}"
+ url: #{url}
+ date: #{Time.now.utc.iso8601}
+ file: #{filename}
+ STR
end
-
-File.write(filename, content)
diff --git a/content/journal/dispatch-1-march-2023/craigmod-com-yw1bcq.txt b/content/journal/dispatch-1-march-2023/craigmod-com-avmku7.txt
similarity index 98%
rename from content/journal/dispatch-1-march-2023/craigmod-com-yw1bcq.txt
rename to content/journal/dispatch-1-march-2023/craigmod-com-avmku7.txt
index b4cd8bc..1d5b0d6 100644
--- a/content/journal/dispatch-1-march-2023/craigmod-com-yw1bcq.txt
+++ b/content/journal/dispatch-1-march-2023/craigmod-com-avmku7.txt
@@ -314,30 +314,31 @@ Popular Essays
-Housekeeping
+Walking Venice
-We're off, tomorrow
+Notes on a week of walking Venice, an incredibly beautiful city that feels
+totally cursed
-A Late Night Walk in a Small Southern Town
+Brando’s Room
-Can't sleep, move them feet
+Traveling space, if not time, to say hello to Capote and Brando
-The Cafe With a View of the Waterfall
+Zero milestone
-On small cafes along world heritage paths
+From where everything is measured
-A walk around Kii in the New York Times
+A Few Feet Above the Earth
-A photo + text essay about the Peninsula
+On balance and the inner ear
[ ]
diff --git a/content/journal/dispatch-1-march-2023/index.md b/content/journal/dispatch-1-march-2023/index.md
index 1165140..09f6310 100644
--- a/content/journal/dispatch-1-march-2023/index.md
+++ b/content/journal/dispatch-1-march-2023/index.md
@@ -5,6 +5,19 @@ draft: false
tags:
- dispatch
- ebikes
+references:
+- title: Electric Bike, Stupid Love of My Life — by Craig Mod
+ url: https://craigmod.com/essays/electric_bikes/
+ date: 2023-04-04T23:47:24Z
+ file: craigmod-com-avmku7.txt
+- title: Programming is a Pop Culture – Baldur Bjarnason
+ url: https://www.baldurbjarnason.com/2022/programming-is-a-pop-culture/
+ date: 2023-04-04T23:47:24Z
+ file: www-baldurbjarnason-com-7p5031.txt
+- title: Julia Cameron Wants You to Do Your Morning Pages - The New York Times
+ url: https://www.nytimes.com/2019/02/02/style/julia-cameron-the-artists-way.html
+ date: 2023-04-04T23:47:25Z
+ file: www-nytimes-com-tq2xdi.txt
---
With the warm winter we've been having in NC, I've gotten to take Nev to and from daycare on the e-bike a whole bunch, which has been just fantastic. I'm wary of becoming too much of an evangelist, but it really does feel like they can replace cars for a lot of folks, and they're fun as hell.
@@ -24,14 +37,10 @@ Reading:
Links:
-* [Electric Bike, Stupid Love of My Life — by Craig Mod][1][^1-backup]
-* [Programming is a Pop Culture – Baldur Bjarnason][2][^2-backup]
-* [Julia Cameron Wants You to Do Your Morning Pages - The New York Times][3][^3-backup]
+* [Electric Bike, Stupid Love of My Life — by Craig Mod][1]
+* [Programming is a Pop Culture – Baldur Bjarnason][2]
+* [Julia Cameron Wants You to Do Your Morning Pages - The New York Times][3]
[1]: https://craigmod.com/essays/electric_bikes/
[2]: https://www.baldurbjarnason.com/2022/programming-is-a-pop-culture/
[3]: https://www.nytimes.com/2019/02/02/style/julia-cameron-the-artists-way.html
-
-[^1-backup]: "Electric Bike, Stupid Love of My Life — by Craig Mod"; backed up 2023-04-04 15:54:35 UTC
-[^2-backup]: "Programming is a Pop Culture – Baldur Bjarnason"; backed up 2023-04-04 15:54:36 UTC
-[^3-backup]: "Julia Cameron Wants You to Do Your Morning Pages - The New York Times"; backed up 2023-04-04 15:54:36 UTC
\ No newline at end of file
diff --git a/content/journal/dispatch-2-april-2023/index.md b/content/journal/dispatch-2-april-2023/index.md
index 4f8879b..30f7d21 100644
--- a/content/journal/dispatch-2-april-2023/index.md
+++ b/content/journal/dispatch-2-april-2023/index.md
@@ -4,9 +4,22 @@ date: 2023-04-03T09:49:46-04:00
draft: false
tags:
- dispatch
+references:
+- title: The Enduring Point of Pointless Corp | Viget
+ url: https://www.viget.com/articles/the-enduring-point-of-pointless-corp/
+ date: 2023-04-04T23:45:46Z
+ file: www-viget-com-5w5oyj.txt
+- title: "How to tell if AI threatens YOUR job: No, really, this post may give you a way to answer that"
+ url: https://blog.testdouble.com/posts/2023-03-14-how-to-tell-if-ai-threatens-your-job/
+ date: 2023-04-04T23:45:46Z
+ file: blog-testdouble-com-rtepba.txt
+- title: "This Page is Designed to Last: A Manifesto for Preserving Content on the Web"
+ url: https://jeffhuang.com/designed_to_last/
+ date: 2023-04-04T23:45:47Z
+ file: jeffhuang-com-arq78r.txt
---
-March was great -- took a two night/one day work retreat, spent a weekend out in the woods with the family, had my annual trip to Las Vegas, and participated in Viget's [Pointless Week][1][^1-backup]. Also got to spend some quality time with Nevie; she's a great kid and it's amazing to see her personality come out.
+March was great -- took a two night/one day work retreat, spent a weekend out in the woods with the family, had my annual trip to Las Vegas, and participated in Viget's [Pointless Week][1]. Also got to spend some quality time with Nevie; she's a great kid and it's amazing to see her personality come out.
@@ -44,14 +57,10 @@ Links:
* [verbose.club][8] -- I got to work on this as part of Pointless Week. Super fun to build, and the game's actually pretty good!
* [Caddy - The Ultimate Server with Automatic HTTPS][9] -- used this to serve 👆 in a docker compose setup.
-* [How to tell if AI threatens YOUR job: No, really, this post may give you a way to answer that][10][^10-backup]
-* [This Page is Designed to Last: A Manifesto for Preserving Content on the Web][11][^11-backup]
+* [How to tell if AI threatens YOUR job: No, really, this post may give you a way to answer that][10]
+* [This Page is Designed to Last: A Manifesto for Preserving Content on the Web][11]
[8]: https://verbose.club/
[9]: https://caddyserver.com/
[10]: https://blog.testdouble.com/posts/2023-03-14-how-to-tell-if-ai-threatens-your-job/
[11]: https://jeffhuang.com/designed_to_last/
-
-[^10-backup]: "How to tell if AI threatens YOUR job: No, really, this post may give you a way to answer that"; backed up 2023-04-04 15:39:36 UTC
-[^11-backup]: "This Page is Designed to Last: A Manifesto for Preserving Content on the Web"; backed up 2023-04-04 15:39:37 UTC
-[^1-backup]: "The Enduring Point of Pointless Corp | Viget"; backed up 2023-04-04 15:52:27 UTC
\ No newline at end of file
diff --git a/themes/v2/layouts/index.html b/themes/v2/layouts/index.html
index 3685e17..42fb090 100644
--- a/themes/v2/layouts/index.html
+++ b/themes/v2/layouts/index.html
@@ -16,8 +16,7 @@
{{ .Date | time.Format "(2006-01-02)" }}
- {{ $sup := ".*?" }}
- {{ replaceRE $sup "" .Summary | safeHTML }}
+ {{ .Summary }}
{{ end }}
diff --git a/themes/v2/layouts/journal/single.html b/themes/v2/layouts/journal/single.html
index d52d7f1..16559a1 100644
--- a/themes/v2/layouts/journal/single.html
+++ b/themes/v2/layouts/journal/single.html
@@ -16,4 +16,23 @@
{{ .Content }}
+
+ {{ with .Params.References }}
+
+
+
+ {{ end }}
{{ end }}