Using and customizing Apache Roller
Feb 20, 2015
One of the reasons I wanted to host a blog on my own server is that I wanted to run it on Java. Searching around for blog applications written in Java, I narrowed down on Pebble and Apache Roller. Pebble doesn’t seem to have been updated in years. While development on Apache Roller seems to have slowed down, at least it is being actively maintained. So I chose it over Pebble.
(A note — running a blog on Java and wanting that blog to have as many features as that other blog you just saw on the Internet requires a fair amount of Java knowledge and effort. So if you are just looking to run a blog with minimal effort, you might want to stick to PHP applications like Wordpress. They have a ton of customization features which don’t require much programming knowledge. They also have a lot of themes to chose from).
Installing and running Apache Roller is a simple enough affair if you follow the documentation. The only issue I ran into was this, during server startup:
java.lang.NoClassDefFoundError: javax/mail/Session at org.apache.roller.weblogger.business.MailProvider.<init>(MailProvider.java:92) at org.apache.roller.weblogger.business.startup.WebloggerStartup.prepare(WebloggerStartup.java:177) at org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:140)
I downloaded the JavaMail jar from here and dropped into my Tomcat’s
lib directory. That took care of the issue.
I didn’t like the default themes that came with Apache Roller. It doesn’t mean that they aren’t good. It’s just that I prefer a certain look and the default themes didn’t fit that bill. So I wrote my own theme.
For writing themes, Apache Roller uses the Velocity template engine which is quite easy to learn. And of course, I had the existing themes to refer to while creating my theme.
I used Foundation CSS framework in my theme. It takes care of a lot of things for you — it does a CSS reset, gives you a decent typography to start with, provides a grid system to do your layouts and handles resizing for small screens. It also has a few bells and whistles like the off canvas push menu that this blog is currently using.
Web fonts are all the rage now, for good reason — for years we’ve been limited to a few system fonts and now we have more, better font choices. But still, professional looking web fonts cost a lot for a hobbyist blog, so I settled on using a few fonts from Google Fonts, which are free to use. (If you are interested in learning about web typography, this is a great resource. It doesn’t require any knowledge beyond knowing a little HTML and CSS).
Font Awesome is another toolkit I used for my theme. Instead of using images for icons, it creates icons using web fonts and CSS.
For code highlighting I used highlight.js
I also created a custom archives page. I wanted to show archives by date, category and tags. The default archives model in Apache Roller only gives you the option to display archives as a calendar.
All the above mentioned customizations are available on my Bitbucket