Soemarko Ridwan

iOS & Web Developer ⟡ Coffee Addict ⟡ Scuba Diver


Posts filed under Programming


Clean -- New bludit theme
Clean -- New bludit theme

It is done. Believe it or not, I made it live, here. It was done within like 3 hours. I simplified and removed a lot of things and dependencies. I always hated the way the old one always slightly off to the side. I've spent too much time fighting with the percentage width and scaling it with css @media queries. And it never looked right.

So here, a back to basic theme, single column view with no stupid / magical CSS or JS. It'll look right on any devices without needing any kind of magic on it. You can also use this theme. It is released under MIT. So please, use it, change it, do whatever you like with it.


Bludit’s Automated Regular Backup

So I just had a real scare, this blog suddenly just show this error on screen: Theme 'quark' does not exist, unable to display page. I was like, wtf?! And ready to scream in Bludit’s support chat room. But luckily before I did that, I looked for the backup I made when I updated bludit, then I saw it. The file structures all fucked up, seems like the shared hosting company did some kind of roll back and merged this /blog/ folder with old files, htmly files to be specific. And among other things, the index.php file was overwritten too.

I’m glad that the files under ./bl-content are intact, so I can create a clean backup from there. Nuke the whole thing, and start a new bludit instance, and restore the content. As usual, I need to learn things the hard way. Now I need to look into automated regular backup, from the situation mentioned above, you’d already know how simple it is to back-up a Bludit’s site. Just create a script to zip-up a directory, and throw that script into crontab. And here’s the script:

Read more…


Updating Bludit
Updating Bludit

I’m sure this also applies to any other flat file CMSs. Before doing anything, make sure of a few things below:

  1. Backup. Bludit backup plugin exists, but it currently has a weird bug where you need to download the file via ftp instead of from the plugin page. But I prefer just zip up the whole thing and create a snapshot outside of the installation.
  2. Do not touch the core. Anything under bl-kernel in Bludit’s case. If you need to touch the core, consider using other CMS or framework instead. If you touched the core, you literally maintain another fork of the CMS.
  3. Duplicate and renamed modified plugins. Plugins are okay to touch, just make another copy, rename, change the metadata a bit, and do whatever changes you need. This way, the changes will not get restored to the original state when files are being overwritten. For example, I duplicated the Search plugin, because I want to remove the submit button and user just need to hit return to execute the search. I just duplicate everything and call it “Search Clean.

Now with everything above is done, all you need to do is exactly like the cover image:

  1. Merge all folders
  2. Overwrite all files
  3. done.

ez pz


Wat?!

This talk is from 2012, but I just came across it. It is hilarious and too good to not share.

source


Dark Mode + CSS
Dark Mode + CSS

MacOS Mojave comes with the OS wide “dark mode” which sounds pretty awesome, I’m still on High Sierra. But I’m gonna update it soon, it’s already downloaded itself onto this Mac, and I want my disc space back.

That said, even with dark mode on, you’re going to be blinded with with a suddenly bright websites. For that, Safari is going to have a special media query for color scheme. First, you need to [download Safari Release 68] and making sure that Dark Mode CSS Support is turned on in the Develop > Experimental Features menu, and then you can add the following into your CSS:

div {
  background-color: pink;
}

@media (prefers-color-scheme: light) {
  div {
    background-color: yellow;
  }
}

@media (prefers-color-scheme: dark) {
  div {
    background-color: purple;
  }
}

Dark mode CSS

How simple is that?! I’m just touching the surface for the overall implementation, if you want to do this right, please read further into it.


The Six Stages of Debugging

  1. That can’t happen.
  2. That doesn’t happen on my machine.
  3. That shouldn’t happen.
  4. Why does that happen?
  5. Oh, I see.
  6. How did that ever work?

source


Flat file CMSs quick comparison
Flat file CMSs quick comparison

Something clicked with me when I came across htmly. It made perfect sense for the future of my writing. So I wanted to make the move ASAP, and here we are. I only did a cursory look into these flat files CMSs, and installed and tests a few of them, so take these thoughts with a grain of salt;

htmly: abandonware, it’s no longer actively developed. Doesn’t look good out of the box (and none of the available themes are particularly good).

Grav: very powerful, too powerful. The only one (that I’ve looked into) that can be setup without dashboard / admin site. But, it’s a bit tricky to setup as a blog because file structures is needed for these flat file CMSs, blog posts are a bit cumbersome to manage as flat files.

I’m not a fan of the admin side, reminded me a lot of the complexity of Wordpress. There are these “skeletons”, it’s kinda like this premade sites to get you up and running faster, but that just screams finicky to me.

Kirby: read good things about it. Not free, so a pass for now.

Bludit: perfect for my case, see that bolded text on my previous post about tumblr? This is exactly that. Dead simple blogging system (it’s not a platform), add new page, write in markdown, save, bam a new blog post. Looks good out of the box, but I’m using the micro theme (modified it so it's slightly larger, and I'm calling it Mini -- which I may or may not release it, no promises).

Pico: haven’t installed this one, since my heart is set on Bludit. It seems more capable than Bludit, but not as complex as Grav.

I’m really liking these flat file CMSs. Like, mechanically simple, yet robust. They can't do any of the tricks with database like left join etc. Do we really need those features for blogs? The contents are files so the search function will be on the terrible side, but we have google for that. Even with database you'll likely to roll another indexing engine to have a better search anyway.

Seriously, look into these flat file CMS, it may be perfect for your next web project.