Tweaking Weblog - Pt. 1
Maybe my favorite feature by omg.lol is Weblog, this simple engine to create blogs and whole, cool websites. It can also host files, so it is a mini-CMS, or better a mini-database for text files that works perfectly.
Lately, I’ve played with it quite a lot. Here are some of the changes I made.
The Medialog
As a personal space to keep track of the media I consumed (books, movies, videogames, tv series, and maybe other). I took inspiration on memo’s medialog1 : it is simple and just does its job. I just added the rating, it was already perfect.
This was also the occasion to learn some more CSS (damn flex boxes, now I start to understand and how you work). I added the “spoiler” feature and some other functions, and now it is a proper archive which will I’ll populate over time.
It would be nice to understand if it is possible to paginate the number of items in each page… We’ll see!
The “Reply by Mail” Link
I had already written about anti-spam ways to share your email in websites… And then I made in a slight different way. 🙃
The link calls a script:
<p>
<a href="javascript:msg('bWFpbEBleGFtcGxlLmNvbQ==');">Reply by email ✉️</a>
</p>
…which dynamically creates the right mailto:
link with the post title (here below it is expanded so you can’t see the variable):
function msg(encoded) {
var address = atob(encoded);
window.location.href = "mailto:" + address + "?subject=Reply%20to%20{title}";
}
The email address is encoded in base64 in the link, but the “double jump” makes quite difficult for scrapers to find it.
For most technical users it may be very basilar or simple, but building a custom solution made me feel like Hackerman.2
IndieWeb’s h-card and h-entry
Inspired by Flame’s post, I set up a h-card and h-entry templates for Weblog’s pages and posts. I like the concept of IndieWeb, but at the moment… I wouldn’t know how to add comments or webmentions. I’ll think about it, but in the meanwhile it is a small step in this direction.
The One and Only CSS file
Weblog comes with two templates (one for the pages, one for the posts), each with its own stylesheet. A few days ago, I had an idea: What about to save a single .css file, as for ‘robots.txt’?
I tried, and it worked flawlessly! And then… I figured out that the exact example was published but Adam a few months before. A bit more research would have helped, but I’ll just say that, at that time, I didn’t follow the newsletter yet. 🫠
Overall, for anyone interested, I’m keeping the Weblog configuration in a Git repository.
Maybe my favorite feature by omg.lol is Weblog, this simple engine to create blogs and whole, cool websites. It can also host files, so it is a mini-CMS, or better a mini-database for text files that works perfectly.
Lately, I’ve played with it quite a lot. Here are some of the changes I made.
The Medialog
As a personal space to keep track of the media I consumed (books, movies, videogames, tv series, and maybe other). I took inspiration on memo’s medialog1 : it is simple and just does its job. I just added the rating, it was already perfect.