Welcome the new blog
Good lord, it has been quite a while since my first blog, let alone my last one. Unfortunately everything is extremely painful to extract and I have basically conceded to the thought that I'll never be bothered to recover them.
But let's get nerdy with the existing blog!
How it works
The whole blog is entirely markdown, powered by Parsedown. All entries do get stored in a database which kind-of sucked, however I needed a really easy way to organize posts without having directories under directories. Organizing media was also kind-of important, but I threw that away in favour of an easier to use image uploaded.
When creating a post, I have a web form that I fill out which is just a giant textarea - this is where I punch in the post. Under the post is a button that allows me to upload a feature image, so the front page can be a little prettier.
When hitting submit, the image uploads after some checks and the markdown page get's sent to the database. Nothing special. Not until you hit "blog" up the top.
The blog template is powered by a blog functions page, which collects and pre-processes all the data ready to be displayed, which is how we get page titles and feature images separate to the power. The feature image is a value stored separately, which I could probably change later, but the title isn't; php simple grabs the first h1 tag after Parsedown has processed the Markdown and uses that. Neato huh? Okay I lied; I just used CSS.
Ever tried to move data around the place and hope it stays consistent?
Well I do frequently and I figured I'm better off being able to pull all my posts with a script from a simple database, like one that stores the page id, content and featured image name, than to muck around with Wordpress. I'm also shielded from proprietary formatting and exploits from a COTS. So simply put, a simple Smarty-powered templating engine with a dead simple PHP script loading a simple Markdown Parser to generate a display from simple data was the easiest and quickest way to get things setup the way that I like them.
I can also expand it in the future, creating categories and the like if things get crazy.
Why custom code?
I have been using Wordpress since I can remember but I also started creating my own modular CMS about eight years ago. This was meant to be a joint project and interest wasn't there from my other party, and skill wasn't there from me, so it ended up fading away into a long-lost Subversion repository.
A few years ago I was creating lots of webapps like blogs, news scrapers, forums, social media communities and various landing pages for clients. I needed a quick way to get things happening which is how the framework for this site came to be.
It started off with "I'll just use smarty to keep a persistent header/footer" then went on from there. Everything is powered by index.php which gets it's information passed to it by .htaccess. index.php will dissect the pretty links and infinite number of times, and select the correct template and supporting functions needed to display the page, if it's passed a safe-list.
If the page isn't whitelisted, the website will 404. If the page is whitelisted, it can basically do whatever it wants or display whatever it wants. Each page has it's own template, allowing me to code in whatever modules I need to and omit whatever is not needed. They're also pretty smart, so I can side-load custom css into it with ease (check the page source of each page on the site to see what I mean).
Eventually, I'll have it "precompile" all the pages into minimized pages, hopefully eliminating the need for more than one page load (excluding images) per request. I also want to pre-process images on upload, so that various sizes are created and employed in different places. Until then though, I need to create the rest of the pages...
No bootstrap this time?
Nope. I didn't use 99% of the features Bootstrap gave and of the 1% that I used, I ended up hacking with a custom_bs.css anyway, so I have dropped it. In addition to Bootstrap, I have dropped a responsive grid from this page too because having a grid wasn't really needed.
The webpage might have it's flaws and not work here and there, but it doesn't what's needed.
I also wanted a minimal effort, easy-to-read page employing whitespace to break the layout up, instead of borders, colors or images. Bootstrap does this well but it's not 'basic bitch' enough for me.
Can you build me a site?
Absolutely, if I have the time. I have a backlog of jobs at the moment as well as a full time position, so time isn't really on my side here. It's always best to visit book me to see if I'm available.
Image courtesy of a Google search. If you own it and want to have a sook, hit bug me.