<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/rss.xsl" type="text/xsl" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dev | Bacardi55&#39;s Web Cave</title>
    <link>https://bacardi55.io/tags/dev/</link>
    <description>Recent content in Dev on Bacardi55&#39;s Web Cave</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>bac@rdi55.pl (bacardi55)</managingEditor>
    <webMaster>bac@rdi55.pl (bacardi55)</webMaster>
    <copyright>2010-2025 bacardi55</copyright>
    <lastBuildDate>Mon, 19 May 2025 16:55:25 +0200</lastBuildDate>
    <atom:link href="https://bacardi55.io/tags/dev/index.xml" rel="self" type="application/rss+xml" />
    <item>
      
      
        
      <title>2025-05-19 16:55</title><link>https://bacardi55.io/notes/20250519-1655/</link><pubDate>Mon, 19 May 2025 16:55:25 +0200</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/notes/20250519-1655/</guid><description>&lt;p&gt;&lt;a href=&#34;https://holdtherobot.com/blog/2025/05/11/linux-on-android-with-ar-glasses/&#34;&gt;https://holdtherobot.com/blog/2025/05/11/linux-on-android-with-ar-glasses/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;This seems both cool and useless… I&amp;rsquo;d love to try it at least once but I really don&amp;rsquo;t want to spend the money for it.&lt;/p&gt;&#xA;</description></item>
    <item>
      
      <title>Re-thinking my git hosting with sourcehut and forgejo</title><link>https://bacardi55.io/2024/07/26/re-thinking-my-git-hosting-with-sourcehut-and-forgejo/</link><pubDate>Fri, 26 Jul 2024 00:00:00 +0200</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2024/07/26/re-thinking-my-git-hosting-with-sourcehut-and-forgejo/</guid><description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;TLDR;&lt;/strong&gt; I&amp;rsquo;ve moved my project to &lt;a href=&#34;https://sourcehut.org&#34;&gt;sourcehut&lt;/a&gt;, see &lt;a href=&#34;https://sr.ht/~bacardi55&#34;&gt;my projects&lt;/a&gt; there, while maintaining a private and local &lt;a href=&#34;https://forgejo.org&#34;&gt;forgejo&lt;/a&gt; instance.&lt;/p&gt;&#xA;&lt;p&gt;Last year, I realized that my projects were in too many repos. I&amp;rsquo;ve been using github like many others for a long time, but I also had an account on gitlab, codeberg and sourcehut. I also have a few account on selfhosted repos from specific projects, but I&amp;rsquo;m not going to talk about these cases in this post.&lt;/p&gt;&#xA;&lt;p&gt;After years of pushing codes everywhere… I had projects everywhere: github, gitlab, codeberg and sourcehut… So it was time to do something about it!&lt;/p&gt;&#xA;&lt;h2 id=&#34;context&#34;&gt;Context&lt;/h2&gt;&#xA;&lt;p&gt;Early last year, after testing sourcehut for a while, I was convinced it was the best forge &lt;strong&gt;for me&lt;/strong&gt;. The &amp;ldquo;for me&amp;rdquo; is important, because I don&amp;rsquo;t think sourcehut is for everyone… And while it isn&amp;rsquo;t perfect (in particular its UI and how to navigate between each sourcehut features), I find it the best for my needs.&lt;/p&gt;&#xA;&lt;p&gt;But at that point my repositories were a mess: projects were either on 1, all or a subset of the mentioned forges… Clear primary forge was not indicated and no way to have a good vision of all my projects…&#xA;Let&amp;rsquo;s just say that this was not ideal and even myself wasn&amp;rsquo;t sure what were where…&lt;/p&gt;&#xA;&lt;p&gt;And then sourcehut (and codeberg to a lesser extent) suffered &lt;a href=&#34;https://sourcehut.org/blog/2024-01-16-sourcehut-outage/&#34;&gt;massive DDoS attacked&lt;/a&gt; that put them down, specially Sourcehut that was out for multiple days. That event made me realized 3 things:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I wanted a go to forge as my main &amp;ldquo;public&amp;rdquo; forge&lt;/li&gt;&#xA;&lt;li&gt;I needed a selfhosted forge to still push code during downtime of my main public forge&lt;/li&gt;&#xA;&lt;li&gt;I had to do some cleaning and clearly archive / close unused / unmaintained repos&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;A good question would be: &amp;ldquo;then why not just using one selfhosted platform only?&amp;rdquo;. But hosting my own forge publicly comes with big drawbacks:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I&amp;rsquo;ve found that bot crawlers are taking a lot of resources to crawl all public repositories.&lt;/li&gt;&#xA;&lt;li&gt;Git access via ssh (to push) would need opening port 22 to the internet and do a lot configuration in my network.&lt;/li&gt;&#xA;&lt;li&gt;A &amp;ldquo;known&amp;rdquo; public forge is usually easier to contribute.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So I rolled up my sleeves and decided to go through the migration to what I hope is their final destinations…&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-plan&#34;&gt;The plan&lt;/h2&gt;&#xA;&lt;h3 id=&#34;objectives-and-constraints&#34;&gt;Objectives and Constraints&lt;/h3&gt;&#xA;&lt;p&gt;The goals were simple:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Have one main public forges for all open source projects: For that, I choose sourcehut&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Have a selfhosted forges in case I want to push code and sourcehut is down. Also to host projects that I don&amp;rsquo;t want on sourcehut, even as a private project.&lt;/li&gt;&#xA;&lt;li&gt;Clear indications for users / contributors on where to find the up to date version of a code.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;exception&#34;&gt;Exception&lt;/h3&gt;&#xA;&lt;p&gt;I made 2 small exceptions for the 2 gemini RFC proposals. Collaboration are already taken place there and I&amp;rsquo;m sure some people had to create account to participate there and may not want to move. Also, as it is an RFC, having a small UI to edit the text and create a merge request may be easy than the git email workflow. That is why the &lt;a href=&#34;https://codeberg.org/bacardi55/gemini-tinylog-rfc&#34;&gt;Gemini Tinylog RFC&lt;/a&gt; and the &lt;a href=&#34;https://codeberg.org/bacardi55/gemini-mentions-rfc&#34;&gt;Gemini Mention RFC&lt;/a&gt; primary repositories are still on codeberg.&lt;/p&gt;&#xA;&lt;p&gt;All my other repositories follow the new plan.&lt;/p&gt;&#xA;&lt;h2 id=&#34;new-state&#34;&gt;New state&lt;/h2&gt;&#xA;&lt;h3 id=&#34;local-forgejo-instance&#34;&gt;Local Forgejo Instance&lt;/h3&gt;&#xA;&lt;p&gt;As said, I decided to use Forgejo for my local private instance. I won&amp;rsquo;t cover the installation details, their documentation covers it well already.&lt;/p&gt;&#xA;&lt;p&gt;This instance is only used by me for:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Private repository that I don&amp;rsquo;t want on sourcehut (even in private) or any other public forges&lt;/li&gt;&#xA;&lt;li&gt;Very old and unused code that I want to keep&lt;/li&gt;&#xA;&lt;li&gt;Hosting the code of all projects I host elsewhere. I don&amp;rsquo;t use mirroring here, I actually have to push to multiple remotes (see this post where I &lt;a href=&#34;https://bacardi55.io/2024/02/21/git-tips-push-to-multiple-git-repo-in-one-command/&#34;&gt;explained how I do it&lt;/a&gt; via &lt;code&gt;git remote --set-url&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Sometimes used to push things before I push them publicly to sourcehut (or other)&lt;/li&gt;&#xA;&lt;li&gt;Serve also as a backup of all my code: the instance itself is a backup of project on 3rd party forges (or the other way around), but also, the container hosting forgejo is part of my backup process with proxmox and borgbackup, so all covered :).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As you understood, every single project managed by git is hosted on this private instance. It isn&amp;rsquo;t used for anything else (no CI/CD, no public pages, no collaboration).&lt;/p&gt;&#xA;&lt;h3 id=&#34;sourcehut&#34;&gt;Sourcehut&lt;/h3&gt;&#xA;&lt;p&gt;The new public home for all my projects. Took a bit of time to get used to its UI and workflow, but I really enjoy using it. I won&amp;rsquo;t detail right now how sourcehut works differently than other &amp;ldquo;traditional&amp;rdquo; forge (=aka github workflow), but I&amp;rsquo;ll talk about why sourcehut in a later post.&lt;/p&gt;&#xA;&lt;p&gt;One important thing to have in mind: on sourcehut, you can create projects to group multiple repositories (themselves attached to mailing lists and todolists) together. It means that you can have one project with mutltiple repositories but still a common todolist for example. It also allows to have a git repository in multiple projects, which can be useful too (see below as I&amp;rsquo;m using it).&lt;/p&gt;&#xA;&lt;p&gt;It takes some time to grasp the full concepts of sourcehut, but the flexibility is way higher than with other forges.&#xA;I&amp;rsquo;m using sourcehut projects for grouping codebases together or for &amp;ldquo;larger&amp;rdquo; projects on which I&amp;rsquo;d be happy to see collaboration.&#xA;Smaller code are not in projects and just standalone repos (with mailing list and todolist still possible).&lt;/p&gt;&#xA;&lt;p&gt;Sourcehut allows projects and codebases to be visible, unlisted or private. A project can have repos with different visibility.&lt;/p&gt;&#xA;&lt;p&gt;For example, I created a &lt;a href=&#34;https://sr.ht/~bacardi55/writings/&#34;&gt;writting project&lt;/a&gt; that contains 4 repositories: one for &lt;a href=&#34;https://git.sr.ht/~bacardi55/website&#34;&gt;this blog&lt;/a&gt;, one for my &lt;a href=&#34;https://git.sr.ht/~bacardi55/capsule&#34;&gt;gemini capsule&lt;/a&gt;, one for the &lt;a href=&#34;https://git.sr.ht/~bacardi55/writting-deploy&#34;&gt;deployment scripts&lt;/a&gt; (unlisted) and one for my &lt;a href=&#34;https://git.sr.ht/~bacardi55/MinIndie&#34;&gt;custom hugo theme&lt;/a&gt;. The hugo theme is both in this project and in a &lt;a href=&#34;https://sr.ht/~bacardi55/MinIndie/&#34;&gt;dedicated one&lt;/a&gt; in case people would like to contribute. Other example, I have a &lt;a href=&#34;https://sr.ht/~bacardi55/Gemini55/&#34;&gt;gemini55&lt;/a&gt; project containing all my gemini related repositories (&lt;a href=&#34;https://git.sr.ht/~bacardi55/gtl&#34;&gt;gtl&lt;/a&gt;, &lt;a href=&#34;https://git.sr.ht/~bacardi55/houston&#34;&gt;houston&lt;/a&gt;, &lt;a href=&#34;https://git.sr.ht/~bacardi55/ggm&#34;&gt;ggm&lt;/a&gt;, &lt;a href=&#34;https://git.sr.ht/~bacardi55/discogem&#34;&gt;discogem&lt;/a&gt; and a link to the 2 gemini RFCs). Some repositories are not tight to projects.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-about-other-forges&#34;&gt;What about other forges&lt;/h3&gt;&#xA;&lt;p&gt;Except the 2 Gemini RFC exceptions mentioned above, I&amp;rsquo;ve cleaned a lot my other forges presence by archiving all projects (and that took some time to do on all projects :D). Both my github and codeberg profiles indicate:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Profile used to contribute to Github projects. My own projects are hosted on sourcehut: &lt;a href=&#34;https://sr.ht/~bacardi55&#34;&gt;https://sr.ht/~bacardi55&lt;/a&gt; &lt;a href=&#34;https://git.sr.ht/~bacardi55&#34;&gt;https://git.sr.ht/~bacardi55&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I haven&amp;rsquo;t deleted my account on those forges though, as they might still be useful to collaborate on project hosted there.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;The move is now over, I have been using solely sourcehut for quite some time now. This blog is now built via &lt;a href=&#34;https://builds.sr.ht/&#34;&gt;sourcehut builds&lt;/a&gt; and while sourcehut UI definitely needs improvements, it has been a great decision and I&amp;rsquo;ve enjoyed a lot using sourcehut since my move. Hopefully, this is a state that shouldn&amp;rsquo;t move for a while.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;: Some people might argue that sourcehut is not the best choice for this because it doesn&amp;rsquo;t provide the &amp;ldquo;classic&amp;rdquo; fork / pull request workflow, but I do believe anyone could learn fairly quickly the email workflow linked to sourcehut. Plus my project don&amp;rsquo;t have contributors in reality :P.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description></item>
    <item>
      
      <title>Generating basic content statistics for static site generator</title><link>https://bacardi55.io/2024/03/07/generating-basic-content-statistics-for-static-site-generator/</link><pubDate>Thu, 07 Mar 2024 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2024/03/07/generating-basic-content-statistics-for-static-site-generator/</guid><description>&lt;p&gt;&lt;strong&gt;Nota&lt;/strong&gt;: « Content statistics » refers to statistics about the content available on this website (how many blog posts per year, …). This has nothing to do with analytics / user statistics or any kind of tracking!&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;2 or 3 days ago, I had a crazy idea: « What about adding content statistics on this small website? ». And a few days and many lines of bash / python scripts later, here we are…&lt;/p&gt;&#xA;&lt;p&gt;For more context, this site is generated via &lt;a href=&#34;https://gohugo.io&#34;&gt;hugo&lt;/a&gt;, a static site generator. It means all my contents, would that be &lt;a href=&#34;https://bacardi55.io/posts/&#34;&gt;blog posts&lt;/a&gt;, &lt;a href=&#34;https://bacardi55.io/gemlog/&#34;&gt;gemlog entries&lt;/a&gt; or &lt;a href=&#34;https://bacardi55.io/bookmarks/&#34;&gt;bookmarks&lt;/a&gt;, are in markdown files. If you want to see an example, you can see all blog posts on the &lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/posts&#34;&gt;git repository&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;By having content within markdown files, it meant:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the SSG/CMS (hugo) does not calculate stats based on those&lt;/li&gt;&#xA;&lt;li&gt;I can not simply query a database to retrieve the info I want&lt;/li&gt;&#xA;&lt;li&gt;Stats needs to generated during the build phase before each deployment to calculate always up to date stats&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;bash-to-save-the-day&#34;&gt;Bash to save the day&lt;/h2&gt;&#xA;&lt;p&gt;I tried searching for some software that would allow to extract data from markdown / frontmatter, but couldn&amp;rsquo;t find anything usable. All I found was libraries to work with markdown and / or frontmatter content.&lt;/p&gt;&#xA;&lt;p&gt;I was almost resolved to be obligated to write something from scratch using those libs that I almost gave up and just add this idea to the &amp;ldquo;longer term todolist&amp;rdquo; (aka probably never).&lt;/p&gt;&#xA;&lt;p&gt;But &lt;a href=&#34;https://social.nah.re/@alex&#34;&gt;Alex&lt;/a&gt; saved the day by giving a brillant bash command that would remove the needs to write a complex code analysing frontmatter in files. Indeed, he shared with me the following command:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; file in *.md; head -n &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt; $file | grep &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;date:&amp;#39;&lt;/span&gt; | sed &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;s/date.*\([[:digit:]]\{4\}\).*/\1/&amp;#39;&lt;/span&gt; &amp;gt;&amp;gt; count; end ; cat count | sort | uniq -c&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Seems ugly and complicated, but it simply look at all the &lt;code&gt;*.md&lt;/code&gt; files in a directory, look at the header and grep the line started with &lt;code&gt;date:&lt;/code&gt; and then keep the 4 digit of the year. Add the info in a temporary file that is then sorted and unified (displaying the count with the &lt;code&gt;-c&lt;/code&gt; option).&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say that from there I simply followed the deep rabbit hole… Read the next chapter to access to the links to check these stats out, and read the following one to see the unnecessary complicated process to build those simple pages with bash and python (for generating graph images) :).&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-stats-are-you-talking-about&#34;&gt;What stats are you talking about&lt;/h2&gt;&#xA;&lt;p&gt;Before jumping into the &amp;ldquo;how&amp;rdquo;, let&amp;rsquo;s talk about the &amp;ldquo;what&amp;rdquo;. The new available page showing different type of stats are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://bacardi55.io/pages/stats/&#34;&gt;Stats Overview page&lt;/a&gt;: A first intro to the stats, showing some global numbers and graphs, as well as showing additional stats for the current year&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://bacardi55.io/pages/stats-per-year/&#34;&gt;Stats per year&lt;/a&gt;: See the number of content (all types) per month for each year, as well as the content type split for all yearly articles&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://bacardi55.io/pages/stats-per-type/&#34;&gt;Stats per type (overview)&lt;/a&gt;: Show some global stats per type: number of article per month over the year, for each content type&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://bacardi55.io/pages/stats-posts/&#34;&gt;Stats about Blog Posts&lt;/a&gt;: Show, per year, the number of blog posts per month&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://bacardi55.io/pages/stats-gemlog/&#34;&gt;Stats about Gemini entries&lt;/a&gt;: Show, per year, the number of gemlog entries per month&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://bacardi55.io/pages/stats-bookmarks/&#34;&gt;Stats about bookmarks&lt;/a&gt;: Show, per year, the number of bookmarks per month&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If you looked at these pages, they are not the best and lots of info could be added, but I feel it is a very good start for 2 evening of work. I can always add more with time. For example, I&amp;rsquo;m planning to add some stats about word counts per article type of stats. I also plan on keeping a very light css and styling in general, so I may sometime keep stuff in not the best possible way to avoid adding unnecessary css.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-does-it-work&#34;&gt;How does it work&lt;/h2&gt;&#xA;&lt;p&gt;Now let&amp;rsquo;s go into the ugly details. And let me start by saying: they are indeed ugly! The python script is just a mess written with speed to write it in mind, absolutely not about optimization or even &amp;ldquo;good common sense&amp;rdquo;! I usually don&amp;rsquo;t care and don&amp;rsquo;t say too much about code quality of scripts I&amp;rsquo;m sharing, but I feel like I really MUST warn everyone before they open it :).&lt;/p&gt;&#xA;&lt;p&gt;The big steps of the process are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Get data from frontmatter (via bash) for the different content types&lt;/li&gt;&#xA;&lt;li&gt;Create a json file that will be used both by hugo to access stats number, and a python script that will generate graphs (in png) based on it&lt;/li&gt;&#xA;&lt;li&gt;Create all different graphs required for the different pages via the python script&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;All of that is then incorporated within my CI/CD process based on sourcehut CI. I have a (already very) long blog posts in draft to details this CI process, so here I&amp;rsquo;m only focusing on the part for generating the stats page, not the CI/CD related stuff. It means that if you look at the scripts on sourcehut, there might be things in there not explained on this post.&lt;/p&gt;&#xA;&lt;p&gt;Retrieve the complete &lt;a href=&#34;https://git.sr.ht/~bacardi55/writting-deploy/tree/main/item/generate_content_stats.sh&#34;&gt;bash script&lt;/a&gt; or &lt;a href=&#34;https://git.sr.ht/~bacardi55/writting-deploy/tree/main/item/generate_content_stats_graph.py&#34;&gt;python code&lt;/a&gt; on sourcehut.&lt;/p&gt;&#xA;&lt;h3 id=&#34;quick-word-on-content-hierarchy&#34;&gt;Quick word on content hierarchy&lt;/h3&gt;&#xA;&lt;p&gt;It may be important to explain here how my content are organized. In a nutshell:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;hugoRoot&amp;gt;/content&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── bookmarks&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── gemlog&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── pages&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── posts&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;└── tags&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In each directory, I have all the &lt;code&gt;*.md&lt;/code&gt; files in there, I don&amp;rsquo;t have subdirectories. If it is your case, you will need to adapt everything below.&lt;/p&gt;&#xA;&lt;h3 id=&#34;retrieve-data-from-frontmatter-with-bash&#34;&gt;Retrieve data from frontmatter with bash&lt;/h3&gt;&#xA;&lt;p&gt;The magic part here is to focus only on the date parameter within the frontmatter area. I modified a bit the command shared above:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; file in *.md; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; head -n &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt; $file | grep &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;date =&amp;#39;&lt;/span&gt; | sed &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;s/date.*\([[:digit:]]\{4\}-[[:digit:]]\{2\}\).*/\1/&amp;#39;&lt;/span&gt; &amp;gt;&amp;gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;temp&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/_tmpCount&amp;#34;&lt;/span&gt; ; &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I had to use &lt;code&gt;-n 10&lt;/code&gt; with head to get more lines as I did have some long frontmatter, as well as retrieving with &lt;code&gt;sed&lt;/code&gt; not only the year, but the couple &lt;code&gt;YYYY-MM&lt;/code&gt;. Then pushing that in a temporary file.&lt;/p&gt;&#xA;&lt;p&gt;Then the tricky part was creating a loop that would allow to read data line by line and still be able to reuse the variable outside of the while loop&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  total&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;while&lt;/span&gt; read -r line&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    nb&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;line&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; | awk -F &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;…&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    total&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$((&lt;/span&gt;total &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; nb&lt;span style=&#34;color:#66d9ef&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt; &amp;lt; &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;cat &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;temp&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/_tmpCount&amp;#34;&lt;/span&gt; | sort | uniq -c&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Notice the part after &lt;code&gt;done&lt;/code&gt;? This is process substitution and prevents the while loop to create a subprocess.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s talk about generating the json file now…&lt;/p&gt;&#xA;&lt;h3 id=&#34;create-a-json-file-in-bash&#34;&gt;Create a json file… in bash&lt;/h3&gt;&#xA;&lt;p&gt;I don&amp;rsquo;t know how to explain better than sharing almost the entire code of the bash script…&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;…&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Init variable:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;global_total&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;res_json&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{\&amp;#34;articles\&amp;#34;: {&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; type in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;stats_content_types[@]:?&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;…&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  res_json&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;res_json&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;\&amp;#34;&lt;/span&gt;$type&lt;span style=&#34;color:#e6db74&#34;&gt;\&amp;#34;: {\&amp;#34;entries_per_month\&amp;#34;: [&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;…&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; file in *.md; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; head -n &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt; $file | grep &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;date =&amp;#39;&lt;/span&gt; | sed &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;s/date.*\([[:digit:]]\{4\}-[[:digit:]]\{2\}\).*/\1/&amp;#39;&lt;/span&gt; &amp;gt;&amp;gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;temp&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/_tmpCount&amp;#34;&lt;/span&gt; ; &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  total&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;while&lt;/span&gt; read -r line&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    nb&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;line&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; | awk -F &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    date&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;line&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; | awk -F &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{print $2}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    res_json&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;res_json&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{\&amp;#34;date\&amp;#34;: \&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;date&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;\&amp;#34;, \&amp;#34;count\&amp;#34;: \&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;nb&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;\&amp;#34;},&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    total&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$((&lt;/span&gt;total &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; nb&lt;span style=&#34;color:#66d9ef&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt; &amp;lt; &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;cat &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;temp&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/_tmpCount&amp;#34;&lt;/span&gt; | sort | uniq -c&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  res_json&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;res_json:&lt;span style=&#34;color:#66d9ef&#34;&gt;:-&lt;/span&gt;1&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;], \&amp;#34;total\&amp;#34;: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;total&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;},&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  global_total&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$((&lt;/span&gt;global_total &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; total&lt;span style=&#34;color:#66d9ef&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;res_json&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;res_json:&lt;span style=&#34;color:#66d9ef&#34;&gt;:-&lt;/span&gt;1&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}, \&amp;#34;total_articles\&amp;#34;: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;global_total&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;…&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I tried to reduce the noise to a minimum. As you can see, it is just an ugly way to create the full json string in loops… But hey, it works!&lt;/p&gt;&#xA;&lt;p&gt;The json generated looks like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;articles&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;posts&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;entries_per_month&amp;#34;&lt;/span&gt;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;date&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2013-01&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;count&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;date&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2013-02&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;count&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        [&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;…&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;total&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;127&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;gemlog&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;entries_per_month&amp;#34;&lt;/span&gt;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;date&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2021-02&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;count&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;5&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        [&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;…&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;total&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;42&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;bookmarks&amp;#34;&lt;/span&gt;: {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;entries_per_month&amp;#34;&lt;/span&gt;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;date&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2023-02&amp;#34;&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;count&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;18&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        [&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;…&lt;/span&gt;]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;total&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;68&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  },&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;total_articles&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;237&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;Count&lt;/code&gt; contains the number of posts for that type for the given month (format &lt;code&gt;YYYY-MM&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The generated json file will be used by hugo directly to display some stats (eg, on the &lt;a href=&#34;https://bacardi55.io/pages/stats/&#34;&gt;stats overview summary&lt;/a&gt;) and by the python script to generate images. So it is the &amp;ldquo;source of truth&amp;rdquo; once created.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look first at the graph and images generation, and then at the hugo setup.&lt;/p&gt;&#xA;&lt;h3 id=&#34;generate-graphs-in-python-with-pygal&#34;&gt;Generate graphs in python with Pygal&lt;/h3&gt;&#xA;&lt;p&gt;I almost went with &lt;a href=&#34;https://matplotlib.org/&#34;&gt;MatPlotLib&lt;/a&gt; as the library of choice for building the graphs, but then found &lt;a href=&#34;https://www.pygal.org/en/stable/&#34;&gt;Pygal&lt;/a&gt; which seemed easier to start with, and more than enough for anything I wanted to do on the stats area of this site.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m putting the warning again, but the python script is as ugly as it can be! It needs a lot of love, but for now, everything was made with speed to deliver in mind, not love of well thought work :D.&lt;/p&gt;&#xA;&lt;p&gt;You can find the &lt;a href=&#34;https://git.sr.ht/~bacardi55/writting-deploy/tree/main/item/generate_content_stats_graph.py&#34;&gt;script on sourcehut&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not going to display and explain the script here. It is ugly but in the end generate with &lt;code&gt;Pygal&lt;/code&gt; different pie and bar charts:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;stats-articles_types_per_year-&amp;lt;YEAR&amp;gt;-pie.png&lt;/code&gt;: One half pie chart per year displaying the articles split per type&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;stats-global_articles_in_&amp;lt;YEAR&amp;gt;-bar.png&lt;/code&gt;: One bar chart per year displaying the number of articles (all types) per month of the given year&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;stats-global_articles_per_year-bar.png&lt;/code&gt;: One bar chart displaying the number of articles (all types) created per year&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;stats-monthly_&amp;lt;TYPE&amp;gt;_in_&amp;lt;YEAR&amp;gt;-bar.png&lt;/code&gt;: One bar chart per year and per content type, displaying the number of articles of the given content type per month for the given year&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;stats-monthly_&amp;lt;TYPE&amp;gt;_per_year-bar.png&lt;/code&gt;: One bar chart per content type, displaying the number of articles of the given content type per month over all the years&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Replace &lt;code&gt;&amp;lt;YEAR&amp;gt;&lt;/code&gt; with the different years since the creation of this website (ignoring empty years) and &lt;code&gt;&amp;lt;TYPE&amp;gt;&lt;/code&gt; is one of the existing content types (&lt;code&gt;posts&lt;/code&gt;, &lt;code&gt;gemlog&lt;/code&gt; and &lt;code&gt;bookmarks&lt;/code&gt;, &lt;code&gt;pages&lt;/code&gt; are ignored).&lt;/p&gt;&#xA;&lt;p&gt;Right now, it creates 38 files in total… Once generated they are moved to the right place within hugo structure (in my case, &lt;code&gt;&amp;lt;hugoRoot&amp;gt;/static/images/pages/stats/&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;h3 id=&#34;generating-hugo-pages&#34;&gt;Generating Hugo Pages&lt;/h3&gt;&#xA;&lt;p&gt;This may seems complicated and / or messy because there are many markdown and html files… But it is simple in reality, I just splited the markdown in multiple files to have lighter pages and used small shortcode templates to be able to reuse them easily.&lt;/p&gt;&#xA;&lt;h4 id=&#34;content-pages&#34;&gt;Content pages&lt;/h4&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start with the easiest part. I created 6 markdown files in &lt;code&gt;&amp;lt;HugoRoot&amp;gt;/content/pages/&lt;/code&gt;. I&amp;rsquo;m not going to copy their content here, I&amp;rsquo;m linking them to their sourcehut page if you want to see them entirely:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/pages/stats.md&#34;&gt;stats.md&lt;/a&gt; for the &lt;a href=&#34;https://bacardi55.io/pages/stats/&#34;&gt;overview page&lt;/a&gt;, it read the json file to display some data (see below for details) and load some shortcodes (see below)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/pages/stats-per-year.md&#34;&gt;stats-per-year.md&lt;/a&gt; for the &lt;a href=&#34;https://bacardi55.io/pages/stats-per-year/&#34;&gt;stats per year page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/pages/stats-per-type.md&#34;&gt;stats-per-type.md&lt;/a&gt; for the &lt;a href=&#34;https://bacardi55.io/pages/stats-per-type/&#34;&gt;stats per type overview page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/pages/stats-posts.md&#34;&gt;stats-posts.md&lt;/a&gt; for the &lt;a href=&#34;https://bacardi55.io/pages/stats-posts/&#34;&gt;blog posts stats page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/pages/stats-gemlog.md&#34;&gt;stats-gemlog.md&lt;/a&gt; for the &lt;a href=&#34;https://bacardi55.io/pages/stats-gemlog/&#34;&gt;gemlog stats page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/content/pages/stats-bookmarks.md&#34;&gt;stats-bookmarks.md&lt;/a&gt; for the &lt;a href=&#34;https://bacardi55.io/pages/stats-bookmarks/&#34;&gt;bookmarks stats page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;custom-shortcodes&#34;&gt;Custom shortcodes&lt;/h4&gt;&#xA;&lt;p&gt;In the previous pages, I call some custom hugo &lt;code&gt;shortcodes&lt;/code&gt; to avoid repeating myself (and be able to create custom html called from the markdown files).&lt;/p&gt;&#xA;&lt;p&gt;You can find all of these &lt;code&gt;shortcodes&lt;/code&gt; &lt;a href=&#34;https://git.sr.ht/~bacardi55/website/tree/main/item/layouts/shortcodes&#34;&gt;on sourcehut&lt;/a&gt;, so I&amp;rsquo;m not going to go into all the details. But to give an idea, here is an example.&lt;/p&gt;&#xA;&lt;p&gt;This is the code for the &lt;code&gt;contentstats-articles-per-type&lt;/code&gt; (in &lt;code&gt;&amp;lt;HugoRoot&amp;gt;/layouts/shortcodes/&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{{ $articleType := $.Get 0 }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{{ $currentYear := $.Get 1 }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;stats-item&amp;#34;&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;All {{ strings.FirstUpper $articleType }} per month in {{ $currentYear }}&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;figure&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;statsimg&amp;#34;&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;img&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{{ print &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;images&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;pages&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;stats&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;/&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;stats-monthly_&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;$&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;articleType&lt;/span&gt; &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;_in_&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;$&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;currentYear&lt;/span&gt; &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;-bar&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;png&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;}}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;alt&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{{ $articleType }} in {{ $currentYear }}&amp;#34;&lt;/span&gt; /&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;figcaption&lt;/span&gt;&amp;gt;{{ $articleType }} in {{ $currentYear }}&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;figcaption&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;figure&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It receives 2 arguments: the type of articles (&lt;code&gt;posts&lt;/code&gt;, &lt;code&gt;gemlog&lt;/code&gt; or &lt;code&gt;bookmarks&lt;/code&gt;) and a given year. Then based on these 2 arguments, it displays the right info. In this case, just one image found based on the 2 given arguments. Other shortcodes may do a lot more.&lt;/p&gt;&#xA;&lt;p&gt;It allows me to call it from different markdown files multiple times with different arguments depending on the context. For example, I&amp;rsquo;m calling this one from the &lt;code&gt;stats-posts.md&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;## 2024&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;{{&amp;lt; contentstats-articles-per-type &amp;#34;posts&amp;#34; &amp;#34;2024&amp;#34; &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;## 2023&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;{{&amp;lt; contentstats-articles-per-type &amp;#34;posts&amp;#34; &amp;#34;2023&amp;#34; &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[…]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So for each year, I can just call it with different year argument. Then, I can do the same within &lt;code&gt;stats-gemlog.md&lt;/code&gt; to display the gemlog graphs:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;## 2024&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;{{&amp;lt; contentstats-articles-per-type &amp;#34;gemlog&amp;#34; &amp;#34;2024&amp;#34; &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;## 2023&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;{{&amp;lt; contentstats-articles-per-type &amp;#34;gemlog&amp;#34; &amp;#34;2023&amp;#34; &amp;gt;}}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[…]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Look into the files themselves to understand more :).&lt;/p&gt;&#xA;&lt;h4 id=&#34;reading-json-file&#34;&gt;Reading json file&lt;/h4&gt;&#xA;&lt;p&gt;One last thing about hugo, it can read directly json (and yaml, toml or csv) files and display data directly from it. For example, from the shortcode &lt;code&gt;contentstats-summary-graph&lt;/code&gt;, it doesn&amp;rsquo;t load images but directly the json file to display the number of articles per type:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{{ $data := index .Site.Data &amp;#34;content_stats&amp;#34; }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;class&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;stats-summary&amp;#34;&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;strong&lt;/span&gt;&amp;gt;{{ $data.total_articles }}&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;strong&lt;/span&gt;&amp;gt; pieces of content have been published in total on this website:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;ul&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    {{ range $k, $v := $data.articles }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;li&lt;/span&gt;&amp;gt; {{ $v.total }} {{ $k }}&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;li&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    {{ end }}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;ul&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;div&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;index .Site.Data &amp;quot;content_stats&amp;quot;&lt;/code&gt; is the part loading the file (called &lt;code&gt;content_stats.json&lt;/code&gt;) and then I can loop on it using the &lt;code&gt;range&lt;/code&gt; function.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Well, this has been a fun couple of evening, working on the ugly bash and python scripts, toying with the generated pages and images and writing this article! Now I have &lt;a href=&#34;https://bacardi55.io/pages/stats/&#34;&gt;content stats&lt;/a&gt; generated during the CI process so I know they will always be up to date :].&lt;/p&gt;&#xA;&lt;p&gt;Let me know if you think about more interesting information to display or want to discuss how to apply this to your own website.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;: See &lt;a href=&#34;https://stackoverflow.com/questions/4667509/shell-variables-set-inside-while-loop-not-visible-outside-of-it&#34;&gt;https://stackoverflow.com/questions/4667509/shell-variables-set-inside-while-loop-not-visible-outside-of-it&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description></item>
    <item>
      
      <title>Git Tips: Push to multiple git repo in one command</title><link>https://bacardi55.io/2024/02/21/git-tips-push-to-multiple-git-repo-in-one-command/</link><pubDate>Wed, 21 Feb 2024 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2024/02/21/git-tips-push-to-multiple-git-repo-in-one-command/</guid><description>&lt;p&gt;I&amp;rsquo;m currently in the process of cleaning my presences on various git forges, &lt;a href=&#34;https://sr.ht&#34;&gt;sourcehut&lt;/a&gt; being my main one now, but I also use(d) github, gitlab and &lt;a href=&#34;https://codeberg.org/&#34;&gt;codeberg&lt;/a&gt; too. Now that my strategy around repo management is clearer (more on that later), I do have some projects where I still need to push code on multiple forges.&lt;/p&gt;&#xA;&lt;p&gt;Main reason being that I also have a private &lt;a href=&#34;https://forgejo.org/&#34;&gt;Forgejo&lt;/a&gt; instance on my homelab only reachable from my home network. I&amp;rsquo;ll explain the reason in a later post about my git repo management, but that means that every repo will have at least 2 remote repositories to push to: sourcehut and this private forgejo instance.&lt;/p&gt;&#xA;&lt;p&gt;I also want some repo to stay on codeberg as their main repo, but at the same I want everything on sourcehut (even if private / unlisted), so that I know everything is there and can be made public / private / hidden depending on what is the &amp;ldquo;source of truth&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;So, here we are with a quick post, more as a reminder, about publishing code to multiple git remote repository. Let&amp;rsquo;s take this website for example (repository called &lt;code&gt;website&lt;/code&gt; on sourcehut and &lt;code&gt;Blog&lt;/code&gt; on my personal git instance).&lt;/p&gt;&#xA;&lt;p&gt;By default, I already have 2 remotes I&amp;rsquo;ve added with &lt;code&gt;git remote add &amp;lt;nameOfRemote&amp;gt; &amp;lt;urlOfRemoteRepo&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;In the project directory:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git remote -v&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Returns for example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-nil&#34; data-lang=&#34;nil&#34;&gt;local   git@gitssh.bacardi55.local:bacardi55/Blog.git (fetch)&#xA;local   git@gitssh.bacardi55.local:bacardi55/Blog.git (push)&#xA;srht    git@git.sr.ht:~bacardi55/website (fetch)&#xA;srht    git@git.sr.ht:~bacardi55/website (push)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To publish on both, one could do it like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git push local main &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push srht main&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And that&amp;rsquo;s what I&amp;rsquo;ve been using at first. I even created a small &lt;code&gt;gitpushall&lt;/code&gt; alias in my &lt;code&gt;~/.zshrc&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;alias gitpushall&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;git push local main &amp;amp;&amp;amp; git push srht main&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which works fine because I follow the same naming convention for remote repo for all my projects. But I thought it wasn&amp;rsquo;t the &amp;ldquo;right&amp;rdquo; way and looked for a more &amp;ldquo;git-y&amp;rdquo; approach. Turns out, there is one as multiple push url can be added to a remote (but only one pull).&lt;/p&gt;&#xA;&lt;p&gt;I left the remote &lt;code&gt;local&lt;/code&gt; and &lt;code&gt;srht&lt;/code&gt; as is, and added a new remote called &lt;code&gt;all&lt;/code&gt;. This allow me to still decide to push to specific remote if I decide too (eg: pushing on my local git repo to avoid a build to be started on sourcehut CI while waiting for other commits).&lt;/p&gt;&#xA;&lt;p&gt;To add a new &lt;code&gt;all&lt;/code&gt; remote:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git remote add all git@gitssh.bacardi55.local:bacardi55/Blog.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It still need a default URL, so I choose my local one as the default. Then, we are going to use the &lt;code&gt;set-url&lt;/code&gt; remote command to add remote URLs to our repository.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;strong&gt;Warning&lt;/strong&gt;&lt;/strong&gt;: The first run of &lt;code&gt;git remote set-url…&lt;/code&gt; will remove the default URL and use the provided one as default. If you want the one entered in the command above to stay the first one, reuse it first!&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git remote set-url --add --push all git@gitssh.bacardi55.local:bacardi55/Blog.git&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git remote set-url --add --push all git@git.sr.ht:~bacardi55/website&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Running &lt;code&gt;git remote -v&lt;/code&gt; will now show the &lt;code&gt;all&lt;/code&gt; remote with the 2 push URLs:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-nil&#34; data-lang=&#34;nil&#34;&gt;all     git@gitssh.bacardi55.local:bacardi55/Blog.git (fetch)&#xA;all     git@gitssh.bacardi55.local:bacardi55/Blog.git (push)&#xA;all     git@git.sr.ht:~bacardi55/website (push)&#xA;local   git@gitssh.bacardi55.local:bacardi55/Blog.git (fetch)&#xA;local   git@gitssh.bacardi55.local:bacardi55/Blog.git (push)&#xA;srht    git@git.sr.ht:~bacardi55/website (fetch)&#xA;srht    git@git.sr.ht:~bacardi55/website (push)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then, &lt;code&gt;git push&lt;/code&gt; as usual but with the &lt;code&gt;all&lt;/code&gt; remote:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git push all &amp;lt;branchName&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Your code should be pushed in &amp;ldquo;all&amp;rdquo; remote repository now :).&lt;/p&gt;&#xA;</description></item>
    <item>
      
      <title>Walgot v0.2.0</title><link>https://bacardi55.io/2022/11/20/walgot-v0.2.0/</link><pubDate>Sun, 20 Nov 2022 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2022/11/20/walgot-v0.2.0/</guid><description>&lt;p&gt;I&amp;rsquo;m happy to announce &lt;a href=&#34;https://git.sr.ht/~bacardi55/walgot&#34;&gt;Walgot v0.2.0&lt;/a&gt;, a TUI client for wallabag, which come with many improvements.&lt;/p&gt;&#xA;&lt;p&gt;v0.2.0 is close to being &amp;ldquo;feature complete&amp;rdquo; for &lt;strong&gt;my use cases&lt;/strong&gt;.&#xA;I&amp;rsquo;m happy to add features for things I don&amp;rsquo;t use if other people use walgot and require some of the missing things (eg: tag and annotations).&#xA;The main item I&amp;rsquo;m not sure about for feature completeness is about a full offline mode… I&amp;rsquo;m still thinking about pros and cons :).&lt;/p&gt;&#xA;&lt;p&gt;The release note can be found below. I also added a couple of new screenshots:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/walgot/tree/main/docs/screenshots/index.md&#34;&gt;Walgot v0.2.0 screenshots&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The release note of the v0.2.0:&lt;/p&gt;&#xA;&lt;p&gt;Added features:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Copy URL (original or public) to clipboard via Y keybind&lt;/li&gt;&#xA;&lt;li&gt;Save a new entry on wallabag (&amp;ldquo;N&amp;rdquo;)&lt;/li&gt;&#xA;&lt;li&gt;Delete entry on wallabag (&amp;ldquo;D&amp;rdquo;)&lt;/li&gt;&#xA;&lt;li&gt;Search - Search for exact term (case insensitive) in article title (&amp;quot;/&amp;quot;)&lt;/li&gt;&#xA;&lt;li&gt;Filter for public articles in table view (&amp;ldquo;p&amp;rdquo;)&lt;/li&gt;&#xA;&lt;li&gt;Toggle for public status (&amp;ldquo;P&amp;rdquo;)&lt;/li&gt;&#xA;&lt;li&gt;Open article link in default browser (&amp;ldquo;O&amp;rdquo;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;And some UI improvements:&lt;/p&gt;&#xA;&lt;p&gt;On the article reading view:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Include all links footnotes instead of mid text&lt;/li&gt;&#xA;&lt;li&gt;Adapt reading view if screen size is small&lt;/li&gt;&#xA;&lt;li&gt;Display status (starred, new, public) in reading view footer&lt;/li&gt;&#xA;&lt;li&gt;Improve detail view with fixed title and % read&lt;/li&gt;&#xA;&lt;li&gt;Adapt footer depending on term height and width&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;On the listing view:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Adapt list view based on screen width to optimize info display&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Bug fixes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add notif after deleting an entry&lt;/li&gt;&#xA;&lt;li&gt;Add notif message after adding an entry&lt;/li&gt;&#xA;&lt;li&gt;Make scroll smoother when reading an article&lt;/li&gt;&#xA;&lt;li&gt;Prevent crash during reloading when trying to select an entry&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Others&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Maintenance: Upgrade dependencies&lt;/li&gt;&#xA;&lt;li&gt;Add some unit tests (needs a lot more)&lt;/li&gt;&#xA;&lt;li&gt;Add automated build on sourcehut&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Overall, a fun project to work on, the wallabag API&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; is easy, the wallabago library&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; too. And I enjoy more and more the TUI framework (and used libraries) bubbletea&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;. Makes me want to redo GTL with it, or find another cool TUI project to create :).&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://app.wallabag.it/api/doc&#34;&gt;Wallabag API&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/Strubbl/wallabago&#34;&gt;Wallabago github&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/charmbracelet/bubbletea&#34;&gt;Bubbletea github&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description></item>
    <item>
      
      <title>cleanABag, a tool to remove old articles from wallabag</title><link>https://bacardi55.io/2022/11/10/cleanabag-a-tool-to-remove-old-articles-from-wallabag/</link><pubDate>Thu, 10 Nov 2022 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2022/11/10/cleanabag-a-tool-to-remove-old-articles-from-wallabag/</guid><description>&lt;p&gt;Since I started working on walgot&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, a TUI client for wallabag&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;, I started thinking about &amp;ldquo;cleaning&amp;rdquo; articles from wallabag to avoid wasting storage (and make walgot even faster to load at the same time).&lt;/p&gt;&#xA;&lt;p&gt;In truth, 99% of the articles, once read, don&amp;rsquo;t need to stay on wallabag. Articles I want to bookmark are moved to a bookmarks.org file. But there are exception, and I&amp;rsquo;m using the &amp;ldquo;star&amp;rdquo; status in wallabag to keep some articles longer. Sometime, I just used the star as well as a reminder that I want to share it with friends (specially when behind paywall, I need to generate a public link and the mobile app doesn&amp;rsquo;t allow this).&lt;/p&gt;&#xA;&lt;p&gt;Anyway, long story short, looking at more than 1000s articles on my wallabag, the web UI didn&amp;rsquo;t help me do what I wanted quickly. My main use case is simple: I want to delete articles older than a special date, but keeping the starred and unread ones.&lt;/p&gt;&#xA;&lt;p&gt;So I coded a very quick and dirty little tool called &lt;code&gt;cleanABag&lt;/code&gt;, where one can simply give a date and delete all articles older than this date (with flags for keeping/removing unread and/or starred articles).&lt;/p&gt;&#xA;&lt;p&gt;For example, to remove articles not updated since the end of 2021, including unread (&lt;code&gt;-u&lt;/code&gt;) and starred (&lt;code&gt;-s&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cleanABag prune -c /path/to/config -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;2021-12-31&amp;#34;&lt;/span&gt; -u -s&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Nota&lt;/em&gt;: The command above will only do a &amp;ldquo;dry run&amp;rdquo; and won&amp;rsquo;t delete anything except if &lt;code&gt;--delete&lt;/code&gt; is added.&lt;/p&gt;&#xA;&lt;p&gt;Because of the way I use wallabag, I don&amp;rsquo;t remove stuff frequently, so having a tool to remove thing older than, for example, a year, deleting only archived and not starred articles, quickly is a nice way of not wasting storage (or bandwidth with remote client like mobile app or walgot).&lt;/p&gt;&#xA;&lt;p&gt;The code is available on source hut and the readme should be self sufficient:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://sr.ht/~bacardi55/cleanABag/&#34;&gt;cleanABag repository&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let me know if you have any comment on feedback.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/walgot&#34;&gt;Walgot&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://wallabag.org&#34;&gt;Wallabag&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description></item>
    <item>
      
      <title>Announcing walgot, a Wallabag TUI client</title><link>https://bacardi55.io/2022/11/06/announcing-walgot-a-wallabag-tui-client/</link><pubDate>Sun, 06 Nov 2022 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2022/11/06/announcing-walgot-a-wallabag-tui-client/</guid><description>&lt;p&gt;TLDR; I&amp;rsquo;ve writen a TUI wallabag client in golang called walgot, a very early version for now… Paint is still fresh but v0.1.2 has been released:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/walgot&#34;&gt;Walgot&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-wallabag&#34;&gt;What is wallabag?&lt;/h2&gt;&#xA;&lt;p&gt;For those who don&amp;rsquo;t know, wallabag&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; is an opensource &amp;ldquo;Read it later&amp;rdquo; application (like Pocket) that can easily be selfhosted.&lt;/p&gt;&#xA;&lt;p&gt;If you don&amp;rsquo;t want to selfhost, the lead of wallabag created wallabag.it for a managed version.&#xA;As I want to support the project I&amp;rsquo;m actually using wallabag.it as my wallabag backend, but walgot should work with any recent wallabag installation.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m using wallabag a lot, for saving articles from my RSS feeds, interesting links from the fediverse or even gemini pages via a small script and a proxy&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m using wallabag daily, from multiple devices:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;On my phone via the official wallabag application&lt;/li&gt;&#xA;&lt;li&gt;On my e-ink android tablet, with the same application&lt;/li&gt;&#xA;&lt;li&gt;On a computer, using the default Web client.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The last one, while easy to use, is forcing me to have a web browser opened and I find it not simple and snappy enough…&#xA;Also, if you know me a bit, you know that I&amp;rsquo;m a big fan of TUI and CLI applications…&lt;/p&gt;&#xA;&lt;p&gt;So, after not finding what I was looking for, I hesitated for a long time to actually create one… But here we are now :).&lt;/p&gt;&#xA;&lt;h2 id=&#34;creating-walgot&#34;&gt;Creating walgot&lt;/h2&gt;&#xA;&lt;p&gt;I decided last Monday to create a small PoC. I also wanted to try another TUI library called bubbletea&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;, which is &lt;strong&gt;very&lt;/strong&gt; different that tcell&lt;sup id=&#34;fnref:4&#34;&gt;&lt;a href=&#34;#fn:4&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;4&lt;/a&gt;&lt;/sup&gt; and tview &lt;sup id=&#34;fnref:5&#34;&gt;&lt;a href=&#34;#fn:5&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;5&lt;/a&gt;&lt;/sup&gt; that I&amp;rsquo;m using for building GTL&lt;sup id=&#34;fnref:6&#34;&gt;&lt;a href=&#34;#fn:6&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;6&lt;/a&gt;&lt;/sup&gt;. It uses the ELM&lt;sup id=&#34;fnref:7&#34;&gt;&lt;a href=&#34;#fn:7&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;7&lt;/a&gt;&lt;/sup&gt; architecture, which I wasn&amp;rsquo;t familiar with… But that I enjoy a lot now :).&lt;/p&gt;&#xA;&lt;p&gt;So on Monday, I started writing the first lines of code and even shared a first screenshot on the fediverse&lt;sup id=&#34;fnref:8&#34;&gt;&lt;a href=&#34;#fn:8&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;8&lt;/a&gt;&lt;/sup&gt; and a short video on Tuesday&lt;sup id=&#34;fnref:9&#34;&gt;&lt;a href=&#34;#fn:9&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;9&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After lots of refactoring and tests, I&amp;rsquo;m happy to announce the first public release of walgot v0.1.2:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/walgot&#34;&gt;Walgot&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;important-notes-about-walgot&#34;&gt;Important notes about walgot&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not going to copy/paste the README here, you can just go to the repository page for this, but a few important notes before you try it:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Walgot retrieve all articles at start and doesn&amp;rsquo;t use a local cache or local database, which means:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It requires an internet access, at least when starting, to retrieve all articles at first.&lt;/li&gt;&#xA;&lt;li&gt;Changing status (read, star) requires an internet access. It doesn&amp;rsquo;t save the status changes to be applies once connection is back.&lt;/li&gt;&#xA;&lt;li&gt;It may take a bit of time to start, depending on the number of saved articles on wallabag.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Walgot do not need internet connection to read articles after initial import, so if you just want to read articles and not change their status, you can go offline.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not sure if a local cache will be implemented one day, because it would add a layer of complexity I&amp;rsquo;m not sure I want to manage in such a simple tool. When I talk about complexity, I&amp;rsquo;m mainly thinking about consolidating different status managed by different wallabag client.&lt;/p&gt;&#xA;&lt;p&gt;In term of what it can do for now, in a nutshell:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Download all articles, display them in a navigable table (list view).&lt;/li&gt;&#xA;&lt;li&gt;Read article content (detail view).&lt;/li&gt;&#xA;&lt;li&gt;Change article status (read, star) from list or detail view.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;… And that&amp;rsquo;s mostly it for now :). I advide to read the README&lt;sup id=&#34;fnref:10&#34;&gt;&lt;a href=&#34;#fn:10&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;10&lt;/a&gt;&lt;/sup&gt; that has a big todolist at the bottom with what is implemented and what will be at some point.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Walgot is very early stages, but I had fun coding it so far :). Let me know if you try it and what you think! Happy to hear about potential improvements too!&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://wallabag.org&#34;&gt;Wallabag project homepage (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;&#34;&gt;Saving lagrange current tab in wallabag (Gemini)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/charmbracelet/bubbletea&#34;&gt;Bubbletea github page (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:4&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/gdamore/tcell&#34;&gt;tCell github page (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:4&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:5&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://code.rocketnine.space/tslocum/cview/&#34;&gt;cView git page (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:5&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:6&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/gtl&#34;&gt;GTL repository (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:6&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:7&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://guide.elm-lang.org/architecture/&#34;&gt;ELM architecture (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:7&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:8&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://framapiaf.org/@bacardi55/109265566964666531&#34;&gt;First screenshot of walgot (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:8&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:9&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://framapiaf.org/@bacardi55/109275964866137113&#34;&gt;First video of walgot (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:9&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:10&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~bacardi55/walgot&#34;&gt;Walgot README (HTTPS)&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:10&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description></item>
    <item>
      
      <title>Pimaton v0.0.4, introducing web features!</title><link>https://bacardi55.io/2018/02/13/pimaton-v0.0.4-introducing-web-features/</link><pubDate>Tue, 13 Feb 2018 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2018/02/13/pimaton-v0.0.4-introducing-web-features/</guid><description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;So as you know, &lt;a href=&#34;https://bacardi55.io/2018/01/12/introducing-my-new-project-pimaton-a-photobooth-app-for-raspberry-pi.html&#34;&gt;I&amp;rsquo;m building a photomaton app&lt;/a&gt; for my sister in law&amp;rsquo;s wedding. I&amp;rsquo;ve&#xA;released the &lt;a href=&#34;https://bacardi55.io/2018/02/06/pimaton-is-now-installable-via-pip.html&#34;&gt;v0.0.3&lt;/a&gt; not long ago and I think it&amp;rsquo;s time for the &lt;a href=&#34;https://github.com/bacardi55/pimaton/releases/tag/v0.0.4&#34;&gt;v0.0.4&lt;/a&gt; to be released.&lt;/p&gt;&#xA;&lt;p&gt;The goal of this version is to answer specific needs: What I want for&#xA;the evening, is for the photo to be synchronized online so everybody at&#xA;the evening can go and watch the picture and download them if needed.&lt;/p&gt;&#xA;&lt;p&gt;I didn&amp;rsquo;t want to duplicate the wheel here so I look for a simple photo&#xA;web gallery application. My choice went to &lt;a href=&#34;https://github.com/saimn/sigal&#34;&gt;sigal&lt;/a&gt;, a static gallery generator,&#xA;so I could do a simple script to automate the whole on the remote&#xA;server.&lt;/p&gt;&#xA;&lt;p&gt;Also, to simplify the process, I want to have a QR code displayed on the&#xA;waiting screen (only for GUI) to link to the web gallery url.&lt;/p&gt;&#xA;&lt;p&gt;Last thing I needed, is the ability after each &amp;ldquo;photoshoot&amp;rdquo; to have a&#xA;link for the people who took the pictures to go to a web gallery with&#xA;only the pictures taken of the group. So you can scan the QR code and go&#xA;download the specific pictures.&lt;/p&gt;&#xA;&lt;p&gt;So that&amp;rsquo;s why the &lt;a href=&#34;https://github.com/bacardi55/pimaton/releases/tag/v0.0.4&#34;&gt;v0.0.4&lt;/a&gt; I&amp;rsquo;m adding web capabilities: - Synchronize picture to a remote server&#xA;(DONE) - Display a QR code on waiting screen (DONE) - Put a QR code on&#xA;the generated file that link to each &amp;ldquo;run&amp;rdquo; of pimaton (DONE).&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve also decided to open a &amp;ldquo;pimaton&amp;rdquo; section on this blog (see menu at&#xA;the top of the page) to create a full tutorial on how to create your&#xA;photobooth from the hardware/setup to the creation of the box, with&#xA;Pimaton installation and configuration in the middle.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s still very early draft and needs a lot of work but &lt;a href=&#34;https://bacardi55.io/pimaton/part5-optional-webgallery.html&#34;&gt;the setup of the gallery&lt;/a&gt; is&#xA;the first &amp;ldquo;good&amp;rdquo; page of this new area of the blog. Hope it will help&#xA;any of you (or me when i&amp;rsquo;ll resetup everything for the D day) put yourphotobooth together :).&lt;/p&gt;&#xA;</description></item>
    <item>
      
      <title>Pimaton is now installable via pip!</title><link>https://bacardi55.io/2018/02/06/pimaton-is-now-installable-via-pip/</link><pubDate>Tue, 06 Feb 2018 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2018/02/06/pimaton-is-now-installable-via-pip/</guid><description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Yesterday was a small step for me entering the world of python packaging&#xA;:)&lt;/p&gt;&#xA;&lt;p&gt;As you&amp;rsquo;ve read before &lt;a href=&#34;https://bacardi55.io/2018/01/12/introducing-my-new-project-pimaton-a-photobooth-app-for-raspberry-pi.html&#34;&gt;I&amp;rsquo;ve decided to create a photobooth application for raspberrypi&lt;/a&gt; for a&#xA;wedding in August. Last time, I posted &lt;a href=&#34;https://bacardi55.io/2018/01/25/yesterday-pimaton-v0-0-3-alpha-was-put-in-used.html&#34;&gt;some pictures of the pimaton in action&lt;/a&gt; during an evening with a friend.&lt;/p&gt;&#xA;&lt;p&gt;Since the code seems stable and usable (all MVP features are done but&#xA;one: the GPIO button), I decided to follow my beloved &amp;ldquo;release early,&#xA;release often&amp;rdquo; principle and create a pip package so Pimaton can be&#xA;installed easily on a raspberrypi.&lt;/p&gt;&#xA;&lt;p&gt;I won&amp;rsquo;t spend time on how I created the package, as there is plenty of&#xA;documentation about it online already, and the process is pretty&#xA;straight forward :). The important thing is that it is now possible to&#xA;boot a raspbian on a pi and install pimaton in 2 minutes. The package&#xA;page is &lt;a href=&#34;https://pypi.python.org/pypi/pimaton&#34;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click on the image below to see a quick gif of the GUI (&lt;strong&gt;NOTA&lt;/strong&gt;: The&#xA;camera stream is not shown here as PiCamera handle it on its own above&#xA;X, check the video to see it fully. And the print option is disabled):&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;./static/images/posts/pimaton_gui_thumbnail.gif&#34;&#xA;    alt=&#34;Figure 1: Pimaton UI gif&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;p&gt;&lt;span class=&#34;figure-number&#34;&gt;Figure 1: &lt;/span&gt;Pimaton UI gif&lt;/p&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;You can see it working on quick video here: {{&amp;lt; youtube HJ43O-nPQzw &amp;gt;}}&lt;/p&gt;&#xA;&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;&#xA;&lt;p&gt;Now pimaton can be installed as simply as:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Install dependencies:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sudo apt install python-pip libjpeg-dev&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    pip install -U pip&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# To enable GUI:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sudo apt install python-tk python-pil.imagetk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    pip install pimaton&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, duplicate the default config file to start modifying it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cp /usr/local/lib/python2.7/dist-packages/pimaton/assets/default_config.yaml /path/to/myconfig.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then edit the configuration file. Read carefully the comment before&#xA;editing everything :) If you have X installed, I strongly suggest using&#xA;the GUI for now by changing the &lt;code&gt;ui_mode&lt;/code&gt; to &lt;code&gt;gui&lt;/code&gt;:).&lt;/p&gt;&#xA;&lt;p&gt;Then you can start running pimaton:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    pimaton --config-file&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/path/to/myconfig.yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    pimaton --config-file&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/path/to/myconfig.yaml --debug &lt;span style=&#34;color:#75715e&#34;&gt;# verbose mode.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;what-can-it-do-so-far&#34;&gt;What can it do so far:&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Take pictures and generate a final picture with thumbnails of the&#xA;taken picture (by default 6 pictures that will be displayed on 2 rows&#xA;and 3 columns)&lt;/li&gt;&#xA;&lt;li&gt;Print that picture if a printer is plugged in&lt;/li&gt;&#xA;&lt;li&gt;Very configurable:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;TUI (very basic for now) and GUI mode&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Multiple start input (keyboard, touchscreen and GPIO soon)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A template file (image with decoration to be the base of rendered&#xA;image) can be used&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A empty template with placeholder can be generated to help the&#xA;template image creation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Picture size (taken by picamera), thumbnails (printed pictures),&#xA;number and disposition of final rendering&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Time between steps / loops&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;All texts&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Print is an option, number of copies can be configured.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;All picamera settings can be overridden.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;More information can be found on the &lt;a href=&#34;https://github.com/bacardi55/pimaton/&#34;&gt;README&lt;/a&gt;.&lt;/p&gt;&#xA;</description></item>
    <item>
      
      <title>Yesterday, Pimaton v0.0.3 (alpha) was put in used!</title><link>https://bacardi55.io/2018/01/25/yesterday-pimaton-v0.0.3-alpha-was-put-in-used/</link><pubDate>Thu, 25 Jan 2018 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2018/01/25/yesterday-pimaton-v0.0.3-alpha-was-put-in-used/</guid><description>&lt;p&gt;So you might remember that I&amp;rsquo;m working on a photoboot application for&#xA;raspberrypi, as detailed &lt;a href=&#34;https://bacardi55.org/2018/01/12/introducing-my-new-project-pimaton-a-photobooth-app-for-raspberry-pi.html&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Yesterday, I had friends over at my place, so I thought I might do a&#xA;very small run of the application to actually test something closer to&#xA;reality than my &amp;ldquo;developer tests&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;I know that running a program over time might have impact, software&#xA;(memory limit, bugs and crash, &amp;hellip;) or hardware (printer issue,&#xA;connectivity, &amp;hellip;) so I thought do a first trial.&lt;/p&gt;&#xA;&lt;p&gt;We didn&amp;rsquo;t used it a lot (only 3 times over 3 hours, taking 18 pictures&#xA;and printing 6 pages (2 copies each)).&lt;/p&gt;&#xA;&lt;p&gt;The bad news is that we didn&amp;rsquo;t try it intensively as we should have (but&#xA;wedding is still very far away^^), but the good news is that it works&#xA;almost flawlessly. At least we could start taking pictures whenever we&#xA;want and the printer behaved correctly all night :).&lt;/p&gt;&#xA;&lt;p&gt;Obviously, I found some small issues in the UI (like step 7/3 ^^) and&#xA;missing element that I&amp;rsquo;ll fix before tagging the MVP v0.0.3 (as well as&#xA;some UI improvment as it is very ugly at the moment).&lt;/p&gt;&#xA;&lt;p&gt;It should arrive soon, even though I&amp;rsquo;ll probably won&amp;rsquo;t be able to work&#xA;on it before end of next week, as I&amp;rsquo;m travelling for work and don&amp;rsquo;t want&#xA;to take the pi with me (Or I might look into the possibility of&#xA;emulating the pi and picamera and gpio on a virtual machine.)&lt;/p&gt;&#xA;&lt;p&gt;[[Pimaton Dry Run pic]({{ &amp;ldquo;/assets/pimaton_dryrun_thumbnail.jpg&amp;rdquo; |&#xA;absolute-url }})]({{ &amp;ldquo;/assets/pimaton_dryrun.jpg&amp;rdquo; | absolute-url }})&lt;/p&gt;&#xA;&lt;p&gt;You can see above an example of the rendering (blank template so no text&#xA;or icons printed with the thumbnails), don&amp;rsquo;t worry, the picture are not&#xA;blurry, I just don&amp;rsquo;t like pictures of me on the internet :).&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ll update soon when v0.0.3 is stable and official :)&lt;/p&gt;&#xA;&lt;p&gt;If you want to try the exact version of the code I ran yesterday, look&#xA;at &lt;a href=&#34;https://git.bacardi55.org/bacardi55/pimaton/commit/0a3207fed81528cfbea56929ad0028940990461c&#34;&gt;this specific commit&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;For more information, you can read &lt;a href=&#34;https://git.bacardi55.org/bacardi55/pimaton/src/master/README.md&#34;&gt;the README&lt;/a&gt; that should always be up to date with the latest code version/&lt;/p&gt;&#xA;</description></item>
    <item>
      
      <title>Introducing my new project: Pimaton a Photobooth app for raspberry pi</title><link>https://bacardi55.io/2018/01/12/introducing-my-new-project-pimaton-a-photobooth-app-for-raspberry-pi/</link><pubDate>Fri, 12 Jan 2018 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2018/01/12/introducing-my-new-project-pimaton-a-photobooth-app-for-raspberry-pi/</guid><description>&lt;p&gt;Hello everyone!&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;As said in my &lt;a href=&#34;https://bacardi55.io/2018/01/10/2018-is-here.html&#34;&gt;previous post&lt;/a&gt;, I offered for my help to setup a photo booth for the wedding of my sister&#xA;in law. I proposed this as I&amp;rsquo;ve seen numerous project on reddit or&#xA;elsewhere about DIY methods based on raspberry pi.&#xA;For the few readers of this blog, you must know my love for the Pi (I&#xA;think now I have 1 pi2, 1pi0W and 6 pi3&amp;hellip;) so I thought it would be&#xA;great to not only do geeky stuff on them (code, hosting, &amp;hellip;) but&#xA;something that non geeky people will also enjoy using, with a bit of&#xA;hardware (creating the box) too.&lt;/p&gt;&#xA;&lt;p&gt;I look again on the internet and saw a a lot of great project like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://jackbarker.com.au/photo-booth/&#34;&gt;This one by Jake Barker&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/zoroloco/boothy&#34;&gt;Boothy&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.drumminhands.com/2014/06/15/raspberry-pi-photo-booth/&#34;&gt;drumminhands&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/johols/RPi-photobooth&#34;&gt;Rpi photobooth&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&amp;hellip;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;But while these are great project and good inspiration, it didn&amp;rsquo;t do&#xA;what I exactly wanted or I didn&amp;rsquo;t like how it was done&amp;hellip; So like a&#xA;nerd, I starting hacking away to create a small PoV&amp;hellip; PoV that will&#xA;soon be published as 0.0.1 and opensourced (&lt;strong&gt;Note&lt;/strong&gt; 0.0.1 won&amp;rsquo;t be a&#xA;fully usable project yet, but I like the principle of release early&#xA;release often^^).&lt;/p&gt;&#xA;&lt;p&gt;This post is about introducing and describing the project, other posts&#xA;will come soon with the evolution of the code and the construction of&#xA;the box as this is really work in progress so far.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-idea-of-my-photo-booth&#34;&gt;The idea of my photo booth&lt;/h2&gt;&#xA;&lt;p&gt;Requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A simple box with a screen that tell people to get pictures&lt;/li&gt;&#xA;&lt;li&gt;A big hardware button that people wouldn&amp;rsquo;t miss even tired (hum hum)&#xA;at 4am to start the process&lt;/li&gt;&#xA;&lt;li&gt;Pressing the button will start taking several pictures&lt;/li&gt;&#xA;&lt;li&gt;A UI that tell me when the pictures will be taken with countdown- Print the taken pictures all in image like a photo booth (X time).&lt;/li&gt;&#xA;&lt;li&gt;Use a &amp;ldquo;template&amp;rdquo; system (base image) to personalized the&#xA;background/texts of the printed pictures (eg: adding the names and the&#xA;date at the bottom of the page or anything)&lt;/li&gt;&#xA;&lt;li&gt;Save all the picture for the newly wed&lt;/li&gt;&#xA;&lt;li&gt;Configurable system to be reused easily.&lt;/li&gt;&#xA;&lt;li&gt;Installable via pip for simplicity&lt;/li&gt;&#xA;&lt;li&gt;Maybe: Add a flash / lights in case of dark place&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;And if I have internet on the Pi, I also want to - Sync pictures on a&#xA;webserver (outside of the pi for performance reasons) - Generate QR code&#xA;to give a link so that people could go download the picture for&#xA;themselves too (linked to above) - Ask to receive pictures via email -&#xA;Maybe: A &amp;ldquo;end of party&amp;rdquo; action, where it zip all pictures and send a&#xA;downloadable link to everyone.&lt;/p&gt;&#xA;&lt;p&gt;And if using a touchscreen: - Add a button to see a slideshow of the&#xA;taken pictures - Add an option for taking picture with or witout flash&#xA;(if flash installed)&lt;/p&gt;&#xA;&lt;p&gt;If possible, translatable too (I&amp;rsquo;m coding everything in english but I&amp;rsquo;d&#xA;like to have it setup in French for this wedding)&lt;/p&gt;&#xA;&lt;h2 id=&#34;where-i-am&#34;&gt;Where I am ?&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve done this very small roadmap: - v0.0.1: Core features: - Taking X&#xA;pictures and displaying them on a single compiled image (with a template&#xA;image) - Configurable via a yaml file - Taken and pictures pictures&#xA;share a unique key to retrieve the full group of pics easily later on. -&#xA;v0.0.2: Printing capabilities + hardware button input - v0.0.3: UI&#xA;implementations (Implement both option for CLI on GUI) - v0.0.4: Web&#xA;capabilities (if I decide to go that way) - v0.0.5: Optional stuff&lt;/p&gt;&#xA;&lt;p&gt;System will be fully usable starting v0.0.3.&lt;/p&gt;&#xA;&lt;p&gt;As of now, I have done all the v0.0.1 items, including the main&#xA;architecture of the app, with a configuration system and the core&#xA;features around pictures. System will take X (configurable) pictures,&#xA;will create thumbnails (size configurable). Then it will load the&#xA;configured template if any (based image that might contains decorations)&#xA;and paste the X image on as needed (depends on the number of pictures&#xA;and the number of rows/columns configured).&lt;/p&gt;&#xA;&lt;p&gt;So that&amp;rsquo;s working pretty well :).&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve started working on the v0.0.2 this week end, now the system is able&#xA;to print the generated image. I now want to add the hardware button as a&#xA;configurable option (meaning you can either do it via the button or keep&#xA;it via keyboard. on v0.0.3 it will also allow to choose GUI).&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-hardware&#34;&gt;The hardware ?&lt;/h2&gt;&#xA;&lt;p&gt;I think I&amp;rsquo;m going to do a more complete post on that when I&amp;rsquo;ll talk&#xA;about building the box but as of now, I have:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a Raspberry Pi with raspbian installed.&lt;/li&gt;&#xA;&lt;li&gt;a PiCamera&lt;/li&gt;&#xA;&lt;li&gt;a 7&amp;quot; touchscreen and its box&lt;/li&gt;&#xA;&lt;li&gt;a Canon selphy CP 1200 to print the picture (connected via USB, not&#xA;WiFi)&lt;/li&gt;&#xA;&lt;li&gt;a big arcade push button (not connected yet)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;where-is-the-freaking-code&#34;&gt;WHERE IS THE FREAKING CODE ??&lt;/h2&gt;&#xA;&lt;p&gt;Well, it&amp;rsquo;s not open yet, but will be soon, probably this week end. I&#xA;will wait for the 0.0.3 to advertise more for it but the source code&#xA;will be accessible to the couple of people reading these pages :).&lt;/p&gt;&#xA;&lt;p&gt;That&amp;rsquo;s it for now, but stay tune for news soon :)&lt;/p&gt;&#xA;</description></item>
  </channel>
</rss>
