The Great Blog Rewrite
Back in 2014 I moved away from blogger to a self-hosted blog. I considered several options at the time and ended up forking Miniblog.
This Christmas though, I've just finished a complete rewrite of this blog from the ground up using ASP.NET Core 2.0.
There were two main motivations for this. First of all Windows Live Writer is now effectively dead, and although the new Open Live Writer project seems promising, it still lacks some important features I want, and in any case I wanted to move to storing all my blog posts in Markdown.
Second, if you want to learn a new technology, build something with it! I wanted to get to grips with ASP.NET Core 2 and a blog is a nice sized puzzle to tackle - not too trivial, but not too huge. In the end I spent up taking about 3 days to complete the project. It was quite a journey and I plan to blog about some of the things I learned along the way. Here's a few of the highlights:
- Started off using Razor pages but ended up realizing that regular MVC controllers and views made life easier
- Made plenty of use of partial views - a great way to declutter your views
- Instead of building on bootstrap, I created the CSS from scratch. This means no rules that I don't need or don't understand! Of course this involved plenty of F12 tools and "inspect element" to learn tricks from other sites.
- I borrowed lots of ideas from Miniblog.Core, particularly things like:
- Open Graph headers
- Minification
- Caching
- RSS and Atom feed implementation
- Coded in VS Code rather than Visual Studio. I'm really loving the lightweight and fast VS Code experience. It still lags VS2017 very slightly in terms of intellisense and I do miss ReSharper, but the OmniSharp extension really is very impressive and is not far from catching up.
- Continuous deployment from a VSTS hosted Git repository to Azure websites
- Used MarkDig to render Markdown to HTML
- Used YamlDotNet to parse the frontmatter in my new markdown blog post file format
- Used Html2Markdown to convert all legacy posts into MarkDown. It wasn't perfect, but it got me 90% of the way
- Wrote several LINQPad scripts to batch convert things, fix up links, rename images. It remains one of my favourite dev tools for automating all kinds of tasks.
I've attempted to check as many of the 500+ old posts on this blog as possible to ensure they all still display correctly. I've also tried to test on a variety of browsers. But I expect some things are broken now, so do let me know if you run into any problems.