Developer Diary, World Day of Social Justice
Today, we celebrate the World Day of Social Justice, recognizing the need to promote the same.
Alternatively, if youâd like something a bit less vague, we in the United States also celebrate today as Presidentsâ Day, honoring those who have served as PresidentâŚsome celebrated more reluctantly than others.
Before you click over to take advantage of deep discounts on furniture and mattresses, letâs talk programmingâŚ
Twitter Archive
I added a public license, Creative Commons Attribution Share-Alike 4.0 International, exactly like this blog. With the usual caveat that anything that I might have discussed or quoted that doesnât come from a public domain or Free Culture source needs to hide under the Fair Use doctrineâs umbrellaâparticularly the imagesâif anybody finds me saying something particularly clever, then they can feel free to build on that.
I also modified the archiveâs stylesheet, to include a rudimentary dark mode. I doubt that anybody will care about that but me, but it makes me more comfortable. As you might guess, especially at this time of year, I do a lot of my tinkering in the non-daylight hours, and as Iâve described before, I have scripts to turn on dark mode at sundown. As a result, checking an old tweet on a bright white screen feels fairly jarring.
Iâll think about submitting it as a pull request, at some point.
Oh, one issue to worry about, in publishing this to GitHub Pages, and I resolved the issue during the week via an issue on the project: Search Doesnât (Always?) Appear on GitHub Pages. We found two problems.
- First, GitHub Pages wonât deploy any folder whose name starts with an underscore character, so
_pagefind
breaks the search itself. - Then, the search results didnât seem prepared for a path prefix, so the result results didnât link anywhere.
The first problem had a straightforward configuration solution. I needed to add to the line invoking npx
as follows.
execSync(`npx pagefind --source _site --glob \"[0-9]*/**/*.html\" --bundle-dir pagefind`, { encoding: 'utf-8' });
Of that, the --bundle-dir pagefind
differs, to redirect it away from the folder with the underscore.
The latter problem required providing a processResult
function on the index page. Because it runs repeatedly, it prepends the pathâs prefix (/twitter
, for my archive) if it canât already find it in the URL.
Entropy Arbitrage
GitHub - jcolag/entropy-arbitrage
I have gone through my old posts and, for any links pointing to my tweets, they now point to my Twitter archive. Interestingly, I only found two tweets referenced outside a social media roundup post. After all, now that my archive existsâand especially since I donât want to push people towards Twitterâit no longer makes much sense for my blog to point at Twitter.
For anybody who might need to do something similar, I ran this command against the post source files. I should note that this updates the modification time of every file, so depending on your needs, you might want to handle this differently, like using xargs
to send search results to the sed
replacement.
sed -i 's/twitter.com\/jcolag\/status/jcolag.github.io\/twitter/g' _posts/*.md
This does not change the links to anybody elseâs tweets, and I probably wonât bother trying to do that. I referenceâby tweet or by profileâroughly twenty Twitter accounts. None of those users have registered archives, and several of them belong to a certain political party that spent a day thanking their deity of choice for Twitterâs CEO, suggesting that they probably wonât leave in the near futureâŚ
Regardless, I then went through some posts manually, updating anywhere that I might have suggested that people follow me on Twitter, since anybody doing so will find themselves highly disappointed.
Entropy Arbitrage, Part 2
GitHub - jcolag/entropy-arbitrage-code
I updated the script that generates the aforementioned social media roundup posts on Fridays. It now has a couple of additional snarky title
attributes for the Medieval calendar diagram. The tags for content warnings and embedded images now get generated automatically. And it now provides a brief âfollow meâ section at the end.
That last item probably has the most interesting story of the three. When I started publishing the Friday posts, I included a similar suggestion at the end of the posts, finding them during the manual step that I described in the previous section. After a few weeks, that section vanished, probably because it never really felt right for me to drive business to Twitter.
By contrast, it fits squarely within the mission of the blog to send people to Mastodon.
Oh, and while I had things to do in the blog code, you might notice slightly darker text in posts. Most people probably wonât notice the difference, but it improves the contrast significantly.
Next
Because blog and Twitter things derailed me, I didnât have time to work on the Mastodon Tool Trunk, so Iâll want to get back to that.
I also have some changes to make on my Twitter archive.
Credits: The header image is 64-165 by the FDR Presidential Library & Museum, made available under the terms of the Creative Commons Attribution 2.0 Generic license.
By commenting, you agree to follow the blog's Code of Conduct and that your comment is released under the same license as the rest of the blog.
Tags: programming project devjournal