<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://joelchrono.xyz/feeds/webdev.xml" rel="self" type="application/atom+xml" /><link href="https://joelchrono.xyz/" rel="alternate" type="text/html" /><updated>2026-07-11T12:34:20-06:00</updated><id>https://joelchrono.xyz/feeds/webdev.xml</id><title type="html">joelchrono’s blog</title><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><entry><title type="html">Website changes: new section, music widget, and upvotes</title><link href="https://joelchrono.xyz/blog/website-changes-new-section-music-widget-and-upvotes/" rel="alternate" type="text/html" title="Website changes: new section, music widget, and upvotes" /><published>2026-03-28T08:29:42-06:00</published><updated>2026-03-28T08:29:42-06:00</updated><id>https://joelchrono.xyz/blog/website-changes-new-section-music-widget-and-upvotes</id><content type="html" xml:base="https://joelchrono.xyz/blog/website-changes-new-section-music-widget-and-upvotes/"><![CDATA[<h2 id="on-this-week-section">“On This Week” section</h2>

<p>I wanted to add an “On This Day” kind of thing to my website for a while, but even though I have made almost 600 posts as of the time of writing, I still have plenty of empty days where I’ve not made a post.</p>

<p>A In any case, the solution was simple, do it by week and call it done. I found <a href="https://www.joshbeckman.org/blog/implementing-on-this-day-feature-jekyll">a post</a> by <a href="https://mastodon.social/@joshbeckman">Josh Beckman</a> detailing how to do this by day. Using a similar logic, I made use of <code class="language-plaintext highlighter-rouge">%V</code> to get the week number and <code class="language-plaintext highlighter-rouge">%G</code> to get the year for that week—when a calendar week happens across different years.</p>

<p>You can find it live on my <a href="/#this-week-in-other-years">home page</a>, and here’s a simplified version of it with just the basics:</p>

<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">current_week</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">time</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">date</span><span class="p">:</span><span class="w"> </span><span class="s2">"%V"</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">current_week_year</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">time</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">date</span><span class="p">:</span><span class="w"> </span><span class="s2">"%G"</span><span class="w"> </span><span class="cp">%}</span>

&lt;ul&gt;
<span class="cp">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span><span class="nv">post</span><span class="w"> </span><span class="nt">in</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">posts</span><span class="w"> </span><span class="cp">%}</span>
    <span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">post_week</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">post</span><span class="p">.</span><span class="nv">date</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">date</span><span class="p">:</span><span class="w"> </span><span class="s2">"%V"</span><span class="w"> </span><span class="cp">%}</span>
    <span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">post_week_year</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">post</span><span class="p">.</span><span class="nv">date</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">date</span><span class="p">:</span><span class="w"> </span><span class="s2">"%G"</span><span class="w"> </span><span class="cp">%}</span>
    <span class="cp">{%</span><span class="w"> </span><span class="nt">if</span><span class="w"> </span><span class="nv">post_week</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nv">current_week</span><span class="w"> </span><span class="ow">and</span><span class="w"> </span><span class="nv">post_week_year</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="nv">current_week_year</span><span class="w"> </span><span class="cp">%}</span>
        &lt;li&gt;<span class="cp">{{</span><span class="w"> </span><span class="nv">post</span><span class="p">.</span><span class="nv">date</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">date</span><span class="p">:</span><span class="w"> </span><span class="s2">"%Y-%m-%d"</span><span class="w"> </span><span class="cp">}}</span> 
            &lt;a href="<span class="cp">{{</span><span class="w"> </span><span class="nv">post</span><span class="p">.</span><span class="nv">url</span><span class="w"> </span><span class="cp">}}</span>"&gt;<span class="cp">{{</span><span class="w"> </span><span class="nv">post</span><span class="p">.</span><span class="nv">title</span><span class="w"> </span><span class="cp">}}</span>&lt;/a&gt;
        &lt;/li&gt;
    <span class="cp">{%</span><span class="w"> </span><span class="nt">endif</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="cp">%}</span>
&lt;/ul&gt;
</code></pre></div></div>

<p>This is a live example of how the output looks like:</p>

<ul>

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    
        <li>2025-07-12  
            <a href="/blog/my-old-desktop-is-no-more/">My old desktop is no more</a>
        </li>
    

    
    
    
        <li>2025-07-09  
            <a href="/blog/whats-on-my-phone-summer-2025/">What's on my Phone (Summer 2025)</a>
        </li>
    

    
    
    
        <li>2025-07-08  
            <a href="/blog/casio-didnt-let-me-type-my-address/">Casio didn't let me type my address</a>
        </li>
    

    
    
    
        <li>2025-07-07  
            <a href="/blog/2025-w27/">July challenges, new phone, Zelda, and fake Casios - W27</a>
        </li>
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    
        <li>2024-07-09  
            <a href="/blog/metroid-fusion/">Metroid Fusion</a>
        </li>
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    
        <li>2022-07-11  
            <a href="/blog/a-normal-day-of-social-service/">A normal day of social service</a>
        </li>
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    
        <li>2021-07-12  
            <a href="/blog/babysitting-dogs-and-black-widow-movie">Babysitting dogs and a Black Widow mini review</a>
        </li>
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

    
    
    

</ul>

<h2 id="improved-music-widget">Improved music widget</h2>

<p>Yesterday I was playing around with the ListenBrainz API—which I use to display my last song I listened to—and realized that there was a way to get the song <em>currently playing</em> instead. <a href="/blog/small-website-updates/">I implemented my original script a while back</a>, but I got to work and modified it to get my currently listening song, and fallback to the latest one when nothing’s playing on my ears.</p>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// fetch json file based on given url</span>
<span class="k">async</span> <span class="kd">function</span> <span class="nf">fetchListen</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="p">{</span>
	<span class="k">try</span> <span class="p">{</span>
		<span class="kd">const</span> <span class="nx">response</span> <span class="o">=</span> <span class="k">await</span> <span class="nf">fetch</span><span class="p">(</span><span class="nx">url</span><span class="p">);</span>
		<span class="kd">const</span> <span class="nx">data</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">response</span><span class="p">.</span><span class="nf">json</span><span class="p">();</span>
		<span class="k">return</span> <span class="nx">data</span><span class="p">.</span><span class="nx">payload</span><span class="p">.</span><span class="nx">listens</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
	<span class="p">}</span>
	<span class="k">catch </span><span class="p">(</span><span class="nx">err</span><span class="p">){</span>
		<span class="nx">console</span><span class="p">.</span><span class="nf">error</span><span class="p">(</span><span class="dl">"</span><span class="s2">Unable to fetch</span><span class="dl">"</span><span class="p">,</span> <span class="nx">err</span><span class="p">);</span>
		<span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
	<span class="p">}</span>
<span class="p">}</span>

<span class="kd">function</span> <span class="nf">printHtml</span><span class="p">(</span><span class="nx">container</span><span class="p">,</span> <span class="nx">content</span><span class="p">){</span>
	<span class="nx">container</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">content</span><span class="p">;</span>
<span class="p">}</span>

<span class="k">async</span> <span class="kd">function</span> <span class="nf">getListen</span><span class="p">(</span><span class="nx">username</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// get html id to override later</span>
	<span class="kd">const</span> <span class="nx">container</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">getElementById</span><span class="p">(</span><span class="dl">'</span><span class="s1">latest-listen</span><span class="dl">'</span><span class="p">);</span>
	<span class="kd">const</span> <span class="nx">currentUrl</span> <span class="o">=</span> <span class="s2">`https://api.listenbrainz.org/1/user/</span><span class="p">${</span><span class="nx">username</span><span class="p">}</span><span class="s2">/playing-now`</span><span class="p">;</span>
	<span class="kd">const</span> <span class="nx">latestUrl</span> <span class="o">=</span> <span class="s2">`https://api.listenbrainz.org/1/user/</span><span class="p">${</span><span class="nx">username</span><span class="p">}</span><span class="s2">/listens?count=1`</span><span class="p">;</span>
	<span class="kd">const</span> <span class="nx">current</span> <span class="o">=</span> <span class="k">await</span> <span class="nf">fetchListen</span><span class="p">(</span><span class="nx">currentUrl</span><span class="p">);</span>

	<span class="k">if </span><span class="p">(</span><span class="nx">current</span><span class="p">)</span> <span class="p">{</span>
		<span class="kd">const</span> <span class="nx">track</span> <span class="o">=</span> <span class="nx">current</span><span class="p">.</span><span class="nx">track_metadata</span><span class="p">.</span><span class="nx">track_name</span><span class="p">;</span>
		<span class="kd">const</span> <span class="nx">artist</span> <span class="o">=</span> <span class="nx">current</span><span class="p">.</span><span class="nx">track_metadata</span><span class="p">.</span><span class="nx">artist_name</span><span class="p">;</span>
		<span class="k">return</span> <span class="nf">printHtml</span><span class="p">(</span><span class="nx">container</span><span class="p">,</span> <span class="s2">`&lt;b&gt;Currently listening:&lt;/b&gt;&lt;/br&gt;🎵 &lt;i&gt;</span><span class="p">${</span><span class="nx">track</span><span class="p">}</span><span class="s2">&lt;/i&gt; by &lt;i&gt;</span><span class="p">${</span><span class="nx">artist</span><span class="p">}</span><span class="s2">&lt;/i&gt;.`</span><span class="p">);</span>
	<span class="p">}</span>
	<span class="kd">const</span> <span class="nx">latest</span> <span class="o">=</span> <span class="k">await</span> <span class="nf">fetchListen</span><span class="p">(</span><span class="nx">latestUrl</span><span class="p">);</span>
	<span class="k">if </span><span class="p">(</span><span class="nx">latest</span><span class="p">)</span> <span class="p">{</span>
		<span class="kd">const</span> <span class="nx">track</span> <span class="o">=</span> <span class="nx">latest</span><span class="p">.</span><span class="nx">track_metadata</span><span class="p">.</span><span class="nx">track_name</span><span class="p">;</span>
		<span class="kd">const</span> <span class="nx">artist</span> <span class="o">=</span> <span class="nx">latest</span><span class="p">.</span><span class="nx">track_metadata</span><span class="p">.</span><span class="nx">artist_name</span><span class="p">;</span>
		<span class="kd">const</span> <span class="nx">listenedAt</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Date</span><span class="p">(</span><span class="nx">latest</span><span class="p">.</span><span class="nx">listened_at</span> <span class="o">*</span> <span class="mi">1000</span><span class="p">);</span> <span class="c1">// Convert timestamp</span>
		<span class="kd">const</span> <span class="nx">dateFormatted</span> <span class="o">=</span> <span class="nx">listenedAt</span><span class="p">.</span><span class="nf">toLocaleString</span><span class="p">();</span>
		<span class="k">return</span> <span class="nf">printHtml</span><span class="p">(</span><span class="nx">container</span><span class="p">,</span> <span class="s2">`&lt;b&gt;Last listened track:&lt;/b&gt;&lt;/br&gt;🎶 &lt;i&gt;</span><span class="p">${</span><span class="nx">track</span><span class="p">}</span><span class="s2">&lt;/i&gt; by &lt;i&gt;</span><span class="p">${</span><span class="nx">artist</span><span class="p">}</span><span class="s2">&lt;/i&gt;. &lt;br&gt;</span><span class="p">${</span><span class="nx">dateFormatted</span><span class="p">}</span><span class="s2">`</span><span class="p">);</span>
	<span class="p">}</span>
	<span class="nf">printHtml</span><span class="p">(</span><span class="nx">container</span><span class="p">,</span> <span class="s2">`&lt;b&gt;No music found&lt;/b&gt;`</span><span class="p">);</span>
<span class="p">}</span>

<span class="nf">getListen</span><span class="p">(</span><span class="dl">'</span><span class="s1">joel76</span><span class="dl">'</span><span class="p">);</span>

</code></pre></div></div>

<h2 id="an-upvote-button">An upvote button</h2>

<p>Naty shared <a href="https://burgeonlab.com/blog/add-appreciation-buttons-to-hugo-with-iine/">how to have upvotes on a blog</a> and I basically copy-pasted the entire thing. You only need to follow <a href="https://iine.to/#setup">the setup instructions</a> and it will literally just work.</p>

<p>You can find the upvote button in the <a href="#comments">comments sections</a> of every blogpost! Feel free to click or tap on it.</p>

<p>The one downside is that it’s a third party service, but it’s so simple I can’t really come up with a reason why not to try it out. If it ever breaks or stops being supported, it won’t really be that big of a deal.</p>

<hr />

<p>Anyway, those were a lot of changes done to my site for one week, I feel kinda cool about that. Feel free to borrow any of these ideas and make it your own.</p>

<p>This website has evolved and changed so much over time, I can feel the itch to start over creeping up, making it minimal while keeping as much of the features I got on it. Maybe a simple CSS overhaul will do the trick though…</p>

<p>This is day 42 of <a href="https://100daystooffload.com">#100DaysToOffload</a>.</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="jekyll" /><category term="webdev" /><summary type="html"><![CDATA[I made a couple of additions to my Jekyll site and decided to share them all here!]]></summary></entry><entry><title type="html">Share this post to Mastodon</title><link href="https://joelchrono.xyz/blog/share-this-post-to-mastodon/" rel="alternate" type="text/html" title="Share this post to Mastodon" /><published>2026-03-04T20:22:22-06:00</published><updated>2026-03-04T20:22:22-06:00</updated><id>https://joelchrono.xyz/blog/share-this-post-to-mastodon</id><content type="html" xml:base="https://joelchrono.xyz/blog/share-this-post-to-mastodon/"><![CDATA[<p>The people at Mastodon recently released a <a href="https://blog.joinmastodon.org/2026/03/a-new-share-button/">share button for websites!</a> and I think it works rather well, as it remembers the instance you selected for the next time you use it somewhere else.</p>

<p>I added the following button to the bottom of my articles! I made use of Jekyll’s <a href="https://jekyllrb.com/docs/liquid/">Liquid syntax</a>.</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;a</span> <span class="na">class=</span><span class="s">"button"</span> <span class="na">href=</span><span class="s">"https://share.joinmastodon.org/#text=Check%20this%20blogpost%20by%20%40joel%40fosstodon.org! https://joelchrono.xyz{{ page.url | uri_scape }}"</span> <span class="na">target=</span><span class="s">"_blank"</span> <span class="na">rel=</span><span class="s">"noopener"</span><span class="nt">&gt;</span>Share on Mastodon<span class="nt">&lt;/a&gt;</span>
</code></pre></div></div>

<p>You can find this line in use on my <code class="language-plaintext highlighter-rouge">_includes/comments.html</code> file—available on my <a href="https://github.com/joelchrono12/website/blob/main/_includes/comments.html">git repo</a>, where I also have my <a href="https://joelchrono.xyz/blog/how-to-add-mastodon-comments-to-jekyll-blog/">Mastodon-based comments section</a>, just in case you are also interested on getting those set up on your static website!</p>

<p>Thought I’d make a shorter post for once. Could it just be part of <a href="/tags/weeknotes/">my weeknotes?</a> maybe, but I write whatever I want on my website. I actually realized this thanks to a <a href="http://82mhz.net/posts/2026/03/website-update-links-page/">short update post</a>, not too different to this one, on Andreas’ website. Cool stuff!</p>

<p>Anyway, I should go back to playing CrossCode before the day is over, I have a bunny to catch.</p>

<p>This is day 28 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="jekyll" /><category term="tutorial" /><category term="webdev" /><category term="short" /><summary type="html"><![CDATA[I added a share button for the people who read my stuff and share them! As well as some other small changes to my site]]></summary></entry><entry><title type="html">How to make simple collage images</title><link href="https://joelchrono.xyz/blog/how-to-create-simple-collage-images/" rel="alternate" type="text/html" title="How to make simple collage images" /><published>2025-06-01T17:16:17-06:00</published><updated>2025-06-01T17:16:17-06:00</updated><id>https://joelchrono.xyz/blog/how-to-create-simple-collage-images</id><content type="html" xml:base="https://joelchrono.xyz/blog/how-to-create-simple-collage-images/"><![CDATA[<p>This really is a pretty simple problem, but I may as well share this finding here, if only for me to remember later on.</p>

<p>Months ago I discovered <a href="https://joshdl.substack.com">Joshua’s website</a>, and reading one of his <a href="https://joshdl.substack.com/p/media-consumption-round-up-apr-25">media round ups</a>, I noticed, and really liked his little banner images, featuring a glimpse of whatever show or videogame he writes about.</p>

<p>I thought this was a fantastic idea, that I wanted to implement on my own website as well.</p>

<p>I decided to try it out for a few big blogposts early in the year, such as my yearly recap for <a href="/blog/anime-recap-2024/">anime</a> and my post about <a href="/blog/games-due-for-a-replay/">games I wish to replay soon</a>. I thought that the style was just awesome. As in Josh’s own words, it’s a neat way to add photos whilst not making the page too long.</p>

<p>So, for those blog posts I mentioned, I just used <a href="https://gimp.org">GIMP</a> and downloaded some cool images from around the web. Finding wide banner style pictures can be a little hard, but it doesn’t have to be perfect anyway.</p>

<p>In case you are curious, I found the banners I did by looking them up in <a href="https://backloggd.com">Backloggd</a> and <a href="https://anilist.co">Anilist</a> respectively, since banners like those are already part of their own web design.</p>

<p>However, if I wanted to create a banner out of multiple images, I had to resize them, place them and try to fit everything nicely, and it was a bit tedious to do, so I wondered if there was some tool to generate a collage quickly and simply.</p>

<p>Sure, there are websites and online tools, but they are ridden with ads and I didn’t really felt like using them.</p>

<p>After a quick search, I found something, and used it on <a href="/blog/may-2025-summary/">my latest monthly summary!</a></p>

<p>The tool in question has a pretty obvious name:</p>

<h2 id="photocollage"><a href="https://github.com/adrienverge/PhotoCollage">PhotoCollage</a></h2>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2025-06-01-photocollages-interface.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2025-06-01-photocollages-interface.png" type="image/png" />
    <img class="mx-auto" src="/assets/img/blogs/2025-06-01-photocollages-interface.png" alt="PhotoCollage's interface" />
  </picture>
  <figcaption class="caption">PhotoCollage's interface</figcaption></figure>

<p>I installed this from the AUR pretty quickly using:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay <span class="nt">-S</span> photocollage
</code></pre></div></div>

<p>This is an extremely simple tool that will allow you to make a selection of as many images as you wish, and generate a simple collage out of it. You get a couple of options, like picture resolution and border thickness, which you can set as desired.</p>

<p>You have a couple of buttons to regenerate the collage, which will alter the positioning and style at random.</p>

<p>You can also drag pictures around between each tile, as well as alter their placement within the tile, in case it’s cropped weirdly.</p>

<p>Finally, you can save the image whenever you want, it will automatically convert them to whatever file extension you save it as. I tried png, jpg and webp without issues.</p>

<p>There’s not much else to it, to be honest, but I thought it was worth sharing!</p>

<p>When it comes to a <strong>quick way to add images to your Jekyll blog</strong>, feel free to check out <a href="/blog/add-images-to-markdown-files-(for-jekyll)">this blogpost</a>.</p>

<p>This is day 76 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="foss" /><category term="webdev" /><category term="blog" /><category term="tutorial" /><summary type="html"><![CDATA[I found a simple program to generate collages and use them as banners for my blog posts!]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://joelchrono.xyz/assets/img/blogs/2025-06-01-photocollages-interface.webp" /><media:content medium="image" url="https://joelchrono.xyz/assets/img/blogs/2025-06-01-photocollages-interface.webp" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Progress bars for my Booklog!</title><link href="https://joelchrono.xyz/blog/progress-bars-for-my-booklog/" rel="alternate" type="text/html" title="Progress bars for my Booklog!" /><published>2024-09-28T21:56:08-06:00</published><updated>2024-09-28T21:56:08-06:00</updated><id>https://joelchrono.xyz/blog/progress-bars-for-my-booklog</id><content type="html" xml:base="https://joelchrono.xyz/blog/progress-bars-for-my-booklog/"><![CDATA[<p>For some reason, I didn’t know how to make progress bars in HTML!</p>

<p>Turns out it’s very simple, just use the <code class="language-plaintext highlighter-rouge">&lt;progress&gt;</code> element! Pretty well documented on the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress">MDN web docs</a> to be honest.</p>

<p>Simply by using something like the following:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"progress"</span><span class="nt">&gt;</span>Progress:<span class="nt">&lt;/label&gt;</span>
<span class="nt">&lt;progress</span> <span class="na">id=</span><span class="s">"progress"</span> <span class="na">max=</span><span class="s">"100"</span> <span class="na">value=</span><span class="s">"70"</span><span class="nt">&gt;</span>70%<span class="nt">&lt;/progress&gt;</span>
</code></pre></div></div>

<p>We get something like this!</p>

<p><label for="progress">Progress:</label></p>
<progress id="progress" max="100" value="70">70%</progress>

<p>So, in order to add that <a href="/booklog">to my booklog</a>, I simply had to add a <code class="language-plaintext highlighter-rouge">progress</code> variable to the YAML file I use on <code class="language-plaintext highlighter-rouge">_data/books.yml</code> like so:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="pi">-</span> <span class="na">title</span><span class="pi">:</span> <span class="s2">"</span><span class="s">Leviathan</span><span class="nv"> </span><span class="s">Wakes"</span>
  <span class="na">author</span><span class="pi">:</span> <span class="s2">"</span><span class="s">James</span><span class="nv"> </span><span class="s">S.A.</span><span class="nv"> </span><span class="s">Corey"</span>
  <span class="na">cover</span><span class="pi">:</span> <span class="s2">"</span><span class="s">/assets/img/books/leviathan-wakes.jpg"</span>
  <span class="na">start</span><span class="pi">:</span> <span class="s2">"</span><span class="s">2024-09-19"</span>
  <span class="na">end</span><span class="pi">:</span> <span class="s2">"</span><span class="s">In</span><span class="nv"> </span><span class="s">progress"</span>
  <span class="na">progress</span><span class="pi">:</span> <span class="m">16</span>
</code></pre></div></div>

<p>And of course, style the bar, which was a bit of a pain at least for the filled portion of it.</p>

<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">progress</span><span class="nd">::-moz-progress-bar</span> <span class="p">{</span> <span class="nl">background</span><span class="p">:</span> <span class="nf">var</span><span class="p">(</span><span class="l">--border</span><span class="p">);</span> <span class="p">}</span>
<span class="nt">progress</span><span class="nd">::-webkit-progress-value</span> <span class="p">{</span> <span class="nl">background</span><span class="p">:</span> <span class="nf">var</span><span class="p">(</span><span class="l">--border</span><span class="p">);</span> <span class="p">}</span>
<span class="nt">progress</span> <span class="p">{</span>
    <span class="nl">color</span><span class="p">:</span> <span class="nf">var</span><span class="p">(</span><span class="l">--border</span><span class="p">);</span>
    <span class="nl">height</span><span class="p">:</span> <span class="m">12px</span><span class="p">;</span>
    <span class="nl">width</span><span class="p">:</span> <span class="m">80%</span><span class="p">;</span>
    <span class="nl">border</span><span class="p">:</span> <span class="m">0px</span><span class="p">;</span>
    <span class="nl">background-color</span><span class="p">:</span> <span class="nf">var</span><span class="p">(</span><span class="l">--bg</span><span class="p">);</span>
    <span class="nl">border-radius</span><span class="p">:</span> <span class="m">8px</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<p>And in the end, we end up with something like this!</p>

<style>
progress.css::-moz-progress-bar { background: var(--border); }
progress.css::-webkit-progress-value { background: var(--border); }
progress.css {
    color: var(--border);
    height: 12px;
    width: 80%;
    border: solid 2px var(--border);
    background-color: var(--accent-bg);
}
</style>

<p><label class="css" for="book-progress">Book Progress:</label></p>
<progress class="css" id="book-progress" max="100" value="70">70%</progress>

<p>Here’s the complete liquid syntax for my booklog section! The complete file including the CSS styling can be found <a href="https://github.com/joelchrono12/joelchrono12.ml/blob/main/booklog.md">on my GitHub repo</a>.</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{% if site.data.books %}
  {% assign books_by_year = site.data.books | sort: 'end' | group_by_exp: "item", "item.end | date: '%Y'" %}
  {% for year_group in books_by_year reversed %}
  <span class="nt">&lt;h3&gt;</span>{{ year_group.name }}<span class="nt">&lt;/h3&gt;</span>
  <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"responsive-grid"</span><span class="nt">&gt;</span>
  {% for item in year_group.items reversed %}
  <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"book-cover-container"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"book-cover"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;img</span> <span class="na">class=</span><span class="s">"book-cover"</span> <span class="na">src=</span><span class="s">"{{ item.cover }}"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;/div&gt;</span>
  <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"content"</span><span class="nt">&gt;</span>
      <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"info"</span><span class="nt">&gt;</span>
      <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"title"</span><span class="nt">&gt;&lt;i&gt;</span>{{ item.title }}<span class="nt">&lt;/i&gt;&lt;/div&gt;</span>
      <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"artist"</span><span class="nt">&gt;</span>by {{ item.author }}<span class="nt">&lt;/div&gt;</span>
      <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"dates"</span><span class="nt">&gt;</span>Started: {{ item.start }}<span class="nt">&lt;/div&gt;</span>
      {% if item.progress <span class="nt">&lt;</span> <span class="err">100</span> <span class="err">%}</span>
      <span class="err">&lt;</span><span class="na">div</span> <span class="na">class=</span><span class="s">"dates"</span><span class="nt">&gt;</span>
      <span class="nt">&lt;label</span> <span class="na">for=</span><span class="s">"file"</span><span class="nt">&gt;</span>Progress: {{ item.progress }}%<span class="nt">&lt;/label&gt;</span>
      <span class="nt">&lt;progress</span> <span class="na">id=</span><span class="s">"file"</span> <span class="na">value=</span><span class="s">"{{ item.progress }}"</span> <span class="na">max=</span><span class="s">"100"</span><span class="nt">&gt;</span>{{ item.progress }}%<span class="nt">&lt;/progress&gt;</span>
      <span class="nt">&lt;/div&gt;</span>
      {% else %}
      <span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"dates"</span><span class="nt">&gt;</span>Finished: {{ item.end }}<span class="nt">&lt;/div&gt;</span>
      {% endif %}
      <span class="nt">&lt;/div&gt;</span>
      <span class="nt">&lt;/div&gt;</span>
      <span class="nt">&lt;/div&gt;</span>
          {% endfor %}
  <span class="nt">&lt;/div&gt;</span>
  {% endfor %}
{% endif %}
</code></pre></div></div>

<p>Once again, you can see the whole thing in action on <a href="/booklog">my booklog</a>. Now I just have to remember to update it often!</p>

<p>This is day 76 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="jekyll" /><category term="webdev" /><category term="tutorial" /><category term="design" /><summary type="html"><![CDATA[Just a small change that I wanted to make to my booklog section on my website to keep track of my reading progress!]]></summary></entry><entry><title type="html">Website changes, Flexbox and stuff</title><link href="https://joelchrono.xyz/blog/website-changes-flexbox-and-stuff/" rel="alternate" type="text/html" title="Website changes, Flexbox and stuff" /><published>2024-03-11T19:37:21-06:00</published><updated>2024-03-11T19:37:21-06:00</updated><id>https://joelchrono.xyz/blog/layout-changes-flexbox-and-mono-fonts</id><content type="html" xml:base="https://joelchrono.xyz/blog/website-changes-flexbox-and-stuff/"><![CDATA[<p>If you are reading this from an RSS feed you may not notice the amount of changes my website has gone through in the past couple of weeks.</p>

<p>A series of events happened that somehow made me think <em>I really should dedicate a bunch of time to modifiying my website structure once again</em>.</p>

<p>I am <em>not quite sure</em> of what exactly triggered me to do this, but there are many things that made me keep going at it until today. Among them is sickness, and boredom and—Yep, pretty much that.</p>

<p>Last month I was <a href="https://kevquirk.com/penpals/joel-chrono">PenPals with Kev Quirk</a> and we exchanged quite a few emails, there I mentioned wanting to make my site more colorful and the like. I didn’t go that far just yet, but since Kev preferred a light mode, as well as many others, I decided to add one for my site.</p>

<p>I had a light theme months (maybe more than a year) ago, back when I was just using <a href="https://simplecss.org/">SimpleCSS</a> with some colors changed and minimal changes. At some point—probably just to save some bytes of data or some random reason—I decided to get rid of the light colors and left the site with my dark Tokyo-Night based color theme. Regardless, it is back now for those who may need it! I am not the biggest fan of it, but it works well enough now—I think.</p>

<p>Another change that I made quite recently was trying to go for a more semantic use of HTML. I usually used <code class="language-plaintext highlighter-rouge">&lt;div&gt;</code> elements whenever I wanted not much, but more than I actually needed. This time I decided to go for a more proper approach. Still making use of them when necessary, but not as much as before. Thanks to Jekyll, just by modifying the base layouts I already had 99% of the work done, and only a some pages had to be changed by hand.</p>

<p>I created some new bits to make my site a bit flashier too, thanks to <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox">Flexbox</a> I modified my <a href="/">homepage</a>, my <a href="/more/blogroll">blogroll</a> and my <a href="/more/booklog">booklog</a> to fit more content and have it wrap nicely.</p>

<p>Finally, inspired by the site <a href="https://noisydeadlines.net/">Noisy Deadlines</a>, I also went ahead to something I used to have before, which is a Monospace font! My personal choice this time around is IBM Plex Mono, its been a favorite of mine for quite a while and I quite love its <em>italics.</em></p>

<p>Anyway, feel free to look around the site, I also added some breadcrumbs to the top section, right under the header, a move inspired by <a href="https://benjaminhollon.com/">Benjamin Hollon</a>’s site, that has gone through some changes as well recently!</p>

<p>Sorry for the delay between posts, as I’ve mentioned, I was a bit sick, and I am still a little bit. So, I am delayed with my writing, with work and also some commissions from my Ko-Fi page, so if you requested one from me, please have patience, I’ll get to it as soon as I can!</p>

<p>This is day 21 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="jekyll" /><category term="webdev" /><category term="blog" /><summary type="html"><![CDATA[I decided to do a bit of a change on my website for once, and this is how its gone so far]]></summary></entry><entry><title type="html">My Static Site Workflow (2023)</title><link href="https://joelchrono.xyz/blog/my-static-site-workflow/" rel="alternate" type="text/html" title="My Static Site Workflow (2023)" /><published>2023-02-27T13:56:29-06:00</published><updated>2023-02-27T13:56:29-06:00</updated><id>https://joelchrono.xyz/blog/my-static-site-workflow</id><content type="html" xml:base="https://joelchrono.xyz/blog/my-static-site-workflow/"><![CDATA[<p>This is obviously inspired by Kev Quirk’s <a href="https://kevquirk.com/my-static-site-workflow/">latest</a> post,
I decided that, instead of a replying via email,
I can just share with everyone my own way of doing these things. 
I have already talked about how I deal with many of the shortcomings of static site generators,
In my case, Jekyll.</p>

<p>To kick things off, I will share how I fix the problems mentioned by Kev’s article, one by one!
Here they are:</p>

<ol>
  <li>Easily insert links to my other posts</li>
  <li>Drag &amp; drop images into posts</li>
  <li><del>Preview my posts without running a local server</del> (I don’t care about this one)</li>
  <li>Publish with a single command/button click</li>
</ol>

<h1 id="inserting-link-to-other-posts">Inserting link to other posts</h1>

<p>Following the same logic as Kev, 
as long as I have the link in my clipboard, I have these couple of lines in my vim config</p>

<div class="language-vim highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nnoremap <span class="p">&lt;</span>Leader<span class="p">&gt;</span><span class="m">3</span> ciw<span class="p">[&lt;</span>C<span class="p">-</span><span class="k">r</span><span class="p">&gt;</span>"<span class="p">]()&lt;</span>Esc<span class="p">&gt;</span>
vnoremap <span class="p">&lt;</span>Leader<span class="p">&gt;</span><span class="m">3</span> <span class="k">c</span><span class="p">[&lt;</span>C<span class="p">-</span><span class="k">r</span><span class="p">&gt;</span>"<span class="p">]()&lt;</span>Esc<span class="p">&gt;</span>
nnoremap <span class="p">&lt;</span>Leader<span class="p">&gt;</span><span class="m">4</span> ciw<span class="p">[&lt;</span>C<span class="p">-</span><span class="k">r</span><span class="p">&gt;</span><span class="s2">"](&lt;Esc&gt;"</span>*pli<span class="p">)&lt;</span>Esc<span class="p">&gt;</span>
vnoremap <span class="p">&lt;</span>Leader<span class="p">&gt;</span><span class="m">4</span> <span class="k">c</span><span class="p">[&lt;</span>C<span class="p">-</span><span class="k">r</span><span class="p">&gt;</span><span class="s2">"](&lt;Esc&gt;"</span>*pli<span class="p">)&lt;</span>Esc<span class="p">&gt;</span>
</code></pre></div></div>

<p>These keybindings will add the Markdown syntax for a link.
Be it for a single word (when in normal mode) or in selected text (in visual mode).
Pretty handy!</p>

<h1 id="drag-and-drop-images-into-posts">Drag and drop images into posts</h1>

<p>I already talked about this in a previous post,
which happened to <em>also</em> be a response to Kev.</p>

<p>In short, I just right click the image from my file manager (Thunar),
click the prompt in the right-click menu, paste my clipboard content on VIM, and call it a day.</p>

<p>The script does the following:</p>

<ol>
  <li>Prompt rofi to add a title/caption to the image</li>
  <li>Optimize image using ImageMagick’s <code class="language-plaintext highlighter-rouge">convert</code></li>
  <li>Copy the image to my assets folder</li>
  <li>Generate a WEBP version of the image</li>
  <li>Copy the text to add it to my post easily</li>
</ol>

<p>Here it is, in case you are interested.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>

<span class="c">### AIJK (Add image to Jekyll)</span>
<span class="c">### By joelchrono12</span>

<span class="nv">pic</span><span class="o">=</span><span class="nv">$1</span>
<span class="nv">name</span><span class="o">=</span><span class="si">$(</span>rofi <span class="nt">-l</span> 0 <span class="nt">-width</span> 50 <span class="nt">-p</span> <span class="s2">"Title"</span> <span class="nt">-dmenu</span><span class="si">)</span>
<span class="nv">filen</span><span class="o">=</span><span class="si">$(</span><span class="nb">echo</span> <span class="nv">$name</span> | <span class="nb">tr</span> <span class="s2">" ,.!"</span> <span class="s2">"-"</span>| <span class="nb">awk</span> <span class="s1">'{print tolower($0)}'</span><span class="si">)</span>
<span class="nv">today</span><span class="o">=</span><span class="si">$(</span><span class="nb">date</span> +<span class="s2">"%Y-%m-%d"</span><span class="si">)</span>
<span class="nv">filename</span><span class="o">=(</span><span class="nv">$today</span>-<span class="nv">$filen</span><span class="o">)</span>
<span class="nv">path</span><span class="o">=</span>/home/chrono/git/joelchrono12.ml <span class="c">#without / at the end</span>
<span class="nv">imgs</span><span class="o">=</span>/assets/img/blogs/ <span class="c">#example = /assets/img/blogs/</span>
<span class="c">#last_post=$(/bin/ls ${path}/_posts/*.md | sort -r | head -n 1)</span>

convert <span class="nv">$1</span> <span class="nt">-quality</span> 75 <span class="k">${</span><span class="nv">path</span><span class="k">}${</span><span class="nv">imgs</span><span class="k">}${</span><span class="nv">filename</span><span class="k">}</span>.png
cwebp <span class="nt">-q</span> 85 <span class="k">${</span><span class="nv">path</span><span class="k">}${</span><span class="nv">imgs</span><span class="k">}${</span><span class="nv">filename</span><span class="k">}</span>.png <span class="nt">-o</span> <span class="k">${</span><span class="nv">path</span><span class="k">}${</span><span class="nv">imgs</span><span class="k">}${</span><span class="nv">filename</span><span class="k">}</span>.webp

<span class="c">#printf "\n![${name}](${imgs}${filename}.png)"</span>
<span class="nb">printf</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">{%% include img.html image='</span><span class="k">${</span><span class="nv">imgs</span><span class="k">}${</span><span class="nv">filename</span><span class="k">}</span><span class="s2">.png' caption='</span><span class="k">${</span><span class="nv">name</span><span class="k">}</span><span class="s2">' %%}"</span> | xclip <span class="nt">-selection</span> clipboard
</code></pre></div></div>

<p>The last line uses a Jekyll include, I commented a simpler version using regular Markdown syntax if you only need that. You can check why I use an include <a href="https://joelchrono.xyz/blog/vim-macros-and-jekyll-includes/">here</a>.</p>

<p>If you want you can also <a href="https://joelchrono.xyz/blog/add-images-to-markdown-files-(for-jekyll)">check the full post</a> about adding images to Jekyll, to learn how to use the script properly.</p>

<h1 id="single-command-publishing">Single command publishing</h1>

<p>As I stated, I don’t particularly care about previewing my posts in real time. So, how do I publish my posts with a single command?</p>

<p>Again, I already wrote about this a few times, but here’s my current implementation of the script:</p>

<p>It also shares my blog to Mastodon and gets the toot id to enable comments for that blogpost. You can learn how to add comments to your static site using Mastodon in <a href="https://www.joelchrono12.xyz/blog/add-images-to-markdown-files-(for-jekyll)/">this post</a>.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/usr/bin/bash</span>
<span class="c"># Run at root directory of website</span>

<span class="c"># All markdown files start with YYYY-MM-DD</span>
<span class="nv">lastpost</span><span class="o">=</span><span class="si">$(</span>/usr/bin/ls ~/git/joelchrono12.ml/_posts/<span class="k">*</span>.md | <span class="nb">sort</span> <span class="nt">-r</span> | <span class="nb">head</span> <span class="nt">-n</span> 1<span class="si">)</span> 
<span class="c">#getdesc=$(grep "description:" $lastpost | cut -d " " -f2-)</span>
<span class="nv">geturl</span><span class="o">=</span><span class="si">$(</span><span class="nb">grep</span> <span class="s2">"permalink:"</span> <span class="nv">$lastpost</span> | <span class="nb">cut</span> <span class="nt">-d</span> <span class="s2">" "</span> <span class="nt">-f2-</span><span class="si">)</span>
<span class="c">#gettags=$(grep "tags:" $lastpost | cut -d " " -f2- | sed -r 's/([^ ]+)/#\1/g')</span>
<span class="nv">post</span><span class="o">=</span><span class="si">$(</span><span class="nb">echo</span> <span class="nt">-e</span> <span class="s2">"</span><span class="nv">$1</span><span class="se">\n\n</span><span class="s2">https://joelchrono12.xyz</span><span class="k">${</span><span class="nv">geturl</span><span class="k">}</span><span class="s2">"</span><span class="si">)</span>
<span class="nv">posturl</span><span class="o">=</span><span class="si">$(</span>toot post <span class="s2">"</span><span class="nv">$post</span><span class="s2">"</span> | <span class="nb">cut</span> <span class="nt">-d</span>/ <span class="nt">-f5</span><span class="si">)</span>
<span class="nb">echo</span> <span class="nv">$posturl</span>
<span class="nb">sed</span> <span class="nt">-i</span> <span class="s2">"s/109938904113012486/</span><span class="nv">$posturl</span><span class="s2">/g"</span> <span class="s2">"</span><span class="nv">$lastpost</span><span class="s2">"</span>

git add <span class="k">*</span>
git commit <span class="nt">-m</span> <span class="s2">"new post, with comments"</span>
git push

<span class="nb">exit</span>
</code></pre></div></div>

<h1 id="more-tools">More tools!</h1>

<p>Here is a link of different posts I’ve done to fix the following problems!</p>

<ul>
  <li><a href="https://joelchrono.xyz/blog/rofi-automated-blog/">Create new posts automatically</a></li>
  <li><a href="https://joelchrono.xyz/blog/sorting-tags-in-jekyll/">Sorting tags by name and post quantity</a></li>
  <li><a href="https://joelchrono.xyz/blog/a-quick-tag-editor-for-my-website/">Quick tag editing</a></li>
  <li><a href="https://joelchrono.xyz/blog/change-urls-without-breaking-old-links/">Editing URLs (without breaking old ones)</a></li>
  <li><a href="https://joelchrono.xyz/blog/using-jekyll-collections-to-share-origami.html">Jekyll collections</a></li>
  <li><a href="https://joelchrono.xyz/blog/changing-blog-sorting/">Sort blog archive by month and year</a></li>
</ul>

<p>I should probably make a tag for this specific topic, I haven’t done a great job separating these tutorials from the rest. For now, you can check the <a href="/tags/jekyll">jekyll</a>, <a href="/tags/coding">coding</a> and <a href="/tags/tutorial">tutorial</a> tags in case something interests you.</p>

<p>You can always check this <a href="https://github.com/joelchrono12/website">website’s source code</a> or message me in case you want help with something!</p>

<p>This is day 41 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="jekyll" /><category term="blog" /><category term="webdev" /><summary type="html"><![CDATA[How I managed to come up with a static site workflow, using Vim and bash scripts, a response]]></summary></entry><entry><title type="html">Website redesign in progress</title><link href="https://joelchrono.xyz/blog/website-redesign-in-progress/" rel="alternate" type="text/html" title="Website redesign in progress" /><published>2023-02-10T22:24:08-06:00</published><updated>2023-02-10T22:24:08-06:00</updated><id>https://joelchrono.xyz/blog/website-redesign-in-progress</id><content type="html" xml:base="https://joelchrono.xyz/blog/website-redesign-in-progress/"><![CDATA[<p>Alright, so, again, inspired by many of the websites I saw during my tour of the indie web and the like. I revamped my website quite a bit, changing some things, making it more fun and personal for me.</p>

<blockquote>
  <p>UPDATE: 
For the sake of accessibility, I added a button that uses javascript to disable the animation. Other metods to do so without it are mentioned below</p>
</blockquote>

<p>I spent so much time doing so many changes and fixes, that I am honestly too tired to do a proper explanation of everything I did. I was also so lazy that I worked on a single commit all the time just amending the changes I was doing on it. Don’t worry, I also did a good branch to test all the changes being done. I kind of want to figure out how to merge certain commits to a different branch and such, to, for example, move this article to a different branch but not move all the CSS and layout changes I’ve done.</p>

<p>Regardless, here are some of the changes I did in a simple list to call it a day and go mindlessly watch YouTube videos:</p>

<h1 id="background-change">Background change</h1>

<p>My background is now the Time Gate animation from Chrono Trigger. I googled a bit and found a very awesome HD version of it, which you can admire here:</p>

<div style="position:relative; padding-bottom:calc(56.25% + 44px)"><iframe src="https://gfycat.com/ifr/AnimatedSecretHectorsdolphin" frameborder="0" scrolling="no" width="100%" height="100%" style="position:absolute;top:0;left:0;" allowfullscreen=""></iframe></div>

<p>This animation comes from what’s effectively a loading screen from <strong>Chrono Trigger</strong>, my absolute favorite game of all time, the only one I’ve completed more than once and will probably be played again this year, its kind of an unwritten law.</p>

<p>Anyways, that video, converted to a GIF or WEBP animation, would still weight a ton. Therefore I decided to compress it quite a bit. Thankfully, I managed to go below the 512KB required by my club. So there’s that. I am probably going to lose my Green Team badge though. I found a different GIF that is actually quite smaller, to less than 90KB, but didn’t like it as much.</p>

<p>I also did a button using this animation, a lot simpler, without my logo, but kind of sick if I do say so myself.</p>

<p><a href="https://joelchrono12.xyz" target="_blank"><img class="badge" alt="Add my badge to your website! I'll add yours back!" src="/assets/img/badges/joelchrono12_2.gif" /></a></p>

<p>Thanks to a <a href="https://fosstodon.org/@benjaminhollon/109844074473887614">suggestion by Benjamin Hollon</a> you will be able to disable the animated background using the <code class="language-plaintext highlighter-rouge">@media (prefers-reduced-motion)</code> CSS media feature.</p>

<h1 id="rest-of-changes">Rest of changes</h1>

<p>As you can tell, I redesign the blog layout quite a bit, now almost everything is going to be inside its own solid colored container, to not make it all unreadable due to the animated background. It took a bit of time to add some divs to some of my Jekyll layouts. But after it was over, it was over for good.</p>

<ul>
  <li>Latest blogs will now show an excerpt of the content of the blogpost. its a bit more text, and I think it looks quite nice.</li>
  <li>The <a href="/contact">contact</a> section is now divided in Instant Messaging and Social Networks, and I added a few more accounts of mine in there.</li>
  <li>I added a couple more programs to my <a href="/uses/">uses</a> page.</li>
  <li>I redesigned the top section of posts, with the published date, word count, reading time and tags. It’s more responsive and compact, its also adapted to smaller screens such as phones.</li>
  <li>In the footer, I placed the buttons a bit higher, removed links that didn’t make much sense or were replaced by a buttons.</li>
  <li>The layout of the section for articles from blogs I follow now includes an excerpt from the article in question.</li>
</ul>

<p>There probably are some other small changes I forgot, but I think my site looks quite nice now. I may do even more changes in the future but I wanted to keep a similar layout and color scheme, because I still really like Tokyo-Night and how it looks. I feel like the background combines quite well with it, so I am happy with how it all turned out. I append a few images for you to compare the old layout with the new!</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2023-02-09-redesign1.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2023-02-09-redesign1.webp" />
    <img class="mx-auto" src="/assets/img/blogs/2023-02-09-redesign1.webp" alt="Blog post example, old and new" />
  </picture>
  <figcaption class="caption">Blog post example, old and new</figcaption></figure>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2023-02-09-redesign2.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2023-02-09-redesign2.webp" />
    <img class="mx-auto" src="/assets/img/blogs/2023-02-09-redesign2.webp" alt="Blog Archive page, old and new" />
  </picture>
  <figcaption class="caption">Blog Archive page, old and new</figcaption></figure>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2023-02-09-redesign3.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2023-02-09-redesign3.webp" />
    <img class="mx-auto" src="/assets/img/blogs/2023-02-09-redesign3.webp" alt="Footer, old and new" />
  </picture>
  <figcaption class="caption">Footer, old and new</figcaption></figure>

<p>This is day 37 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="blog" /><category term="webdev" /><category term="jekyll" /><summary type="html"><![CDATA[You may be able to appreciate that I am redesigning my website. My era of suckless and minimalist is over, and I will now embrace the bloat.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://joelchrono.xyz/assets/img/blogs/2023-02-09-redesign1.webp" /><media:content medium="image" url="https://joelchrono.xyz/assets/img/blogs/2023-02-09-redesign1.webp" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Some updates to my site links</title><link href="https://joelchrono.xyz/blog/some-updates-to-my-site-links/" rel="alternate" type="text/html" title="Some updates to my site links" /><published>2023-02-07T18:47:04-06:00</published><updated>2023-02-07T18:47:04-06:00</updated><id>https://joelchrono.xyz/blog/some-updates-to-my-site-links</id><content type="html" xml:base="https://joelchrono.xyz/blog/some-updates-to-my-site-links/"><![CDATA[<p>Every once in a while my website layout or design has to change. This time it was a relatively simple one, but still worth noting.</p>

<p>First of all, I added my own <strong><a href="/blogroll/">blogroll</a></strong>, where I will feature some of my favorite websites and blogs I follow, usually via RSS. A few of them are also doing <a href="https://100daystooffload.com">#100DaysToOffload</a> like me!</p>

<p>I am currently in the process of adding more blogs as I also add them from mentions in sites I follow such as <a href="https://blogroll.org/">Ye Olde Blogroll</a> and others blogs like <a href="https://kevquirk.com/blogroll/">Kev Quirk’s</a>. If you also have a blogroll let me know!</p>

<p>I currently follow around 150 personal websites, and not all of them have been updated. But there is a chance I actually have you there, so if you make some interesting blogposts one of these days, I may end up adding you too! Some have a great archive already though, so it doesn’t really matter how active a blog is to me.</p>

<p>Anyways, I also decided to simplify my navigation bar, and move it all to a <a href="/more/">More</a> button, following a style similar to <a href="https://kevquirk.com/more">Kev Quirk</a>, his site keeps inspiring me everytime, I can’t help it. I also stole his <a href="/stats">Stats</a> page.</p>

<p>In that site I added some other links from my website, and I also decided to mention a few clubs I am a part of as well as sites I find interesting or enjoy, like tilde communities and stuff like that. I will probably update it further in the future.</p>

<p>I really should be doing my homework right now, but instead I spent the evening messing around with Liquid syntax and YAML files, I feel so bad, but it was fun to do.</p>

<p>This is day 34 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="blog" /><category term="webdev" /><summary type="html"><![CDATA[I did some cleanup to my navigation bar and added some extra pages Kev Quirk style.]]></summary></entry><entry><title type="html">Trying out Vercel</title><link href="https://joelchrono.xyz/blog/trying-out-vercel/" rel="alternate" type="text/html" title="Trying out Vercel" /><published>2023-01-06T21:06:36-06:00</published><updated>2023-01-06T21:06:36-06:00</updated><id>https://joelchrono.xyz/blog/trying-out-vercel</id><content type="html" xml:base="https://joelchrono.xyz/blog/trying-out-vercel/"><![CDATA[<p>Yesterday I decided to move to <a href="https://vercel.app">Vercel</a> for my website hosting. I had heard about it a while ago, and after <a href="https://fosstodon.org/@thatzacdavis/109640022382097725">a post I saw on my local timeline</a> I remembered hearing about it and ended up setting it up yesterday, as I <a href="https://fosstodon.org/@joel/109640467182046296">mentioned on Mastodon</a></p>

<p>Eventually, I remembered I first heard about Vercel on <a href="https://kevquirk.com/comparing-static-site-hosts-best-host-for-a-static-site/">a post by Kev Quirk</a> where he compared multiple hosting providers. Vercel ended up on top when it comes to speed and the like, even if it lacks some of the features Netlify has.</p>

<p>I had been experiencing very slow build times, it kinda felt like Netlify was reinstalling the whole Jekyll environment everytime it built my blog or something like that. I was meaning to look into fixing it and I even considered moving to something like <a href="https://gohugo.io">Hugo</a>, but after trying Vercel I have to say I am really impressed, doing the change was pretty easy, and getting my domain configured only took a couple minutes, even if the change took a while to apply in the network, so if you tried to access my blog recently and it failed, that’s why.</p>

<p>Regardless, another thing I was thinking about was how I rarely get email replies from people, I actually kind of like those, but the quick link to do so is only visible from my website. I will not remove my Mastodon comments or anything as extreme, but since I am aware quite a bit of my readers follow me via <a href="https://joelchrono12.xyz/feed.xml">my RSS feed</a>, I added a special link to quickly reply from there. Which you’ll see from this post onward, maybe that’ll reduce the friction. Anyways, I’m kinda easy to reach out from other places anyway.</p>

<p>This is day 6 of <a href="https://100daystooffload.com">#100DaysToOffload</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="blog" /><category term="webdev" /><category term="short" /><summary type="html"><![CDATA[I switched my blog from Netlify to Vercel, at least for a while to try it out. I also added a reply via email for my RSS feed]]></summary></entry><entry><title type="html">Sorting tags in Jekyll</title><link href="https://joelchrono.xyz/blog/sorting-tags-in-jekyll/" rel="alternate" type="text/html" title="Sorting tags in Jekyll" /><published>2023-01-03T16:31:39-06:00</published><updated>2023-01-03T16:31:39-06:00</updated><id>https://joelchrono.xyz/blog/sorting-tags-in-jekyll</id><content type="html" xml:base="https://joelchrono.xyz/blog/sorting-tags-in-jekyll/"><![CDATA[<p>So tags are quite a useful feature to loosely categorize posts in my blog. I’ve been using them for quite a while, but I never really liked the way they were shown in my website.</p>

<p>I had been showcasing a <em>tag cloud</em> in my home page for quite a while, I don’t know how many actually used it at all (let me know if you did please, I wanna know), but I decided to move it to my <a href="/tags">tags</a> section, which has been there for a while. However, I also decided to try and sort them in a better way.</p>

<p>So far, I think jekyll sorted my tags in whatever order they were created. This was clearly <strong>not</strong> ideal for me.</p>

<p>I took my time to look around online and see other ways to do this from different blogs such as <a href="https://mindthecode.com/blog/sorting-tags-in-jekyll/">this one</a>, (while writing this blog I came across <a href="https://lei1025.github.io/Implement-Sorting-Tags-by-Name-and-Value-in-Jekyll/">another similar post</a>). I found them kinda hard to understand so wrote this anyways. I think the code I found is kinda good but please, let me know if it can be improved!</p>

<p>Here’s how I can sort them alphabetically as well as based on the amount of posts each has.</p>

<h1 id="sorting-by-name">Sorting by name</h1>

<p>The following snippet will sort all tags by name and will also show the amount of posts they contain.</p>

<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;ul&gt;
<span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">sorted_tags</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">tags</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">sort</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span><span class="nv">tag</span><span class="w"> </span><span class="nt">in</span><span class="w"> </span><span class="nv">sorted_tags</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">t</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">tag</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">first</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">posts</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">tag</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">last</span><span class="w"> </span><span class="cp">%}</span>
&lt;li&gt;&lt;a href="/tags/<span class="cp">{{</span><span class="w"> </span><span class="nv">tag</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="cp">}}</span>/"&gt;<span class="cp">{{</span><span class="w"> </span><span class="nv">tag</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="cp">}}</span>&lt;/a&gt; has <span class="cp">{{</span><span class="w"> </span><span class="nv">tag</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">size</span><span class="w"> </span><span class="cp">}}</span> posts&lt;/li&gt;
<span class="cp">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="cp">%}</span>
&lt;/ul&gt;
</code></pre></div></div>

<h1 id="sorting-by-post-quantity">Sorting by post quantity</h1>

<p>This one was a little trickier, but still quite simple to do.</p>

<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;ul&gt;
<span class="cp">{%</span><span class="w"> </span><span class="nt">capture</span><span class="w"> </span><span class="nv">tags</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span><span class="nv">tag</span><span class="w"> </span><span class="nt">in</span><span class="w"> </span><span class="nv">site</span><span class="p">.</span><span class="nv">tags</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{{</span><span class="w"> </span><span class="nv">tag</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nf">size</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">plus</span><span class="p">:</span><span class="w"> </span><span class="mi">1000</span><span class="w"> </span><span class="cp">}}</span>#<span class="cp">{{</span><span class="w"> </span><span class="nv">tag</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="cp">}}</span>#<span class="cp">{{</span><span class="w"> </span><span class="nv">tag</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nf">size</span><span class="w"> </span><span class="cp">}}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">endcapture</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">sortedtags</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">tags</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">split</span><span class="p">:</span><span class="s1">' '</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">sort</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">for</span><span class="w"> </span><span class="nv">tag</span><span class="w"> </span><span class="nt">in</span><span class="w"> </span><span class="nv">sortedtags</span><span class="w"> </span><span class="na">reversed</span><span class="w"> </span><span class="cp">%}</span>
<span class="cp">{%</span><span class="w"> </span><span class="nt">assign</span><span class="w"> </span><span class="nv">tagitems</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">tag</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nf">split</span><span class="p">:</span><span class="w"> </span><span class="s1">'#'</span><span class="w"> </span><span class="cp">%}</span>
&lt;li&gt;&lt;a href="/tags/<span class="cp">{{</span><span class="w"> </span><span class="nv">tagitems</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="cp">}}</span>/"&gt;<span class="cp">{{</span><span class="w"> </span><span class="nv">tagitems</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="cp">}}</span>&lt;/a&gt; has <span class="cp">{{</span><span class="w"> </span><span class="nv">tagitems</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span><span class="w"> </span><span class="cp">}}</span> posts&lt;/li&gt;
<span class="cp">{%</span><span class="w"> </span><span class="nt">endfor</span><span class="w"> </span><span class="cp">%}</span>
&lt;/ul&gt;
</code></pre></div></div>

<h1 id="finishing-up">Finishing up</h1>

<p>So, that’s it. Did you expect me to explain it? This is not original material, I understand the first one maybe but I do not know what the <code class="language-plaintext highlighter-rouge">plus: 1000</code> does on the second snippet nor anything in that line. Regardless, it works just fine for me to be honest and perhaps it could work for you.</p>

<p>I still find Jekyll to be quite enjoyable, it seems to me like most blogs nowadays are either Hugo or plain old WordPress. Maybe its just my own bias and its nothing like that.</p>

<p>Besides, <strong><a href="https://github.com/void-linux/void-linux.github.io/">Void Linux itself</a>, the one above all</strong>, uses Jekyll. Therefore, I will do my duty and stay loyal to it… until I get bored, or something.</p>

<p>Also, this is gonna be day 3 of my second run of <a href="https://100daystooffload.com">#100DaysToOffload</a>, <em>always has been</em>.</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="jekyll" /><category term="tutorial" /><category term="blog" /><category term="coding" /><category term="webdev" /><summary type="html"><![CDATA[Jekyll allows you to make tags, which are quite useful. I've been working on reducing the amount of tags and changing the way I display them in my blog. So here's what's up]]></summary></entry><entry><title type="html">The Hobby Cycle</title><link href="https://joelchrono.xyz/blog/the-hobby-cycle/" rel="alternate" type="text/html" title="The Hobby Cycle" /><published>2022-09-09T15:15:00-05:00</published><updated>2022-09-09T15:15:00-05:00</updated><id>https://joelchrono.xyz/blog/the-hobby-cycle</id><content type="html" xml:base="https://joelchrono.xyz/blog/the-hobby-cycle/"><![CDATA[<p>I’ve always been a very active person, I can’t be quiet for more than a few minutes, unless I find myself in an ideal environment.</p>

<p>It all started with just basic fidgeting of pencils, rubberbands or paper. As a kid pretty much any of those things would do to keep me calm, even today honestly.</p>

<p>I was going to talk about the story of how I learned each of my hobbies and stuff, but honestly each of them could be a whole article by themselves. So I will just mention this fun fact about me which you may already understand with the title.</p>

<p>Each year, or perhaps even every season, I tend to rediscover a hobby once more, be it magic, origami, retrogaming, speedcubing and even some subsets of them too. You may remember a time where I kept spamming pictures of origami in my social media feed, and even added a new section for it on my website. Well, as you can see by now, I’ve not really uploaded any new pictures of new models. Right now I got into playing on my PSP again, specifically Monster Hunter Portable 3rd. So I am not really back into gaming, I am more into a specific game.</p>

<p>I also brought my deck of cards with me yesterday for a bit to see if it sticks again. But I realized I can’t really force that stuff. Eventually I’ll come across some interesting video or news that pulls me back into that hobby.</p>

<p>I kinda feel like this semester has been kinda wild, I said to myself that I need to have the best grades of my whole career, and its almost as if my brain translated that as “try to go back into as many hobbies as you can and try to keep up with school too”.</p>

<p>So yeah, this usually happens naturally as I consume content or meet new people who happen to be into the same thing. I expect game development to make a comeback one of these days, but I still don’t know how to predict whats coming next.</p>

<p>I know for sure that my current main hobby is gaming on my PSP though, I hope I can finish my game before I get interested in something else. Manga has managed to stick around for months now, but maybe I’ll lose interest at some point too, but I expect this one to not go away as soon as others that require manual work, practice and stuff.</p>

<p>Anyway, that’s pretty much it for today. I also started journaling since I want to write without thinking much, I won’t follow any particular format since I don’t want to have stuff that would only make me resist and procrastinate doing it. Wish me luck!</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="linux" /><category term="hobbies" /><category term="webdev" /><category term="gaming" /><summary type="html"><![CDATA[There is a bit of a thing with me that has evolved as times goes on. I love learning new hobbies, but I also can't avoid rediscovering my love for old ones, but lately its been a little crazy and it looks like each day I am doing something different.]]></summary></entry><entry><title type="html">Selfhosting failed me</title><link href="https://joelchrono.xyz/blog/selfhosting-failed-me/" rel="alternate" type="text/html" title="Selfhosting failed me" /><published>2022-08-10T12:23:50-05:00</published><updated>2022-08-10T12:23:50-05:00</updated><id>https://joelchrono.xyz/blog/selfhosting-failed-me</id><content type="html" xml:base="https://joelchrono.xyz/blog/selfhosting-failed-me/"><![CDATA[<p>Using a Raspberry Pi to selfhost everything and then suffering from a power outage is not the greatest thing that has happened to me. I got lucky many times, but it was bound to happen.</p>

<p>Thankfully, my hard drive which contained pretty much all of the data suffered no damage as far as I can tell, since I can still access all the files I had stored in it. I am not sure if my SD card is well or not, I have not bothered to try fixing anything if it was only an SSH failure or something worse. I went on vacation so I was not home and I did not feel like fixing this or selfhosting for a while</p>

<h1 id="recovering-data-and-annoyances">Recovering data and annoyances.</h1>

<p>There were some things that I had to fix and some services I had to replace, its a bit of a regression, but at least I am back to normal.</p>

<h2 id="dav-calendar-and-contacts">DAV (Calendar and contacts)</h2>

<p>At the moment I decided to move my contact/calendar DAV sync to Disroot, which I’ve decided to trust. All of the data was synced to my computer thanks to Khal and Khard, but Kontacts, which is KDE’s manager provided the best VCF export file, since it kept the contact pictures quality, which was not kept on Android’s exporter, and I don’t think Khard provides it at all.</p>

<p>Calendars and events were easy to recover from Simple Calendar’s exporter.</p>

<p>I had done some testing with importing contacts locally, merging stuff and I ended up with duplicate birthday events. By disabling the calendar on Disroot’s Nextcloud and enabling it again, reimporting my adressbook fixed it for me.</p>

<h2 id="rss-feeds">RSS feeds</h2>

<p>This was quite a pain to get back, actually. I had not made an OPML backup in a while from FreshRSS, and I could not use Newsboat to retrieve anything from the cache. I had tried Fluent Reader a while back, and it provided OPML exports, which was lacking on all of my Android FreshRSS clients for some reason. I lost a couple feeds, but not as many as I thought.</p>

<h2 id="books">Books</h2>

<p>I had some books in the SD Card which I was able to recover successfully, since the database used by my web front-end is compliant with Calibre, I was able to import it to my computer quite easily.</p>

<h2 id="other-files">Other Files</h2>

<p>As I said, since I placed most of my files in the external hard drive, nothing of value was lost. There were some small files and things in the SD card, which I was able to recover too, as the books mentioned before.</p>

<h1 id="finishing-up">Finishing up</h1>

<p>After checking that most things seem to be working fine in my SD and HDD, I will probably try to get it to work again by plugging a monitor to my raspberry and checking whats up. For now I managed to recover almost everything without problems.</p>

<p>Pi-hole and other services will have to wait for now, I guess.</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="storytime" /><category term="ramble" /><category term="selfhost" /><category term="webdev" /><category term="raspberrypi" /><summary type="html"><![CDATA[This was pretty much my fault, but let it be a tale about how not being cautious about backups could be terrible if you are careless like me]]></summary></entry><entry><title type="html">Vim macros and Jekyll includes</title><link href="https://joelchrono.xyz/blog/vim-macros-and-jekyll-includes/" rel="alternate" type="text/html" title="Vim macros and Jekyll includes" /><published>2022-06-30T10:53:30-05:00</published><updated>2022-06-30T10:53:30-05:00</updated><id>https://joelchrono.xyz/blog/vim-macros-and-jekyll-includes</id><content type="html" xml:base="https://joelchrono.xyz/blog/vim-macros-and-jekyll-includes/"><![CDATA[<p>Yesterday I talked about converting all my images to WebP, because it would help keep the file sizes smaller, improving loading times. However I have to say I agree with <a href="https://thenighthas.me/@isa">@isa</a> when she mentioned how annoying it is to not have a jpg or png file available to download since webp is still not as supported by Image viewers and the like, or if you dislike file formats that stick out from the standard.</p>

<p>So I decided to keep both webp and jpg files available. I am not sure of what makes a browser choose one over the other. For now, I pretty much copy pasted the solution used by <a href="https://minutestomidnight.co.uk/blog/implementing-webp-images-in-jekyll/">Simone on his blog</a>, I only added some code to support <code class="language-plaintext highlighter-rouge">.gif</code> files, since WebP supports animation too.</p>

<p>Implementing this was not difficult at all. I created a file inside of my <code class="language-plaintext highlighter-rouge">_includes</code> folder containing the following template:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;figure</span> <span class="na">class=</span><span class="s">"{{ include.class | default: 'img' }}"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;picture&gt;</span>
    <span class="nt">&lt;source</span> <span class="na">srcset=</span><span class="s">"{{ include.image | replace:'.png','.webp' | replace:'.jpg','.webp' | replace:'.jpeg','.webp' | replace: '.gif','.webp' }}"</span> <span class="na">type=</span><span class="s">"image/webp"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;source</span> <span class="na">srcset=</span><span class="s">"{{ include.image }}"</span> <span class="err">{%</span> <span class="na">if</span> <span class="na">include.image</span> <span class="na">contains</span> <span class="err">'.</span><span class="na">jpg</span><span class="err">'</span> <span class="na">or</span> <span class="na">include.image</span> <span class="na">contains</span> <span class="err">'.</span><span class="na">jpeg</span><span class="err">'</span> <span class="err">%}</span><span class="na">type=</span><span class="s">"image/jpeg"</span><span class="err">{%</span> <span class="na">elsif</span> <span class="na">include.image</span> <span class="na">contains</span> <span class="err">'.</span><span class="na">png</span><span class="err">'</span> <span class="err">%}</span><span class="na">type=</span><span class="s">"image/png"</span> <span class="err">{%</span><span class="na">elsif</span> <span class="na">include.image</span> <span class="na">contains</span> <span class="err">'.</span><span class="na">gif</span><span class="err">'%}</span><span class="na">type=</span><span class="s">"image/gif"</span><span class="err">{%</span> <span class="na">endif</span> <span class="err">%}</span><span class="nt">&gt;</span>
    <span class="nt">&lt;img</span> <span class="na">class=</span><span class="s">"mx-auto"</span> <span class="na">src=</span><span class="s">"{{ include.image }}"</span> <span class="na">alt=</span><span class="s">"{{ include.alt | default: include.caption }}"</span> <span class="err">{{</span> <span class="na">include.width</span> <span class="err">?</span> <span class="na">include.width</span> <span class="err">|</span> <span class="na">prepend:</span> <span class="err">'</span><span class="na">width=</span><span class="s">"' | append: '"</span><span class="err">'</span> <span class="err">}}</span> <span class="err">{{</span> <span class="na">include.height</span> <span class="err">?</span> <span class="na">include.height</span> <span class="err">|</span> <span class="na">prepend:</span> <span class="err">'</span><span class="na">height=</span><span class="s">"' | append: '"</span><span class="err">'</span> <span class="err">}}</span><span class="nt">&gt;</span>
  <span class="nt">&lt;/picture&gt;</span>
  {% if include.caption %}<span class="nt">&lt;figcaption</span> <span class="na">class=</span><span class="s">"caption"</span><span class="nt">&gt;</span>{{ include.caption }}<span class="nt">&lt;/figcaption&gt;</span>{% endif -%}
<span class="nt">&lt;/figure&gt;</span>
</code></pre></div></div>

<p>Now all I have to do when using an image in a blogpost is provide both a webp and a jpg/png/gif file with the same filename, and use the following template:</p>

<div class="language-liquid highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">{%</span><span class="w"> </span><span class="nt">include</span><span class="w"> </span>img.html<span class="w"> </span><span class="na">image</span><span class="o">=</span><span class="s2">"/path/to/assets/image.jpg"</span><span class="w"> </span><span class="na">width</span><span class="o">=</span><span class="s2">"512px"</span><span class="w"> </span><span class="na">alt</span><span class="o">=</span><span class="s2">"Alternate text"</span><span class="w"> </span><span class="na">caption</span><span class="o">=</span><span class="s2">"A caption"</span><span class="w"> </span><span class="cp">%}</span>
</code></pre></div></div>

<p>I was already using Jekyll’s includes for a lot of things, such as the comments system, the articles of blogs I follow and other things. Its a really powerful tool that I quite like. However, editing each existing file could take me a long time. I actually did a <a href="https://benign.town/@joel/108564145793713657">poll on mastodon</a> to see what people would do. As of the writing of this post, most people say they would handle this by hand. And, to be honest, that’s kinda what I did, but I had some tricks up my sleve.</p>

<h1 id="vim-macros-to-the-rescue">Vim macros to the rescue</h1>

<p>Using macros with Vim is simply fantastic, I took a while to mention them, for some reason, all I had to do was implement 2 macros for the different kinds of markup I’ve used. Be it plain markdown (<code class="language-plaintext highlighter-rouge">![title](source)</code>) or plain html (<code class="language-plaintext highlighter-rouge">&lt;figure&gt;&lt;img&gt;&lt;/img&gt;&lt;figcaption&gt;&lt;/figcaption&gt;&lt;/figure&gt;</code>). There were a couple of edge cases, like when I included links inside of the captions and such.</p>

<p>There are many examples and videos that talk about doign Vim macros, so I will just share some videos of how they worked out.</p>

<p>For Markdown, I pretty much look for <code class="language-plaintext highlighter-rouge">![</code> and then used Vim keybindings to go word for word <code class="language-plaintext highlighter-rouge">w</code>, to the end of the line <code class="language-plaintext highlighter-rouge">$</code> and such, rinse and repeat.</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2022-06-30_macros.gif" type="image/webp" />
    <source srcset="/assets/img/blogs/2022-06-30_macros.gif" type="image/gif" />
    <img class="mx-auto" src="/assets/img/blogs/2022-06-30_macros.gif" alt="Macro used for Markdown syntax." />
  </picture>
  <figcaption class="caption">Macro used for Markdown syntax.</figcaption></figure>

<p>The steps to make a macro for HTML were a bit more complicated, but doable nonetheless.</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2022-06-30_macros2.gif" type="image/webp" />
    <source srcset="/assets/img/blogs/2022-06-30_macros2.gif" type="image/gif" />
    <img class="mx-auto" src="/assets/img/blogs/2022-06-30_macros2.gif" alt="Macro used for HTML syntax." />
  </picture>
  <figcaption class="caption">Macro used for HTML syntax.</figcaption></figure>

<p>My macro had some problems, since I was doing <code class="language-plaintext highlighter-rouge">dt"</code> to <em>delete</em> the contents of something un<em>til</em> a <em>quote</em> showed up, along other similar things, adding a link to a <code class="language-plaintext highlighter-rouge">figcaption</code> broke my macro in a couple cases. But other than that, it worked alright. I also had to run my macro from a certain position relative to the HTML, or else other things would not work properly.</p>

<p>I guess doing macros is pretty much its own artform, I’ve seen some uses for them that blew me away. If you have not used them for anything before, you might want to give them a try next time you script something!</p>

<h1 id="finishing-thoughts">Finishing thoughts</h1>

<p>If I am honest, I still don’t know how I feel about it making use of includes in this way, since making the changes here was kinda annoying. But, thinking about it, it only took me like half an hour to do. I don’t know, maybe simply using something like <code class="language-plaintext highlighter-rouge">xclip</code> or <code class="language-plaintext highlighter-rouge">xdotool</code> to quickly access the plain HTML template would be a lot better to keep my markdown platform agnostic. I will think about it, but for now Jekyll is still my platform of choice.</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="webdev" /><category term="coding" /><category term="vim" /><category term="jekyll" /><category term="fediverse" /><category term="blog" /><summary type="html"><![CDATA[I've not talked about Vim in a while, but today it was quite handy while setting up WebP fallbacks to support old browsers using Jekyll's includes feature]]></summary></entry><entry><title type="html">WebP conversion and code highlighting</title><link href="https://joelchrono.xyz/blog/jpg-conversion-and-code-highlighting/" rel="alternate" type="text/html" title="WebP conversion and code highlighting" /><published>2022-06-29T16:49:25-05:00</published><updated>2022-06-29T16:49:25-05:00</updated><id>https://joelchrono.xyz/blog/webp-conversion-and-code-highlighting</id><content type="html" xml:base="https://joelchrono.xyz/blog/jpg-conversion-and-code-highlighting/"><![CDATA[<p>When I started this website I actually tried for a while to compress my images whenever I used them for a blogpost or something, but at some point I stopped caring about it. Even when I talked about <a href="https://joelchrono.xyz/blog/add-images-to-markdown-files-(for-jekyll)/">image management with Jekyll</a> I didn’t even mentioned using WebP, but simple ImageMagick commands.</p>

<h1 id="converting-images-to-webp">Converting images to WebP</h1>

<p>I decided to fix that today, by installing the <a href="https://developers.google.com/speed.jpg/download">WebP tools provided by Google</a>, and available in some repos (not Fedora, for some reason) and with some very simple bash scripts which pretty much did this:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$IMGFILES</span><span class="o">=</span><span class="s2">"/path/to/assets"</span>
<span class="nv">$POSTS</span><span class="o">=</span><span class="s2">"/path/to/posts"</span>

<span class="k">for </span>f <span class="k">in</span> <span class="nv">$FILES</span>
<span class="k">do
  </span><span class="nb">echo</span> <span class="s2">"Processing </span><span class="nv">$f</span><span class="s2"> file..."</span>
  <span class="c"># take action on each file. $f store current file name</span>
  .jpg <span class="nt">-q</span> 85 <span class="s2">"</span><span class="nv">$f</span><span class="s2">"</span> <span class="nt">-o</span> <span class="s2">"</span><span class="k">${</span><span class="nv">f</span><span class="p">%.*</span><span class="k">}</span><span class="s2">.jpg"</span><span class="p">;</span>
  <span class="c">#cat "$f"</span>
<span class="k">done

</span><span class="nb">sed</span> <span class="nt">-i</span> <span class="s1">'s/.jpg/.jpg/g'</span> <span class="nv">$POSTS</span>/<span class="k">*</span>
<span class="nb">sed</span> <span class="nt">-i</span> <span class="s1">'s/.png/.jpg/g'</span> <span class="nv">$POSTS</span>/<span class="k">*</span>
</code></pre></div></div>

<p>I would not recommend running this script. I actually had to take care of some posts that mentioned <code class="language-plaintext highlighter-rouge">.png</code> or <code class="language-plaintext highlighter-rouge">.jpg</code> somewhere without actually using an image, such as other scripts and stuff like that. I also had some images that were in other subfolders and such, so this took a couple extra minutes.</p>

<p>It really was nothing special though, the changes were done pretty quickly and now my website is overall lighter than before, which I guess its a good thing.</p>

<p>I was quite inspired by <a href="https://1mb.club/blog/batch.jpg-conversion/">this post</a> by <a href="https://tdarb.org/">Bradley Taunt</a>, so go check him out too, although you probably already know him if you are into web development and such.</p>

<h1 id="enabling-code-highlighting-on-my-website">Enabling Code Highlighting on my website</h1>

<p>Also, as you might have noticed on the code snipped above, I finally got code hightlighting to work. I had enabled it a long time ago, since its not really a hard feature to <a href="https://jekyllrb.com/docs/liquid/tags/#code-snippet-highlighting">add to Jekyll</a>, but all this time I never bothered to setup the CSS file, since I could not find one available, even though <a href="https://github.com/jwarby/jekyll-pygments-themes">there are other ones</a>. But I came across <a href="https://github.com/sbrisard/nord_pygments">this repo</a> and got it working, I had to <code class="language-plaintext highlighter-rouge">pip install pygments</code> and then run the instructions in the repo. To generate the CSS file I also ran this:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pygmentize <span class="nt">-S</span> nord <span class="nt">-f</span> html <span class="nt">-a</span> .highlight
</code></pre></div></div>

<p>You can pipe that into a CSS file, or paste it to your already existing file if you are lazy like me.</p>

<p>I am so happy I took the time to do this since now my <a href="https://joelchrono.xyz/tags/coding">coding</a> blogs are going to look a lot better, which is awesome. Sadly I have to manually check which code snippets do not define which language is used, since those are not gonna get colored. That’s a job for future me, I guess. If you check any post without syntax highlighting let me know by <a href="https://joelchrono.xyz/contact/">contacting me!</a></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="webdev" /><category term="jekyll" /><summary type="html"><![CDATA[I had been careless about image formats on my website, but I decided to put some work and convert them all to WebP. Also, I got the Nord color scheme to work on my code!]]></summary></entry><entry><title type="html">New logo and other changes</title><link href="https://joelchrono.xyz/blog/new-logo-and-other-changes/" rel="alternate" type="text/html" title="New logo and other changes" /><published>2022-06-24T11:37:52-05:00</published><updated>2022-06-24T11:37:52-05:00</updated><id>https://joelchrono.xyz/blog/new-logo-and-other-changes</id><content type="html" xml:base="https://joelchrono.xyz/blog/new-logo-and-other-changes/"><![CDATA[<h1 id="other-site-changes">Other site changes</h1>

<p>So if you visited my website today morning you might have a couple differences compared to yesterday. I always enjoy changing and improving the look and feel of my internet home.</p>

<p>As you probably already know, I use <a href="https://jekyllrb.com">Jekyll</a> to generate my site, and I quite like how powerful it is, but sometimes it gets a little annoying. I was using <a href="https://github.com/syldexiahime/jekyll-webring/">jekyll-webring</a> to automatically generate a list of articles from different websites and blogs I follow. However, it was proving quite annoying while testing changes, since serving the site locally took like 30 seconds to complete, and it kinda looped the generation sometimes, making my CPU fan spin a ton.</p>

<p>I’ve decided to remove it and go back to <a href="https://git.sr.ht/~sircmpwn/openring">openring</a>, which I was already using before, and do a simple script to create the file locally myself.</p>

<p>Other than that I also changed the way my archive is displayed. Before, I had a simple list of articles, which was fine, but the right side felt kinda empty on the desktop. I tried adding the date, and even tags in previous attempts, but it ended up looking too cluttered on mobile. Eventually, I went ahead and <del>shamelessly copied</del> got really inspired by <a href="https://chriswiegman.com">Chris Wiegman’s</a> website, so now my article archive is shown in a grid, there is a hover animation, the article title wraps without moving the date from its place, its pretty nice now.</p>

<p>I also applied that styling to the tag pages. In case you didn’t know you can access <a href="/tags/">all posts of a certain tag</a>, and even follow an RSS feed of it, which may be quite useful if you only care about some topics of mine. Its particularly nice if your RSS reader supports hiding posts with the same titles, like FreshRSS.</p>

<h1 id="a-new-logo">A new logo</h1>

<p>This is not really that big of a deal, but I wanted to have a new favicon and logo for my website, I had been using a character from <a href="https://joelchrono12.itch.io/swap-die-repeat">my first game jam entry</a>, and since it was pixel art, it looked fairly good as a favicon. I mean, I already know how to use Inkscape and I’ve done icons and stuff, so it was about time.</p>

<p>I was a little inspired by Kev Quirk’s logo design, where its pretty much just his initials arranged in a very cool manner, but the event that triggered my desire to do this was actually <a href="https://warmedal.se/~bjorn/index.html">Björn Wärmedal</a> and his cup emoji icon that I thought looked super awesome.</p>

<p>However, I wanted to have something that was a bit more representative of me and what I liked. At first, I went a little too crazy, and started with something like this:</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2022-06-24-favicon_v1.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2022-06-24-favicon_v1.jpg" type="image/jpeg" />
    <img class="mx-auto" src="/assets/img/blogs/2022-06-24-favicon_v1.jpg" alt="My initial logo idea" width="512px" />
  </picture>
  <figcaption class="caption">I can't believe I thought this was decent enough to export</figcaption></figure>

<p>it has too many colors and it would never have worked as a favicon. <del>Un</del>fortunately I lost the original file, since I was working on top of it during some time and eventually got lost in the undo history.</p>

<p>In this design I used the C from Chrono Trigger’s title screen, since I’ve said countless times how its my favorite game. I made the logo with Inkscape, and it is actually a modification from the one I did for the Arcticons Icon pack.</p>

<p>The J is from my name, and the font comes <a href="http://www.thealmightyguru.com/GameFonts/Series-ChronoTrigger.html">from here</a>. Its based on the font used in the game text boxes and dialogues, so I thought it was quite fitting. Eventually ending up this logo, which I actually pushed to my site for a few hours before this article was written.</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2022-06-24-favicon_v2.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2022-06-24-favicon_v2.jpg" type="image/jpeg" />
    <img class="mx-auto" src="/assets/img/blogs/2022-06-24-favicon_v2.jpg" alt="An improved and simplified version" width="512px" />
  </picture>
  <figcaption class="caption">I was pretty happy with this one, not gonna lie!</figcaption></figure>

<p>However, while the pixel art font was cool and all, and I can justify it with my love for emulation and retro games, I kinda wanted to have something different and simpler, more minimal.</p>

<p>I decided to look for some fonts that kinda looked like origami, and I stumbled upon <a href="https://creiden.com/free-origami-letters/">this one</a>. So I downloaded it and pasted that J in its place, and ended up with my (for now) current logo!</p>

<figure class="img">
  <picture>
    <source srcset="/assets/img/logo.webp" type="image/webp" />
    <source srcset="/assets/img/logo.jpg" type="image/jpeg" />
    <img class="mx-auto" src="/assets/img/logo.jpg" alt="Current logo" width="512px" />
  </picture>
  <figcaption class="caption">My current choice, maybe it'll change in the future again...</figcaption></figure>

<h1 id="conclusion">Conclusion</h1>

<p>I was thinking about maybe setting the clock inside of the C to say its 12 o’clock, but I didn’t really feel like it, it just doesn’t look right.</p>

<p>I made other small changes here and there in my website, I am always fiddling around so it was about time I made another one of these posts.</p>

<p>Anyways, that’s all for today folks.</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="blog" /><category term="webdev" /><category term="design" /><category term="coding" /><summary type="html"><![CDATA[I was really bored, so I made a new logo for my website, inspired, as always, by other people's blogs.]]></summary></entry><entry><title type="html">Change URLs without breaking old links in Jekyll</title><link href="https://joelchrono.xyz/blog/change-urls-without-breaking-old-links/" rel="alternate" type="text/html" title="Change URLs without breaking old links in Jekyll" /><published>2022-06-23T16:13:35-05:00</published><updated>2022-06-23T16:13:35-05:00</updated><id>https://joelchrono.xyz/blog/change-urls-without-breaking-old-links-in-jekyll</id><content type="html" xml:base="https://joelchrono.xyz/blog/change-urls-without-breaking-old-links/"><![CDATA[<p>When I started this blog using Jekyll I was amazed at the power it had, using simple plain markdown files and some yaml metadata. One of my favorite features is adding a custom permalink for each blog, which lets me change it from the default, for example, this post would normally have the following URL:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://joelchrono12.xyz/2022/06/23/change-urls-without-breaking-old-links-in-jekyll.html
</code></pre></div></div>

<p>However, by setting a <code class="language-plaintext highlighter-rouge">permalink</code> in the yaml metadata, I can simply have something like:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://joelchrono12.xyz/blog/change-urls-without-breaking-old-links/
</code></pre></div></div>

<p>Which is shorter and easier to type.</p>

<p>However, before doing my <a href="https://joelchrono.xyz/blog/rofi-automated-blog/">rofi script for automatic post creation</a> I initially created my markdown files by hand, and I didn’t really had a format to follow, some of my posts had <code class="language-plaintext highlighter-rouge">/blog/post.title</code>, others had no permalink set at all, and others just had <code class="language-plaintext highlighter-rouge">/post.title</code>.</p>

<p>This means that the generated static files are all over the place, and I kinda wanted to clean that up.</p>

<p>The solution is really simple. I just installed the <a href="https://github.com/jekyll/jekyll-redirect-from">jekyll-redirect-from</a> plugin. After reading the README in their repo, I realized this was exactly what I needed. I won’t really explain it here since its fairly easy to do, but feel free to ask me if you feel like it.</p>

<p>You can test out how the plugin works on my website, here are some of the old URLs that should now redirect you to the new one. You may also find some of those old posts of mine kinda interesting too!</p>

<ul>
  <li><a href="/newpipe-over-vanced/">A comparison on Newpipe and Youtube Vanced</a></li>
  <li><a href="/privacy-android-browsers/">Privacy focused browsers for Android</a></li>
  <li><a href="/request-forgiveness-for-small-things/">Asking for forgiveness for small things</a></li>
  <li><a href="/changing-android-rom/">Changing my Android custom rom</a></li>
</ul>

<p>Even in those old articles I link to some more posts that are still using a different format, which will be redirected too. If you found this useful please let me know!</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="tutorial" /><category term="jekyll" /><category term="webdev" /><summary type="html"><![CDATA[Using Jekyll and static site generators comes with its own set of problems, one of them is changing URL formats without breaking the previously used links. Thankfully, the solution is fairly simple.]]></summary></entry><entry><title type="html">Sharing my blogs to the Fediverse automatically</title><link href="https://joelchrono.xyz/blog/sharing-my-blogs-to-the-fediverse-automatically/" rel="alternate" type="text/html" title="Sharing my blogs to the Fediverse automatically" /><published>2022-06-10T20:00:34-05:00</published><updated>2022-06-10T20:00:34-05:00</updated><id>https://joelchrono.xyz/blog/sharing-my-blogs-to-the-fediverse-automatically</id><content type="html" xml:base="https://joelchrono.xyz/blog/sharing-my-blogs-to-the-fediverse-automatically/"><![CDATA[<p>There are many problems that come when you don’t use some CMS like Wordpress or Ghost, and this is one of them. When I <a href="https://joelchrono.xyz/blog/how-to-add-mastodon-comments-to-jekyll-blog/">chose Mastodon as commenting system for my blog</a> I realized it would be quite a process to share my post and get the comment section working. I had already <a href="https://joelchrono.xyz/blog/rofi-automated-blog/">automated the blog creation process</a>, but I still had to do all this:</p>

<ul>
  <li>finish writing</li>
  <li>git add, git commit, git push</li>
  <li>write toot on mastodon sharing my blogpost</li>
  <li>copy toot link</li>
  <li>paste toot link id on original blogpost</li>
  <li>git add, git commit, git push</li>
  <li>comments section now works!</li>
</ul>

<p>However, I decided to summon the power of the command line and bash scripting once again, and I finally managed to automate pretty much all of it.</p>

<p>It depends on some basic tools such as <code class="language-plaintext highlighter-rouge">sed</code>, <code class="language-plaintext highlighter-rouge">cut</code>, <code class="language-plaintext highlighter-rouge">grep</code>, but it also requires a very simple mastodon client for the command line, <code class="language-plaintext highlighter-rouge">toot</code>, you probably have it all installed already, and toot is not hard to setup either way.</p>

<p>There really is not a lot to talk about other than this. Here is the script, its not really super clean or anything (any suggestion are absolutely welcome) but at least its serviceable.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/usr/bin/bash</span>

<span class="k">if </span>git rev-parse <span class="nt">--git-dir</span> <span class="o">&gt;</span> /dev/null 2&gt;&amp;1<span class="p">;</span> <span class="k">then</span>
    : <span class="c"># This is a valid git repository</span>

    <span class="c"># All markdown files start with YYYY-MM-DD</span>
    <span class="nv">lastpost</span><span class="o">=</span><span class="si">$(</span>/usr/bin/ls <span class="k">${</span><span class="nv">markdown_posts_folder</span><span class="k">}</span>/<span class="k">*</span>.md | <span class="nb">sort</span> <span class="nt">-r</span> | <span class="nb">head</span> <span class="nt">-n</span> 1<span class="si">)</span> 
    <span class="nv">getdesc</span><span class="o">=</span><span class="si">$(</span><span class="nb">grep</span> <span class="s2">"description:"</span> <span class="nv">$lastpost</span> | <span class="nb">cut</span> <span class="nt">-d</span> <span class="s2">" "</span> <span class="nt">-f2-</span><span class="si">)</span>
    <span class="nv">geturl</span><span class="o">=</span><span class="si">$(</span><span class="nb">grep</span> <span class="s2">"permalink:"</span> <span class="nv">$lastpost</span> | <span class="nb">cut</span> <span class="nt">-d</span> <span class="s2">" "</span> <span class="nt">-f2-</span><span class="si">)</span>
    <span class="nv">gettags</span><span class="o">=</span><span class="si">$(</span><span class="nb">grep</span> <span class="s2">"tags:"</span> <span class="nv">$lastpost</span> | <span class="nb">cut</span> <span class="nt">-d</span> <span class="s2">" "</span> <span class="nt">-f2-</span> | <span class="nb">sed</span> <span class="nt">-r</span> <span class="s1">'s/([^ ]+)/#\1/g'</span><span class="si">)</span>
    <span class="nv">post</span><span class="o">=</span><span class="si">$(</span><span class="nb">echo</span> <span class="nt">-e</span> <span class="s2">"</span><span class="k">${</span><span class="nv">getdesc</span><span class="k">}</span><span class="s2"> </span><span class="se">\n\n</span><span class="s2">https://joelchrono.xyz/</span><span class="k">${</span><span class="nv">geturl</span><span class="k">}</span><span class="s2"> </span><span class="se">\n\n</span><span class="k">${</span><span class="nv">gettags</span><span class="k">}</span><span class="s2"> #blogpost"</span><span class="si">)</span>
    <span class="nv">posturl</span><span class="o">=</span><span class="si">$(</span>toot post <span class="s2">"</span><span class="nv">$post</span><span class="s2">"</span> | <span class="nb">cut</span> <span class="nt">-d</span>/ <span class="nt">-f5</span><span class="si">)</span>
    <span class="nb">echo</span> <span class="nv">$posturl</span>
    <span class="nb">sed</span> <span class="nt">-i</span> <span class="s2">"s/commentsid/</span><span class="nv">$posturl</span><span class="s2">/g"</span> <span class="s2">"</span><span class="nv">$lastpost</span><span class="s2">"</span>

    git add <span class="k">*</span>
    git commit <span class="nt">-m</span> <span class="s2">"automatically added comments"</span>
    git push

    <span class="nb">exit</span>

<span class="c"># directory may not be the top level.</span>
<span class="c"># Check the output of the git rev-parse command if you care</span>
<span class="k">else</span>
    : <span class="c"># this is not a git repository</span>
    <span class="nb">echo</span> <span class="s2">"Run this inside of website folder"</span>
    <span class="nb">exit

</span><span class="k">fi</span>
</code></pre></div></div>

<p>There you go, I hope you find it useful, maybe you can improve it even further. If so, make sure to let me know, I am still learning these things.</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="blog" /><category term="tutorial" /><category term="coding" /><category term="bash" /><category term="linux" /><category term="git" /><category term="webdev" /><category term="blog" /><summary type="html"><![CDATA[I always share my blogposts on Mastodon when I am done writing them, but it has always been a little annoying to do so. Not anymore.]]></summary></entry><entry><title type="html">Using Jekyll’s collections to share origami</title><link href="https://joelchrono.xyz/blog/using-jekyll-collections-to-share-origami/" rel="alternate" type="text/html" title="Using Jekyll’s collections to share origami" /><published>2022-05-29T19:50:12-05:00</published><updated>2022-05-29T19:50:12-05:00</updated><id>https://joelchrono.xyz/blog/using-jekyll-collections-to-share-origami</id><content type="html" xml:base="https://joelchrono.xyz/blog/using-jekyll-collections-to-share-origami/"><![CDATA[<p>So I had been meaning to add different forms of content on my blog, having sections for stuff that I don’t really consider a proper blogpost, but I never really had the time, and I didn’t really generate enough diverse content for me to try setting it up, until recently.</p>

<p>I have been working for my University during the last few months, but I don’t really have to do a lot of the time, so I recently picked up on my oldest hobby, origami.</p>

<p>I love origami, and I’ve been meaning to talk about it almost since I started this blog, but I’ve not put much effort into even trying. But since I had done quite a lot of folds lately, and had already taken a bunch of pictures of them, all I had to do was put them together and organize them a little bit.</p>

<p>This is not a tutorial, <a href="https://jekyllrb.com/docs/collections/">Jekyll’s documentation is pretty decent on this topic</a>, so I’ll just share the small changes I did for my use case.</p>

<p>My <code class="language-plaintext highlighter-rouge">_config.yml</code> file had these lines added</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">collections</span><span class="pi">:</span>
  <span class="na">origami</span><span class="pi">:</span>
    <span class="na">output</span><span class="pi">:</span> <span class="kc">true</span>
<span class="na">feed</span><span class="pi">:</span>
  <span class="na">collections</span><span class="pi">:</span>
    <span class="na">origami</span><span class="pi">:</span>
      <span class="na">path</span><span class="pi">:</span> <span class="s2">"</span><span class="s">/origami.xml"</span>
</code></pre></div></div>

<p>I am using the <a href="https://github.com/jekyll/jekyll-feed">jekyll-feed</a> plugin, which should already be used by your blog if you provide RSS feeds!</p>

<p>After doing those changes I created an <code class="language-plaintext highlighter-rouge">origami.md</code> file in my website’s root directory that served as a template. It has some metadata that is not really that important but this is the main thing. You can always access <a href="https://github.com/joelchrono12/joelchrono12.ml">my website’s source code</a> too.</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;div&gt;</span>
 <span class="nt">&lt;table&gt;</span>
  <span class="nt">&lt;tr&gt;</span>
    <span class="nt">&lt;th&gt;</span>Model<span class="nt">&lt;/th&gt;</span>
    <span class="nt">&lt;th&gt;</span>Author<span class="nt">&lt;/th&gt;</span>
    <span class="nt">&lt;th&gt;</span>Tutorial<span class="nt">&lt;/th&gt;</span>
    <span class="nt">&lt;th</span> <span class="na">style=</span><span class="s">"text-align: right"</span><span class="nt">&gt;</span>Photo<span class="nt">&lt;/th&gt;</span>
  <span class="nt">&lt;/tr&gt;</span>
{% for origami in site.origami reversed %}
  <span class="nt">&lt;tr&gt;</span>
    <span class="nt">&lt;td&gt;&lt;a</span> <span class="na">href=</span><span class="s">"{{ origami.url }}"</span><span class="nt">&gt;</span>{{ origami.title }}<span class="nt">&lt;/a&gt;&lt;/td&gt;</span>
    <span class="nt">&lt;td&gt;&lt;a</span> <span class="na">href=</span><span class="s">"{{ origami.creator.site }}"</span><span class="nt">&gt;</span>{{ origami.creator.name }}<span class="nt">&lt;/a&gt;&lt;/td&gt;</span>
    {% if origami.tutorial %}
    <span class="nt">&lt;td&gt;&lt;a</span> <span class="na">href=</span><span class="s">"{{ origami.tutorial }}"</span><span class="nt">&gt;</span>Yes<span class="nt">&lt;/a&gt;&lt;/td&gt;</span>
    {% else%}
    <span class="nt">&lt;td&gt;</span>No<span class="nt">&lt;/td&gt;</span>
    {% endif %}
    <span class="nt">&lt;td</span> <span class="na">style=</span><span class="s">"text-align: right"</span><span class="nt">&gt;&lt;img</span> <span class="na">width=</span><span class="s">"210px"</span> <span class="na">src=</span><span class="s">"{{ origami.image }}"</span>
    <span class="na">alt=</span><span class="s">"{{ origami.description }}"</span> <span class="na">title=</span><span class="s">"{{ origami.description }}"</span><span class="nt">&gt;&lt;/td&gt;</span>
  <span class="nt">&lt;/tr&gt;</span>
{% endfor %}
<span class="nt">&lt;/table&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</code></pre></div></div>

<p>Now all I had to do was create files inside a directory named <code class="language-plaintext highlighter-rouge">_origami</code>, add some metadata in YAML format, in between dashes, and call it a day. Like the following example.</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">layout</span><span class="pi">:</span> <span class="s">origami</span>
<span class="na">header</span><span class="pi">:</span> <span class="s">Owl by Nguyễn Hùng Cường</span>
<span class="na">title</span><span class="pi">:</span> <span class="s">Owl</span>
<span class="na">creator</span><span class="pi">:</span>
    <span class="na">name</span><span class="pi">:</span> <span class="s">Nguyễn Hùng Cường</span>
    <span class="na">site</span><span class="pi">:</span> <span class="s">https://www.flickr.com/people/blackscorpion/</span>
<span class="na">tutorial</span><span class="pi">:</span> <span class="s">https://youtu.be/DExjwwnKCAY</span>
<span class="na">date</span><span class="pi">:</span> <span class="s">2022-05-05</span>
<span class="na">description</span><span class="pi">:</span> <span class="s2">"</span><span class="s">An</span><span class="nv"> </span><span class="s">Owl</span><span class="nv"> </span><span class="s">with</span><span class="nv"> </span><span class="s">a</span><span class="nv"> </span><span class="s">great</span><span class="nv"> </span><span class="s">3D</span><span class="nv"> </span><span class="s">look,</span><span class="nv"> </span><span class="s">really</span><span class="nv"> </span><span class="s">smooth</span><span class="nv"> </span><span class="s">and</span><span class="nv"> </span><span class="s">clean</span><span class="nv"> </span><span class="s">looking."</span>
<span class="na">image</span><span class="pi">:</span> <span class="s">/assets/img/origami/owl_nhc.jpg</span>
</code></pre></div></div>

<p>So, anyways, its pretty simple to do. I wanted to get back into writing since it had been a while, so this is pretty much it. Thanks for reading!</p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="art" /><category term="blog" /><category term="webdev" /><category term="jekyll" /><summary type="html"><![CDATA[I created a new section on my website to share my origami posts, which have taken over my Mastodon account lately. I decided to have a section where I share pictures of them and tutorials (if available).]]></summary></entry><entry><title type="html">Add images to Markdown files (for Jekyll)</title><link href="https://joelchrono.xyz/blog/add-images-to-markdown-files-(for-jekyll)/" rel="alternate" type="text/html" title="Add images to Markdown files (for Jekyll)" /><published>2022-01-27T10:16:00-06:00</published><updated>2022-01-27T10:16:00-06:00</updated><id>https://joelchrono.xyz/blog/add-images-to-markdown-files-(for-jekyll)</id><content type="html" xml:base="https://joelchrono.xyz/blog/add-images-to-markdown-files-(for-jekyll)/"><![CDATA[<p>So I have already done quite a lot of posts to make the creation of new posts easier. I find Jekyll to be a pretty decent static site generator, but this little script should work with whatever you got. As long as you customize it to your file structure.</p>

<p>The script comes as a request by <a href="https://fosstodon.org/@celia">Ru</a>, or at least this is what I hope she meant when <a href="https://fosstodon.org/@celia/107694900078045072">she posted</a>:</p>

<blockquote>
  <p>Static site users who embed images frequently – what’s your workflow for it? #AskFedi</p>
</blockquote>

<p>Well, my <em>previous workflow</em> was simple enough:</p>

<ol>
  <li>Take pictures.</li>
  <li>Move to assets folder.</li>
  <li>Rename them to something like $date-$filename_without_spaces.png.</li>
  <li>Add markdown syntax and type the whole thing.</li>
  <li>Cry because you messed up the directory path.</li>
</ol>

<p>So I went ahead and decided to work on a little script I named <code class="language-plaintext highlighter-rouge">aijk</code> (Add image to Jekyll), using bash and rofi, tools that I’ve used before with decent success. I am actually really happy of how it turned out.</p>

<h1 id="the-script">The script</h1>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>

<span class="c">### AIJK (Add image to Jekyll)</span>
<span class="c">### By joelchrono12</span>

<span class="nv">pic</span><span class="o">=</span><span class="nv">$1</span>
<span class="nv">name</span><span class="o">=</span><span class="si">$(</span>rofi <span class="nt">-l</span> 0 <span class="nt">-width</span> 50 <span class="nt">-p</span> <span class="s2">"Title"</span> <span class="nt">-dmenu</span><span class="si">)</span>
<span class="nv">filen</span><span class="o">=</span><span class="si">$(</span><span class="nb">echo</span> <span class="nv">$name</span> | <span class="nb">tr</span> <span class="s2">" ,.!"</span> <span class="s2">"-"</span>| <span class="nb">awk</span> <span class="s1">'{print tolower($0)}'</span><span class="si">)</span>
<span class="nv">today</span><span class="o">=</span><span class="si">$(</span><span class="nb">date</span> +<span class="s2">"%Y-%m-%d"</span><span class="si">)</span>
<span class="nv">filename</span><span class="o">=(</span><span class="nv">$today</span>-<span class="nv">$filen</span><span class="o">)</span>
<span class="nv">path</span><span class="o">=</span>/path/to/website <span class="c">#without / at the end</span>
<span class="nv">imgs</span><span class="o">=</span>/from/site_root/to/assets/ <span class="c">#example = /assets/img/blogs/</span>
<span class="nv">last_post</span><span class="o">=</span><span class="si">$(</span>/usr/bin/ls /path/to/markdown/files/<span class="k">*</span>.md | <span class="nb">sort</span> <span class="nt">-r</span> | <span class="nb">head</span> <span class="nt">-n</span> 1<span class="si">)</span>

convert <span class="nv">$1</span> <span class="nt">-quality</span> 75 <span class="k">${</span><span class="nv">path</span><span class="k">}${</span><span class="nv">imgs</span><span class="k">}${</span><span class="nv">filename</span><span class="k">}</span>.png

<span class="nb">printf</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">![</span><span class="k">${</span><span class="nv">name</span><span class="k">}</span><span class="s2">](</span><span class="k">${</span><span class="nv">imgs</span><span class="k">}${</span><span class="nv">filename</span><span class="k">}</span><span class="s2">.png)"</span> <span class="o">&gt;&gt;</span> <span class="nv">$last_post</span>

</code></pre></div></div>

<h2 id="how-to-use">How to use</h2>

<p>Once added to your $PATH and making it executable, all you need is to change the required paths in the script, I think most of you will be able to figure it out on your own, but reach me out if you need help.</p>

<p>You can run it just by doing this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>aijk file.png
</code></pre></div></div>

<p>This is how it works:</p>

<ul>
  <li>Obtain picture file from argument.</li>
  <li>Add a Title to file via a rofi input.</li>
  <li>Create filename for file itself.</li>
  <li>Set paths to different required things (depends on your site).</li>
  <li>Get the latest markdown files from your site.</li>
  <li>Make changes to picture so its smaller or whatever (can be customized, requires ImageMagick).</li>
  <li>Print formatted markdown line to bottom of the latest markdown file.</li>
</ul>

<h2 id="adding-a-graphical-option-for-mouse-users">Adding a Graphical option for mouse users</h2>

<p>You can run this script with absolute ease from your terminal, if that’s what you want, but I also figured out a way to do it from a GUI if you are using Thunar as a file manager (might be possible with others, haven’t checked).</p>

<ol>
  <li>Open Thunar &gt; Edit &gt; Configure custom actions.</li>
  <li>Add a new entry for <code class="language-plaintext highlighter-rouge">aijk</code> and save it.</li>
</ol>
<figure class="img">
  <picture>
    <source srcset="/assets/img/blogs/2022-01-27-thunar-configuration.webp" type="image/webp" />
    <source srcset="/assets/img/blogs/2022-01-27-thunar-configuration.jpg" type="image/jpeg" />
    <img class="mx-auto" src="/assets/img/blogs/2022-01-27-thunar-configuration.jpg" alt="" />
  </picture>
  </figure>

<ol>
  <li>Set the appearance conditions to images only.</li>
  <li>Right click on any image to try it out!</li>
</ol>

<h1 id="final-thoughts">Final thoughts</h1>

<p>I am not completely happy with how this works. But this is usable and easy to expand, there could be a way to select the destination file instead of just getting the latest one. But I don’t normally add new images to old posts anyways, so I figured most people would be ok with how this works right now.</p>

<p>The script also assumes you want to start all your files with the date, and that your markdown files also start with the dates, since <code class="language-plaintext highlighter-rouge">sort</code>  will fail to place the line in the latest file, if such file is not the first in its output.</p>

<p>There is also no way to do this with multiple files as of now, I might be able to come up with something, I could just create another script that makes use of this one to make multiple additions at once.</p>

<p>Anyways, this is what I’ll do now to add images, I will simply right click, click again and give them a name!. Or do it properly in the terminal, whatever fits me best.</p>

<p>This has been day 95 of <a href="https://100daystooffload.com">#100DaysToOffload</a>. Make sure to check out <a href="https://rusingh.com/">Ru’s website</a>, since she single-handedly managed to inspire me to work on this quick script.</p>

<p><strong>NOTE: This is actually day 96, from here it all went wrong. If you don’t understand this note, [read here]</strong></p>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="tutorial" /><category term="coding" /><category term="bash" /><category term="linux" /><category term="webdev" /><category term="blog" /><category term="jekyll" /><summary type="html"><![CDATA[I decided to streamline the process of adding images to new posts quickly, how did I do it? Using bash scripts of course!]]></summary></entry><entry><title type="html">How to add comments to Jekyll blog</title><link href="https://joelchrono.xyz/blog/how-to-add-mastodon-comments-to-jekyll-blog/" rel="alternate" type="text/html" title="How to add comments to Jekyll blog" /><published>2021-12-29T09:20:00-06:00</published><updated>2021-12-29T09:20:00-06:00</updated><id>https://joelchrono.xyz/blog/adding-mastodon-comments-to-jekyll-blog-2022</id><content type="html" xml:base="https://joelchrono.xyz/blog/how-to-add-mastodon-comments-to-jekyll-blog/"><![CDATA[<p>As it usually is, I have already talked about this topic before, but I recently
did some changes both to the code and the styling of it, to make it better than
before, if I do say so myself.</p>

<p>First, I am going to credit every source of inspiration I got this from.
The original form of my commenting system was based on GitHub, I got it from
<a href="https://aristath.github.io/blog/static-site-comments-using-github-issues-api">an amazing post</a>
by <a href="https://github.com/aristath">Aristath</a>. This is where most of my
current code is based on. In this case, however, I am using Mastodon’s API instead of
GitHub’s since I think that most of my readers use Mastodon or are part of the
<a href="https://en.wikipedia.org/wiki/Fediverse">Fediverse</a>.</p>

<p>Secondly, is the first iteration of Mastodon’s code system I used, which I read
in <a href="https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/">Carl Schwan’s post about it</a>, this is what I used for a while, with GitHub in the mix too.</p>

<p>After a while, Mastodon comments proved to be a lot more common and easy to set
up, and I eventually stopped using GitHub, because it also required quite a lot
of steps to set it up, compared to just posting in Mastodon.</p>

<p>At some point, I decided to rewrite Mastodon’s commenting code with a structure
similar to GitHub’s, and I landed on this.</p>

<h1 id="jekyll-set-up">Jekyll set up</h1>

<p>To get started, I created a <code class="language-plaintext highlighter-rouge">comments.html</code> file inside the <code class="language-plaintext highlighter-rouge">_includes</code> directory which is part of Jekyll’s structure. This way, you could add it to your <code class="language-plaintext highlighter-rouge">_layouts</code>folder, or any section of your blog, and just add <code class="language-plaintext highlighter-rouge">{% include comments.html %}</code>, to tell Jekyll to insert that bit of code in there.</p>

<p>In order for said code to work, we are also going to need some metadata located inside of the front matter of each markdown file, in this case, we add the this:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">host</span><span class="pi">:</span> <span class="s">fosstodon.org</span>
<span class="na">username</span><span class="pi">:</span> <span class="s">joel</span>
<span class="na">com_id</span><span class="pi">:</span> <span class="m">107526114775171486</span>

</code></pre></div></div>
<p>Finally, we are going to start writing the HTML file that is going to be called
by every post we make!</p>

<h1 id="front-end">Front end</h1>

<p>Edit <code class="language-plaintext highlighter-rouge">comments.html</code> and place the following lines:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">href=</span><span class="s">"/assets/css/comments.css"</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"article-content"</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">"comments-list"</span><span class="nt">&gt;&lt;/div&gt;</span>
<span class="nt">&lt;noscript&gt;&lt;p&gt;</span>You need JavaScript to view comments here.<span class="nt">&lt;/p&gt;&lt;/noscript&gt;</span>
<span class="nt">&lt;a</span> <span class="na">id=</span><span class="s">"load-comment"</span><span class="nt">&gt;</span>Load comments<span class="nt">&lt;/a&gt;</span> 
<span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">"https://fosstodon.org/interact/107531143511314399?=type=reply"</span><span class="nt">&gt;</span>Reply via Mastodon<span class="nt">&lt;/a&gt;&lt;br&gt;</span>
<span class="nt">&lt;script </span><span class="na">src=</span><span class="s">"/assets/js/purify.js"</span><span class="nt">&gt;&lt;/script&gt;</span>
<span class="nt">&lt;script&gt;</span>
    <span class="c1">//Here will be the rest of the code</span>
<span class="nt">&lt;/script&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</code></pre></div></div>

<p>The first line will call some specific styling that you should add if you would
like to style or make it fit better. You could use mine, but I can’t promise it
will work properly on your site.</p>

<p>Secondly, we have some <code class="language-plaintext highlighter-rouge">div</code> elements that are not really that important, it is
up to your CSS too.</p>

<p>Last, we call a couple of script elements that will contain the main JavaScript
code we’ll use.</p>

<h1 id="the-good-stuff">The good stuff</h1>

<p>Next we are going to add the main code will need to make all of this work as we
expect. This bit is going to print the comments by calling a different function
that will give format to each element.</p>

<h2 id="main-function">Main function</h2>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">document</span><span class="p">.</span><span class="nf">getElementById</span><span class="p">(</span><span class="dl">'</span><span class="s1">load-comment</span><span class="dl">'</span><span class="p">).</span><span class="nf">addEventListener</span><span class="p">(</span><span class="dl">"</span><span class="s2">click</span><span class="dl">"</span><span class="p">,</span> <span class="k">async </span><span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span>
    <span class="nb">document</span><span class="p">.</span><span class="nf">getElementById</span><span class="p">(</span><span class="dl">'</span><span class="s1">load-comment</span><span class="dl">'</span><span class="p">).</span><span class="nf">remove</span><span class="p">();</span>
    <span class="kd">const</span> <span class="nx">response</span> <span class="o">=</span> <span class="k">await</span> <span class="nf">fetch</span><span class="p">(</span><span class="dl">'</span><span class="s1">https://fosstodon.org/api/v1/statuses/107531143511314399/context</span><span class="dl">'</span><span class="p">);</span>
    <span class="kd">const</span> <span class="nx">data</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">response</span><span class="p">.</span><span class="nf">json</span><span class="p">();</span>
    <span class="k">if </span><span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">descendants</span> <span class="o">&amp;&amp;</span> <span class="nx">data</span><span class="p">.</span><span class="nx">descendants</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        <span class="nb">document</span><span class="p">.</span><span class="nf">getElementById</span><span class="p">(</span><span class="dl">'</span><span class="s1">comments-list</span><span class="dl">'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">+=</span> <span class="dl">"</span><span class="s2">&lt;h3&gt;Mastodon Comments&lt;/h3&gt;</span><span class="dl">"</span><span class="p">;</span>
        <span class="kd">let</span> <span class="nx">descendants</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">descendants</span><span class="p">;</span>
        <span class="k">for </span><span class="p">(</span><span class="kd">let</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">descendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nb">document</span><span class="p">.</span><span class="nf">getElementById</span><span class="p">(</span><span class="dl">'</span><span class="s1">comments-list</span><span class="dl">'</span><span class="p">).</span><span class="nf">appendChild</span><span class="p">(</span><span class="nx">DOMPurify</span><span class="p">.</span><span class="nf">sanitize</span><span class="p">(</span><span class="nf">createCommentEl</span><span class="p">(</span><span class="nx">descendants</span><span class="p">[</span><span class="nx">i</span><span class="p">]),</span> <span class="p">{</span><span class="dl">'</span><span class="s1">RETURN_DOM_FRAGMENT</span><span class="dl">'</span><span class="p">:</span> <span class="kc">true</span><span class="p">}));</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nb">document</span><span class="p">.</span><span class="nf">getElementById</span><span class="p">(</span><span class="dl">'</span><span class="s1">comments-list</span><span class="dl">'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">+=</span> <span class="dl">"</span><span class="s2">&lt;p&gt;⚠️ No Mastodon comments yet ⚠️&lt;/p&gt;</span><span class="dl">"</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">});</span>
</code></pre></div></div>
<p>As you can see, once the “Load comments” button is pressed, we’re going to call
the main function, which will fetch data by calling Mastodon’s API and return a
JSON, then we are going to access the <code class="language-plaintext highlighter-rouge">descendants</code> object, which should have an
array of comments and its properties, which will be processed with the function <code class="language-plaintext highlighter-rouge">createCommentEl()</code>.</p>

<h2 id="comment-formatting">Comment formatting</h2>

<p>This function will get the data from the JSON and create HTML elements based on
that data. Here is the function:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">function</span> <span class="nf">createCommentEl</span><span class="p">(</span><span class="nx">response</span><span class="p">){</span>
    <span class="kd">let</span> <span class="nx">user</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">createElement</span><span class="p">(</span><span class="dl">'</span><span class="s1">div</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">user</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nf">add</span><span class="p">(</span><span class="dl">'</span><span class="s1">mastodon-comment</span><span class="dl">'</span><span class="p">);</span>
    <span class="kd">let</span> <span class="nx">userAvatar</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">createElement</span><span class="p">(</span><span class="dl">'</span><span class="s1">img</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">userAvatar</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nf">add</span><span class="p">(</span><span class="dl">'</span><span class="s1">avatar</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">userAvatar</span><span class="p">.</span><span class="nf">setAttribute</span><span class="p">(</span><span class="dl">'</span><span class="s1">height</span><span class="dl">'</span><span class="p">,</span> <span class="mi">60</span> <span class="p">);</span> 
    <span class="nx">userAvatar</span><span class="p">.</span><span class="nf">setAttribute</span><span class="p">(</span><span class="dl">'</span><span class="s1">width</span><span class="dl">'</span><span class="p">,</span> <span class="mi">60</span> <span class="p">);</span> 
    <span class="nx">userAvatar</span><span class="p">.</span><span class="nf">setAttribute</span><span class="p">(</span><span class="dl">'</span><span class="s1">src</span><span class="dl">'</span><span class="p">,</span><span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">avatar_static</span><span class="p">);</span>
    <span class="nx">user</span><span class="p">.</span><span class="nf">appendChild</span><span class="p">(</span><span class="nx">userAvatar</span><span class="p">);</span>
    <span class="kd">let</span> <span class="nx">userLink</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">createElement</span><span class="p">(</span><span class="dl">'</span><span class="s1">a</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">userLink</span><span class="p">.</span><span class="nf">setAttribute</span><span class="p">(</span><span class="dl">'</span><span class="s1">href</span><span class="dl">'</span><span class="p">,</span><span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">url</span><span class="p">);</span>
    <span class="nx">userLink</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nf">add</span><span class="p">(</span><span class="dl">'</span><span class="s1">comment-author</span><span class="dl">'</span><span class="p">);</span>
    <span class="k">for </span><span class="p">(</span><span class="kd">let</span> <span class="nx">j</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">emojis</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span><span class="nx">j</span><span class="o">++</span><span class="p">){</span>
        <span class="kd">let</span> <span class="nx">emoji</span> <span class="o">=</span> <span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">emojis</span><span class="p">[</span><span class="nx">j</span><span class="p">];</span>
        <span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">display_name</span> <span class="o">=</span> <span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">display_name</span><span class="p">.</span><span class="nf">replace</span><span class="p">(</span><span class="s2">`:</span><span class="p">${</span><span class="nx">emoji</span><span class="p">.</span><span class="nx">shortcode</span><span class="p">}</span><span class="s2">:`</span><span class="p">,</span> <span class="s2">`&lt;img src="</span><span class="p">${</span><span class="nx">emoji</span><span class="p">.</span><span class="nx">static_url</span><span class="p">}</span><span class="s2">" alt="Emoji </span><span class="p">${</span><span class="nx">emoji</span><span class="p">.</span><span class="nx">shortcode</span><span class="p">}</span><span class="s2">" height="16px" width="16px" /&gt;`</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="nx">userLink</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">display_name</span> <span class="o">+</span> <span class="dl">'</span><span class="s1"> @</span><span class="dl">'</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">account</span><span class="p">.</span><span class="nx">username</span><span class="p">;</span>

    <span class="kd">let</span> <span class="nx">commentDate</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">createElement</span><span class="p">(</span><span class="dl">'</span><span class="s1">a</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">commentDate</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nf">add</span><span class="p">(</span><span class="dl">'</span><span class="s1">comment-date</span><span class="dl">'</span><span class="p">);</span> <span class="nx">commentDate</span><span class="p">.</span><span class="nf">setAttribute</span><span class="p">(</span><span class="dl">'</span><span class="s1">href</span><span class="dl">'</span><span class="p">,</span><span class="nx">response</span><span class="p">.</span><span class="nx">url</span><span class="p">);</span> <span class="nx">commentDate</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">response</span><span class="p">.</span><span class="nx">created_at</span><span class="p">.</span><span class="nf">substr</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">10</span><span class="p">);</span>

    <span class="kd">let</span> <span class="nx">commentContents</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">createElement</span><span class="p">(</span><span class="dl">'</span><span class="s1">div</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">commentContents</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nf">add</span><span class="p">(</span><span class="dl">'</span><span class="s1">mastodon-comment-content</span><span class="dl">'</span><span class="p">);</span> <span class="nx">commentContents</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">response</span><span class="p">.</span><span class="nx">content</span><span class="p">;</span>

    <span class="kd">let</span> <span class="nx">comment</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nf">createElement</span><span class="p">(</span><span class="dl">'</span><span class="s1">div</span><span class="dl">'</span><span class="p">);</span>
    <span class="nx">comment</span><span class="p">.</span><span class="nx">classList</span><span class="p">.</span><span class="nf">add</span><span class="p">(</span> <span class="dl">'</span><span class="s1">comment-content</span><span class="dl">'</span> <span class="p">);</span>

    <span class="nx">user</span><span class="p">.</span><span class="nf">appendChild</span><span class="p">(</span> <span class="nx">comment</span> <span class="p">);</span>
    <span class="nx">comment</span><span class="p">.</span><span class="nf">appendChild</span><span class="p">(</span> <span class="nx">userLink</span> <span class="p">);</span>
    <span class="nx">comment</span><span class="p">.</span><span class="nf">appendChild</span><span class="p">(</span><span class="nx">commentDate</span><span class="p">);</span>
    <span class="nx">comment</span><span class="p">.</span><span class="nf">appendChild</span><span class="p">(</span> <span class="nx">commentContents</span> <span class="p">);</span>
    <span class="k">return</span> <span class="nx">user</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<p>As you can see, we are creating a bunch of HTML elements that will have content
from the JSON, we assign classes, child elements, and such.</p>

<p>In fact, the only thing I kept from Schwan’s version is the way to call the API
and the basic structure, which I turned into Aristath’s syntax.</p>

<p>I am no expert when it comes to JavaScript, but I think this is pretty readable
overall. At least a bit more than the code I based this from, or maybe I am now
used to this code since I’ve worked on it for a while.</p>

<p>I think this combines the best of the comment systems I have found online, so I
think I will stick to this method for quite a while, since I have been using it
for months, I just never took the time to explain it properly until now.</p>

<p>You can always check my website’s source code to see how all of this is being
applied. And don’t be afraid to leave any question you might have by contacting
me in any way you prefer below.</p>

<p>This has been day 69 of <a href="https://100DaysToOffload.com">#100DaysToOffload</a></p>

<h1 id="mentioned-sources-and-posts">Mentioned sources and posts</h1>

<ul>
  <li><a href="https://aristath.github.io/blog/static-site-comments-using-github-issues-api">A new comment system for my static Jekyll site (Aristath)</a></li>
  <li><a href="https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/">Adding comments to your static blog with Mastodon (Carl Schwan)</a></li>
  <li>Previous posts by me talking about <a href="/blog/adding-comments-blog/">GitHub’s</a> and <a href="/blog/mastodon-comments-and-changes/">Mastodon’s</a> comment systems.</li>
</ul>]]></content><author><name>joelchrono</name><email>me@joelchrono.xyz</email></author><category term="tutorial" /><category term="coding" /><category term="blog" /><category term="fediverse" /><category term="small-web" /><category term="jekyll" /><category term="webdev" /><summary type="html"><![CDATA[I have talked about comments on my blog before, but I think I finally found the final iteration of it, and it's now live!]]></summary></entry></feed>