Programming a new blog engine / catching up with web technology

I am sure that most developers go through this. A blog engine seems like a fairly simple project and I can certainly do this better than x, y, and WordPress... Of course I can't! But I can make a blog engine that works exactly the way that I want it to. And more importantly, building this is a great way to catch up on recent web-technology - which I needed to do.

I have used different "blog engines" over the years (with this and a few other blogs) starting with DasBlog, then BlogEngine.NET, at some point Blogger, and most recently WordPress.com. I like different features from each one of these, so I had a pretty good idea what I wanted.

So this and a few other blogs are now running on my new blog engine built with the following good stuff:

Bootstrap

I know - everybody is using Bootstrap. But I am NOT a designer, and this is an easy path to "responsive design" and generally having a nicer look - even if that means looking like a LOT of other sites.

Users probably don't care much anyway - it might even make it easier that things look and feel familiar.

I am currently also in the process of "bootstrapping" our business web-sites including jhsoftware.dk, simpledns.com, etc.

Markdown

One thing I really liked about WordPress was support for writing blog posts in Markdown syntax. This is just very simple and clean compared to HTML - and especially compared to the HTML that comes out of most wysiwyg HTML editors.

I have implemented this using CommonMark.Net - a nice open source C# library for converting CommonMark to HTML.

BTW: I am writing this text in Stack Edit - a very nice online Markdown editor.

HTML5 form validation

I was looking into jQuery Validation and other ways to do client side form validation in the browser, when I stumbled on HTML5 validation attributes - like "required" and "pattern", and input types like "email" and "number".

After reading up on this and running a few tests, I realized that this is no longer dreamy future stuff - it actually works in something like 95% of people's browsers - now.

This means that rather than using another library or some custom javascript validation, it is feasible to base a new web application entirely on HTML5 form validation. At least it makes it reasonable to ask users to upgrade their browser if they want to use the app.

This is huge! This really makes it a lot easier developing web applications going forward.

I also just went and implemented this on all forms on https://simpledns.plus

Just wondering why I don't see this on more web-sites? It is rather obvious (and pretty nice) when a form submission is being prevented due to HTML5 validation by the browser...

JSON

Everything is JSON behind the scenes - stored in plain text files.

Keeping everything in JSON also makes it simple to use the data directly with AJAX calls.

Side note: One of the great things about building a new web-site from scratch is that there is no old XML stuff that needs to be supported :-)

ASP.NET Web Forms

I know .NET in and out and I have been working with ASP.NET web forms for many years. So, for me, this is the best server side platform. I did play a bit with the newer "Razor" syntax, and I can certainly see some benefits. But my focus is more on the client side stuff right now. And as I see it, the server side "view engine" becomes less important as more and more rendering is moved to the client.

Even though this site is built with ASP.NET web forms, you won't find any URLs ending with ".aspx" (the default web forms page file extension). I hide them with "route maps" (System.Web. Routing.RouteTable. Routes.MapPageRoute) just because I think it looks nicer and cleaner.

Disqus

For visitor comments I settled on Disqus - for now.

I am a bit torn on this, as I would prefer to store this data myself rather than relying on a 3rd party. Visitor comments are just as much part of a blog as the articles, and just as important.

But Disqus is widely used and recognized. And visitors might be more likely to actually leave a comment with this system - especially if they already have a user profile with Disqus.

Microsoft Azure

All my web sites are currently hosted in the cloud with Microsoft Azure. Low cost, easy to manage, and no maintenance work. And I can publish updates directly with Git.

PhotoSwipe

Nice JavaScript library to present photos. And swiping works on iPads and other touch things. http://photoswipe.com