This is a text-only version of the following page on https://raymii.org:
Title : Site updates, new layout for overview pages
Author : Remy van Elst
Date : 04-05-2018
URL : https://raymii.org/s/blog/Site_updates_new_layout_for_overview_pages.html
Format : Markdown/HTML
This site is generated with my [self-written open source static site generator named ingsoc] (named after 1984). I've update
d the overview pages with a new layout so that items are sorted by their publishing date instead of alphabetically. I've also r
ewritten some internal logic regarding tags and categories. This article shows the difference before and after and includes som
e old screenshots of raymii.org
Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics.
Please, if you found this content useful, consider a small donation using any of the options below:
://leafnode.nl">I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go che
ck it out!
Consider sponsoring me on Github. It means the world to
me if you show your appreciation and you'll help pay the server costs.
ode=7435ae6b8212">You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60
The software suite is named `ingsoc`, the actual site generator is named
`newspeak.py`. Read more on it [here]. Before the generator this was a PHP
site, but who needs a dynamic scripting language if all you do is host non-
`ingsoc` has the concept of categories. My site is divided into the following
If I want I can add any number of categories. When I started twelve years ago
the site it seemed that that division into categories was enough. But soon I
wanted to be able to have more options to categorize an article. A tutorial
about a VPN can be on Ubuntu or CentOS or IPSEC or OpenVPN and I wanted to be
able to group similar articles. I did not want a million categories since that
would not fit the target, an article can only have one category.
Tags to the rescue. I built in tags to the generator and created seperate RSS
feeds per tag and an overview page for each tag listing the articles per tag.
Like categories, but way more.
Tags are cheap, the current site has 927 tags, v.s. 5 categories.
So why not ditch the categories all together? Well, they are used in the URL and
it is good to have one 'main' category for an article to fall under. That is has
multiple tags, is in my opinion, different. A tutorial is still a tutorial no
matter which OS it applies to.
The front page has a configurable number of items listed with a summary per
item. A year ago I added the 'everything' page, which houses all items sorted by
date. Looking at the statistics, both that page as well as the tag overview
pages are the most visited parts of the site next to the articles. I got some
feedback recently that the sorting was off and the person that emailed me
thought it was more logical to sort it by date. Which I agreed with
So off to the Python code it was.
Oh if you are wondering, this is how the code output looks during a deploy:
### Before and after
Before, tag pages, category pages and the All Items page were three different
methods in my pyhton code. Different looks and layouts, thus less simple to
maintain or change. Look at what they are now with the pictures below.
This is the old 'tag' view:
This is the new 'tag' view:
As you can see, the date is added and sorting is on that date now. If I want I
descending, but that is for a later time.
This is the old 'category' view:
This is the new 'category' view:
As you might notice, it looks very similar to a tag page. That is because it is
a tag page, not a category page. I added the category as a tag to all pages, so
that the layout and code is the same. I removed the category view and made those
into redirects. Instead of two code paths, I now have only one.
This is the old 'everything' page:
This is the new 'everything' page:
Here again, you might notice it looks like a tag page as well. Again, it is. I
sneakily add the `all` tag to all items and filter it out in the HTML. It is
used here, and it saves me another code path. This way my python code is more
simple and more easy to maintain. This page before was already sorted on the
date, but it was not visible. It is now to have a better overview of the
### Conclusion and old screenshots
By reducing the code paths it is both simpler for me to maintain and change the
code and the layout is the same in all three cases. Plus it was fun to go into
my code and add sorting with `DateTime`.
If you are wondering how this site has looked before, here are screenshots.
#### 2010, PHP
The frontpage in 2010, when this was still PHP:
A news item:
An overview page:
The links page, with a dynamic thumbnailer that also did borders and site
screenshots (in PHP with gd):
#### 2012, PHP
Still PHP, but a new layout. Notice the modern "Metro" look before Microsoft did
An overview page:
I had a special text-only version of the articles for text based browsers and
#### 2014, static site and themes
In 2014 the static site came around. I had cool dynamic CSS to create both a
dark and a light theme (like Solarized). The dark theme was removed late 2016.
This layout and site is still mostly in use today.
The 'Dark' frontpage:
The regular frontpage:
A dark overview page:
A regular overview page:
A dark article:
A regular article:
All the text on this website is free as in freedom unless stated otherwise.
This means you can use it in any way you want, you can copy it, change it
the way you like and republish it, as long as you release the (modified)
content under the same license to give others the same freedoms you've got
and place my name and a link to this site with the article as source.
This site uses Google Analytics for statistics and Google Adwords for
advertisements. You are tracked and Google knows everything about you.
Use an adblocker like ublock-origin if you don't want it.
All the code on this website is licensed under the GNU GPL v3 license
unless already licensed under a license which does not allows this form
of licensing or if another license is stated on that page / in that software:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
Just to be clear, the information on this website is for meant for educational
purposes and you use it at your own risk. I do not take responsibility if you
screw something up. Use common sense, do not 'rm -rf /' as root for example.
If you have any questions then do not hesitate to contact me.
See https://raymii.org/s/static/About.html for details.