Why
This was not the result of a revolutionary plan, rather more of an evolution. It happened like this:
- As soon as Plone 4.3a1 was released (a year ago?) I deployed a new Plone site to aclark.net with it, featuring a Diazo (new Plone theming engine) theme.
- Around the same time I became obsessed with deploying to Heroku, and also gained an interest in Python 3.
- A few months ago, I got tired of paying $11/month to host my Plone site so I converted the site to static HTML and moved it to GitHub pages. But the result was flawed because maintenance involved editing duplicate copies of the website content (e.g. both clients.html and clients/foo.html contained the same text describing "foo").
So when it came time to do more than a few casual edits, I knew I had to find a new approach. That's when various elements of the Universe conspired to lead me in a new direction.
How
Pyramid
I spent a lot of time (~ 1 year) developing pythonpackages.com in Pyramid, but the result was a mess (code-wise). I'm in the process of rewriting and open sourcing it, but it's slow going. So what better way to get started than to do a small-ish site in Pyramid for fun?
about.me
I also recently gave in and created an about.me site. I was impressed by their content editing features, and my ability to create a page that looked OK using them.
In my about.me profile, I used a picture of me and a picture of DC I took in early 2012. When it came time to redo aclark.net I felt like I really wanted to capture the simplicity of the about.me site, so I used the same photo in the background.
Bootstrap
Bootstrap is old news at this point, but I really enjoy using it and I particularly like that they have added more example templates. So I combined my background photo with one of their example templates and a new site idea was born. As I'm not a particularly talented visual artist, my ability to produce something that looked OK (with code this time) was exciting.
What
Until I added a contact form, the site was entirely unremarkable. There are views and routes and templates, typical fare for a web framework. Here is the entire "main routine":
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.config import Configurator
from .redir import blog
from .redir import blog_entry
from .redir import blog_slash
from .views import contact
from .views import default
import deform_bootstrap
def main(global_config, **settings):
"""
Oppan wsgi style! Configure and return WSGI application.
"""
my_session_factory = UnencryptedCookieSessionFactoryConfig('itsaseekreet')
config = Configurator(session_factory=my_session_factory)
config.add_route('blog', '/blog')
config.add_route('blog_entry', '/blog/{entry:.*}')
config.add_route('blog_slash', '/blog/')
config.add_route('contact', '/contact')
config.add_route('clients', '/clients')
config.add_route('projects', '/projects')
config.add_route('services', '/services')
config.add_route('team', '/team')
config.add_route('testimonials', '/testimonials')
config.add_route('root', '/')
config.add_static_view(
'static', 'aclarknet:static', cache_max_age=3600)
config.add_view(blog, route_name='blog')
config.add_view(blog_entry, route_name='blog_entry')
config.add_view(blog_slash, route_name='blog_slash')
config.add_view(
default,
renderer='aclarknet:templates/clients.mak',
route_name='clients')
config.add_view(
contact,
renderer='aclarknet:templates/contact.mak',
route_name='contact')
config.add_view(
default,
renderer='aclarknet:templates/projects.mak',
route_name='projects')
config.add_view(
default,
renderer='aclarknet:templates/root.mak',
route_name='root')
config.add_view(
default,
renderer='aclarknet:templates/services.mak',
route_name='services')
config.add_view(
default,
renderer='aclarknet:templates/testimonials.mak',
route_name='testimonials')
config.add_view(
default,
renderer='aclarknet:templates/team.mak',
route_name='team')
config.include(deform_bootstrap)
return config.make_wsgi_app()