Blog on Piranha CMS
Blog on Piranha CMS
Posted:
Posted:
I recently decided to start putting together a technical blog, primarily to repay all my fellow Episerver bloggers whose posts I've come back to over and over again throughout the years.
What I've come to find is that it was a great way to:
I can't remember exactly how I found out about Piranha, I believe it was through Scott Hanselman's blog post on CMS platforms in .NET core. I ran down the list of options and Piranha instantly checked all the boxes I was looking for:
Are there UI enhancements I'd love to see? Sure. Is everything perfect? Of course not, but it's the right platform, right development team, a functional and clean UI, and setup was actually laughably easy with a few command line commands.
I started with Piranha's blog template, which provides a great pattern for blog listings and blog posts and a simple front-end website style. I made a handful of modifications that I found really solidfy my love for Piranha:
Now, that looks like a long list, but I completed this blog project and was ready to enter content within a couple days of starting it. Piranha has amazing flexibility for modifying how things work and how to get data from it.
It's a personal blog project, so I am likely not going to have a "test" versus "production" environment setup for any reason. Piranha supports a number of database types and providers, so I simply swapped to the SQL Server package and connected it to an Azure-hosted sql database that I shared between my live site and my local environment, for quick editing and testing.
I want modifications and management of the blog to be as easy as possible, or else it'll become stale and I won't update it. For this reason, I setup a full Azure DevOps build and release pipeline that builds the application and deploys it to the live production site anytime I push to a "release" branch in my source control.
I have a love-hate relationship with Bootstrap. It's widely recognized and used across projects but I always find myself in "Bootstrap hell" fighting for two hours to make what I believe is a responsive template with Bootstrap's grid row/columns and elements until two hours later I "git reset --hard" and start over.
At the same time, I have heard great things about Flexbox and decided to take a leap and try Bulma. With a few snippets and markup changes, I was already done. The blog looked 10x better than it did trying to modify from the provided Bootstrap template. On top of that, it was so reusable that I gave my colleague access to fork the code and he was able to launch his own site with a simple change of SCSS variables.
<Will finalize this section of the post this week>
I mainly blog about development topics, so code snippets are inevitable. My main source of reading others' blogs and news is in small chunks that I get from a few followed tags on Twitter, so mobile access and support was also a priority for me.
The responsive image block, with alt text support:
The code snippet block, with highlight.js integration for theme and language support:
Out of the box, the Piranha blog template is meant to be a very simple 1-project solution. Your page models, block models, regions and more that are used for your editing interface and stored alongside your viewmodels and views. That's great for beginner 0-100 setup and being able to see everything in use, but I would love to have these out of the presentation layer. I made a couple of changes....
A ".Core" project for my backend models:
Separation of controllers and views:
(Out of the box, the blog template has all CMS content routed through a single "CmsController" and actions for each type. If you add a few page types, the file becomes gigantic)
I love Piranha CMS. Massive credit to the Piranha team, I hope you continue to enhance the already amazing product. I firmly believe it's a major contender for best .NET Core CMS solution. The blog was a massive success.