=> ..
So, at this point you should not be surprised at a blog that talks about making and optimizing the way this blog is done. I already made some posts talking about the way I made creating blogs easier[1] for me, so now I will talk a bit more, but this time about the blog layout itself.
I have made some changes to the CSS, as well as modifying some pages, such as the tags[2] and blogs[3] one. Up until the creation of this post, the blog archive has been a relatively small list of all of the blogs I've made. However, thinking about the future, I wanted to split all of this into sections, divided by year and month. To do that, a asked for suggestions[4] on Mastodon. And of course, I got some replies. I ended up on Stack Overflow and found some ways to do what I wanted.
After a check there, I added the following lines to my blog.md file (located on my site's root directory). {% raw %}
{% assign postsByYear = site.posts | group_by_exp:"post", "post.date | date: '%Y'" %} {% for year in postsByYear %}{{ year.name }}
{% assign postsByMonth = year.items | group_by_exp:"post", "post.date | date: '%B'" %} {% for month in postsByMonth %}{% endfor %} {% endfor %}{{ month.name }}
{% for post in month.items %}
- {{ post.title }}
{% endfor %}
{% for tag in post.tags %} {{ tag }} {% endfor %} 📅 {{ post.date | date: "%Y-%m-%d" }}
{{ post.description }}
{% endraw %}
I made use of the nice <details>
HTML element which is quite pretty thanks to Simple.css[5], the CSS framework I am using right now. I also used them to the tags page, which has a similar structure to the blog, although is quite simpler.
{% raw %}
{% for tag in site.tags %}{% endfor %}{{ tag[0] }}
{% for post in tag[1] limit:3 %}{{ post.title }} - 📅 {{post.date | date_to_string}}
{% endfor %} All posts RSS
{% endraw %}
Of course all of this might be quite weird and I am not going to pretend that I understand it all! I added tags a while ago and it took me some time to get the grasp of it. Remember that as a Jekyll SSG user it is my duty to let you all know of every little piece of liquid, HTML or ruby code I add to it!.
This was day 27 of #100DaysToOffload[6]. Dont you love it when most of your blog consists of copy pasting already existing text and avoiding to explain most of it assuming your audience will understand it? I hope you did because I am done with this. I hope you read next one (and I hope its not as lazy)
If you want you can check more about this here:
=> 1: /blog/rofi-automated-blog | 2: /tags | 3: /blog | 4: https://fosstodon.org/@joeligj12/105936877426053202 | 5: https://simplecss.org | 6: https://100DaysToOffload.com | 7: https://stackoverflow.com/questions/22044488/jekyll-code-in-jekyll#22045747 | 8: https://stackoverflow.com/questions/19086284/jekyll-liquid-templating-how-to-group-blog-posts-by-year This content has been proxied by September (3851b).Proxy Information
text/gemini