Welcome to my blog

Place where I share and archive all useful things from different fields as Audio, Video, Electronics, Programing, Photography and stuff. 


Last articles :


09.08.2017

Pretty Primitive Press

In every mans live is time when he or she would like to have blog. But usually it ends up pretty soon or even doesn't start at all. Luckyli I managed to do otherwise and success!

I wanted something simple just to type some article and put some pictures, nothing really fancy. Wordpress seems like options, but since I already had little bit of experience fiddeling with it I wanted to avoid the time you spend just understanding what someone else mind created. So I decided to write my super simple PHP back-end. 

Main features:

  • No DB
  • No user management
  • Around 200 lines of code.
  • No installation
  • Recursive panels loading desing
  • Plugins!

All is based on simple idea. Create some html page that contains meta element with bins property. Bins can be understand as categories, this article has bins "programing php". So if you push button programming backend will load all articles that contain programming bin to defined element. 


<meta bins="programing php">


Also when html page is processed backend checks for filler property of div. If it is found corresponding bin is placed inside. 

All this was meant to be as simple as possible, but also flexible. Right now main page looks like this:


  <div filler="header" id="header" > Header </div>  
<div id="contentWrapper">
<div class="well well-lg">
<div class="well well-lg">
<div filler="content" id="content" > Hlavni stranka </div>
</div>
<div filler="footer" id="footer" > Footer </div>
</div>
</div>


As already written, also the loaded filler is checked if there is element needed to fill. So you can create one html block and then place it into other html blocks. And when you change it on place the change can be seen everywhere.

There is another key component. I wanted some user friendly GUI for creating and editing the content. So writing articles and some small changes could be done without external editor. I started with WYSIWYG bootstrap rich text editor, but unfortunatelly its way too simple. So I ended up with Summetnote. The result code is not so pretty as it could be using bootstrap for handling styles, but from user point of view it's way better for styling and including pictures and etc.

Result is that I spent couple of days playing and creating something I can like or hate sometime. But after all I learned something and at least I have idea what going on under the hood.