It’s been more than six months since Reddit cut off Apollo, and I’m fine with that. At first, I did go through a significant amount of withdrawal because Reddit provided me with an endless supply of new things to look into. It really worked towards that slogan of being the Internet’s homepage.
Still, I have that ache in my heart of hearts where I want to find new things on the Internet. I took some time to look into alternatives for Reddit and some of them are just… bad… not bad in the interface but bad in the sense that they have horrible content on the home page. I’ve learned the lesson multiple times that you should listen to people when they tell you who they are, and some of these sites are telling me that they are not worth my time.
I’ve found myself doing more and more things with Micro.blog, discord, and mastodon. In a lot of ways, this is more engaging because I’m finding new people first and then the content that they link to. Versus looking at whatever is hot and then maybe glancing at the name of the person who posted (or, in the case of reddit, reposted).
I have a couple reviews in Letterboxd. While I was thinking about how I would rank them, I felt it writing it down would help me.
★
I finished this but I regret it.
★★
I’m glad someone was given a chance to make this. Hopefully the next thing is better. Still, I would be hesitant to try anything that boasted about being “The people who brought you X”.
★★★
It’s alright. I liked it enough. I would watch it again if it was on and enough peer pressure was applied.
★★★★
I definitely would watch again. I would recommend it to others. In fact, when I’m feeling overwhelmed with all the possibilities, this might be something I put on instead of something new.
★★★★★
Loved it!
Strangely enough, I don’t write a lot about the things I love on the internet. I feel it might be because it _is_the internet. Years of seeing things being ridiculed makes me hesitant to express a strong feeling about something.
I feel that I’m ready to do that more and more now.
SwiftData by Example is the world's largest collection of SwiftData examples, tips, and techniques to help you build apps, solve problems, and understand how SwiftData really works.
If you are interested, this looks like a great opportunity to learn about SwiftData.
Tuesday, I released a post with and version bump of Labarum. I then went on and recorded a podcast stating that theme was now “feature complete”.
Well, I was wrong.
I went to the Homebrew Website Club to do some socializing and shared my site with the others. I pride myself on having a site that is pretty accessible. Turns out that the color contrast on my links isn’t good enough. I knew I had tested the basic font, but had misattributed the links not passing the contrast test as an issue with the test itself.
Definitely, I needed an intervention.
So, I spent about an hour going through all the accessibility issues and HTML validation errors. Some of them I can’t change at this time because the code is generated by Hugo/Goldmark. For example, if you have multiple articles on a page (index or list) and they each have a set of footnotes or use a table of contents, you will get an error about them using the same ids for those items.
I’m not going to put the time or energy into that.
Other issues such as a warning about using a trailing slash in the HTML did make me pause for a moment. For example the following from site-head.html:
<imgsrc="https://cdn.uploads.micro.blog/661/2023/children-who-are-wrong.jpg"alt="Principal Skinner thinks the children are wrong"title="Self Reflection can be hard."/>
I decided to keep examples like these and ignore the issue for now.
Other accessible issues that I’m not going to put more energy into at this point are the code blocks. Some of the contrast colors for keywords were flagged, and the tabindex="0" can make keyboard navigation more difficult than it needs to be.
The most egregious issue is that I use the colors in the headers and links at the very top of the page. I’ve since changed it in both light and dark mode to be something closer to the basic font color but still within the Nord color scheme.
Since I’m changing the colors, I’ll have to redo the images that I have in the README.md which will probably make me think of other things to change. I’m both dreading and excited by doing that as I’ve learned more about what makes for a good demonstration of Labarum.
What is the next opportunity for Labarum?
My favorite part about this post and this point release is that I’m writing about what I’m not going to do.
Sure, there are places that the theme needs improvement1, but I have never been more confident and happy with where it is. I looked at the git history and the first commit was February 21st, 2022. That’s a significant amount of time.
I want to spend more time putting stuff on the blog and less time on what it looks like.
There are going to be changes in the future.
But at this point, it will be focused on changes that are related to the content that I’m creating.
I will not mention them in this post. As always, I’ll make note of any imput. ↩︎
AMERICAN FICTION is Cord Jefferson's hilarious directorial debut, which confronts our culture’s obsession with reducing people to outrageous stereotypes. Jeffrey Wright stars as Monk, a frustrated novelist who’s fed up with the establishment profiting from “Black” entertainment that relies on tired and offensive tropes. To prove his point, Monk uses a pen name to write an outlandish “Black” book of his own, a book that propels him to the heart of hypocrisy and the madness he claims to disdain.
This looks really interesting to me. I've seen other films and shows use similar concepts and stories, but it will be nice to see how it is executed.
One of the changes that version .117 of Hugo that has been allowed onto Micro.blog is the ability to use diagrams in your markdown. The documentation on diagrams highlights two different kinds of diagrams that you can include; GoAT and Mermaid.
When you make a diagram using GoAT, Hugo translates this into a SVG on the server side and then delivers it with the HTML for that particular post. You can find some really complicated examples of them on the GitHub page for GoAT and I’ve included one below to demonstrate.
Mermaid is a diagramming and charting tool that uses javascript and will load different libraries as needed to create the final product. I believe that it can be used to make static deliverables that you could save, but -according to my understanding- that’s a separate module and outside what Micro.blog and most installations require.
In addition, Hugo does not include the connections to Mermaid, and it’s up to the theme developers to make sure this works.
When you get it working, you can have diagrams like the one below.
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
The Mystery of the Mermaid
I had to ask myself why am I putting the time into getting this feature working in my theme. At first glance, the goals of accessibility and speed do not seem to align with adding diagrams built with third party JavaScript framework. I’ve run this site for years and have used tools to create static images that I serve with alt text to illustrate my point.
Ultimately, it’s because I love DIAGRAMS!
I like being able to have a picture that goes with my posts. I don’t feel that I will be using a lot of these, but I want to help those who do.
And with all of my labarum posts, feel free to take what you want to make your themes better.
Splashing around with the Mermaid
I want to start off this section by stating that a lot of what I’m going to write about is duplication of the documentation found online. This is me documenting my process of applying it and my thought process at the time.
My first stop on implementing this is to open up a browser window to duckduckgo and then opening the first 3-5 search results of Hugo mermaid diagram from DuckDuckGo before reading the Hugo Mermaid documentation. I do this to get a feel of what developer roadblocks and experiences that I can note before reading the documentation. It’s similar to where I would read the discussion questions the teacher gives for assigned reading back in school.
The step of creating the layouts/_default/_markup/render-codeblock-mermaid.html is straight forward1.
The first line will go to the resultant HTML, and mermaid will look for items that have the mermaid class to get instructions on what kind of image needs to create.
The second line passes whatever was in the code block. This is typically the definition of the diagram but if you are more familiar or more adventurous you can pass mermaid directives or configurations as well.
The next step is to add something similar to the template.
I wasn’t sure why this needed to go on the actual page versus on the footer that would be used on every single page of the website. Most of the examples that I looked at had it on the single.html and this worked for individual pages but not for the index.html.
I placed it in article_footer.html until I get a deeper understanding of how Hugo wants to manage a flag that would toggle the loading of JavaScript.
Luckily, the browsers that I tested with only load the JavaScript once. I’m not a JavaScript expert, but I think multiple loads of the 7k line file might be frowned upon.
Colors of the Mermaid
After I got it working for the index and standalone pages, I tested the diagram with the dark mode of the theme. Unfortunately, the default text color does not work in all situations.
I checked the documentation on theming the diagrams and saw that I can change the theme by giving it as a parameter during the initialization of mermaid.
This allows for the diagrams to look good in dark mode.
This looked good in dark mode but not light mode.
I then experimented with changing the background for div.mermaid and then having the diagrams render using the default theme for both light and dark mode.
Good but not ultimately it just didn’t look good enough. I showed it to my wife and some people in a discord and they agreed as well.
I needed to find a way to make it toggle from default and dark.
Line 6 is the beginning of a JavaScript Object. I feel that the way it’s in the theme will make it easier to maintain and extend in the future.
It’s all about that base
Mermaid does have a base theme that allows for you to define the colors for the diagram. Yes, I could have taken the time to learn how to pull colors from the theme or use the toggle from light and dark mode to set the diagram colors. But, that could be a long process to customize something that I may not use.
If you want to take this theme and approach, please do, and please have no hesitation to send me a link of your endeavors.
Limitations
Although this implementation does consider if the user is in light or dark mode, it does not switch dynamically. If you are on a system that changes the theme depending on time, you will have to reload to get the different theme. There are themes and walk throughs that show how to do this, but I feel that this iteration and my skill level are not at the appropriate level to implement it now.
Another limitation is that the diagram definition might find it’s way into the .Summary for the individual post.
Mermaid Treasure
Thank you for getting this far into my post. Here are some resources if you want to know more about Mermaid.js.
A quick way to make and test your diagrams before putting them in your posts.
What’s next for Labarum?
I need to do an accessibility and validation audit of the theme. I’ve been making some adjustments and haven’t been testing to make sure that the site is as accessible as I had originally intended.
I’ve found other templates that will have this call a short code that takes a set of parameters that control alignment and zoom of the diagram. I have no plans on duplicating that kind of functionality at this time. ↩︎