website
HTML-to-HTML transformer
website
generates web sites from a bunch of HTML
files. Great! Let’s look at it.
$ ls _articles/ _config.py _templates/ assets/ $ ls _articles _articles/my_post.html $ cat _articles/my_post.html Title: My First Post Date: 2011-07-01 Subject: blog, Python, simple, usable <p>This is my first post.</p> <ul><li>Look! A list!</li></ul>
In steps website
to produce from this a fully
functional web site. Run it on this folder and see the magic
happen.
$ python -m website.__main__ $ ls _articles/ _config.py _templates/ assets/ site/ $ ls site site/assets/ site/my_post.html $ cat site/my_post.html <!DOCTYPE html> <html lang="en"> <head> <title>My First Post</title> […] <p>This is my first post.</p> <ul><li>Look! A list!</li></ul> […]
The new folder site contains the finished data, complete with index files, news feeds and assets. It’s ready to get uploaded or viewed directly.
Getting Started
To get started with website
, see this
detailed instruction. It guides you through downloading, installing,
setting up your config file and finally writing your first article.
Give it a try, it's simpler than it seems.
Recipes (How do I…)
See website
recipes for snippets on
how to achieve specific results with website
.
How come?
Have you ever struggled with WYSIWYG editors or substitute markup, that just doesn’t do what you want? Did you ever wish you could just use plain old HTML (sometimes referred to as POSH), when you look up, how a table is marked up in MediaWiki syntax?
This was my line of thought, when I wanted to start a blog. I know HTML, so why use another markup language? I want all the freedom of direct source code editing without the hassle of managing manually a dozen headers and footers. I don’t need a full-blown database just to display a tagcloud of my articles. And I want a simple way to embed metadata and to publish in several languages.
Therefore I wrote this Python framework, that takes a bunch of HTML stubs and converts them to a fully functional website.
Take a look at the above example file. The format is oriented towards HTTP. First there are header lines, that describe metadata. Then a blank line. And then full-power awesome HTML markup with all the shiny HTML5 features ready to be used inline. What could be simpler than that?
Features
website
is coded with flexibility and standards
in mind. It is aimed to be a great platform for webtech savvy
people.
- provides an ATOM news feed
- generates a sitemap.xml
- supports full i18n via Gettext: Posts and the UI can be translated independently
- auto-generates paginated index pages for the folder structure under _article
- auto-generates archive pages for years and months
- generates an SQLite search index, so that your static pages are fully searchable (PHP based site search included)
- provides a tag cloud feature
- allows embedding of the Python code: All you need in a single folder, version-controlled with Git
- provides far-reaching Dublin Core metadata support
- uses syntax highlighting via Pygments
- integrates Disqus for commenting functionality
- allows URL shortcuts:
href="w:HTML"
becomeshref="http://en.wikipedia.org/wiki/HTML"
- Gives full mako template power to you thanks to template inheritance and overwriting
- simplifies performance tweaks: HTML is short on unnecessary white-space, assets can live in a separate folder or even under a separate domain
- features a debug mode
- supports standards and well-known workflows, e.g., GNU make, Gettext, HTML5, microformats, …
- uses PHP to generate the pages, that need server-side components, like contact forms and search results
- works hand in hand with Apache’s mod_negotiation, but can be used with any web server (after all it’s only HTML)
But I want…
website
’s way of handling things may or may not
suit your needs. That’s okay, and there are several options from
here:
- If you spotted an error in
website
, please file a bug report at Github’s issue tracker - You miss a cool feature? Fork the project, implement it and I’m most happy to include your pull request
website
handles things fundamentally different from what you’d expect: I’d appreciate the feedback, however you might be better off with another website compiler. There is, for example, Jeckyll and toto in the Ruby world and Blogofile or weblog for Python
Who stands behind this?
Hi! My name is Manuel Strehl, also known as Boldewyn. I created
website
, because I wasn’t content with the choice
of blogging (and website creation in general) software out there
targeted at web developers.
This code powers manuel-strehl.de,
my personal web site. Go take a look at it to see
website
in action.
If you like what you see, take a minute and look at some other projects of mine:
- ebooks: A project to convert free books into HTML5 format
- motokai: A ChatZilla motif based on the Monokai theme for TextMate
- rm-ns: remove namespaced elements and attributes from your XML files
- view-source: A XML syntax highlighter written in XSLT
- Digraphs: A Firefox addon, that brings Vim’s digraph support to Firefox
- unicodeinfo: A set of tools to get information on Unicode codepoints