Refactoring DLTJ, Winter 2021 Part 4: Thursday Threads Newsletter Launches
Success! Four parts plus a half (or a "re-do"" of part 2):
- Ramp up automation for adding reading sources to Obsidian
- Refactor the process of building this static website on AWS
- Recreate the ability for readers to get updates by email
- Turn the old DLTJ “Thursday Threads” concept into a newsletter (this post)
Earlier today, the newsletter launched with issue 79. It wasn't without hiccups, but I don't think any of the problems leaked out to the subscribers. I started with a list of 286 email addresses that were subscribed to the 2015 edition. This morning I sent an email to all of them on the blind-carbon-copy line from my regular email. That way I could see which addresses bounced back as undeliverable (94 addresses) before loading the list into the newsletter database. (Undeliverable email counts as a strike against you when using Amazon's Simple Email Service, so I didn't want to start with a bad reputation with them.)
One of the issues I ran into was with the multiprocessing code that I found on the web. It didn't work as claimed, and when I tried to adjust it, the loop to process email stalled, so I ripped out that code. In the end, with about 200 email addresses, it took just a minute or two of single-threaded, sequential sending to get them all out. Perhaps I won't need that multi-threaded capability until Thursday Threads gets much bigger.
How the Newsletter is Put Together
Like everything on this static site blog, an issue starts as a Markdown file.
Markdown is a light-weight markup language that translates very easily into HTML, and makes it easy for a writer to create valid HTML.
It is also possible to mix HTML inside a Markdown file and have the right thing happen.
The Jekyll processor (the program that turns a folder of Markdown files into a folder of HTML files) has a mechanism for including macros in the markup, and each "thread" in the issue is a macro file.
If you look at the Markdown source for issue 79, you'll see each heading (marked with ##
) has a
{% include thursday-threads-quote.html %}
macro definition.
1 2 3 4 5 6 7 8 |
|
Each of those variables are used in the include processor, which at the moment looks like this: _includes/thursday-threads-quote.html
That is some semantically-appropriate HTML that with some CSS make the nice layout on the page.
(And should be accessible to screen readers, too.)
The content of the "blockquote" variable is inserted at
include.blockquote
spot.
There are also some conditional statements (
{% if include.pre %} ... {% endif %}
)
that will include markup when a variable has a value assigned to it.
The best part of these include blocks is that I can save them as separate files in my Obsidian database with links and tags to the places where I got the content.
In fact, I expect my writing workflow will start with creating these include fragments in my Obsidian database throughout the week, and then when Wednesday night rolls around I'll pick some to drop into an issue.
(Over time, I aim to convert all 650 previous blog posts into Markdown and add them to my Obsidian database as well. That will make it even easier to draw threads from the past.)
So that is where we are: some revitalized technoloy backing DLTJ and a strong intention to write more in the new year. Thanks for everyone's interest along the way, and please get in touch if you have any questions or comments.