A customizable HTML5 flavour for Pyblosxom.
-
Minimal, valid HTML5.
-
Semantic HTML5 elements including
<header>and<hgroup>,<nav>,<article>,<footer>and<time>. -
rel="alternate"links to the Atom and RSS feeds. -
A
rel="author"link in the site<footer>. This uses yourpy["blog_author"]config.pysetting and apy["author_link"]config.pysetting for thehref. For example:py["blog_author"] = "Sean Hammond" py["author_link"] = "http://seanh.cc/"
-
A
rel="license"link in the site<footer>. Uses yourpy["blog_rights"]config.pysetting. -
Favicon support, add a line to your
config.pyfile like:py["favicon"] = "http://static.example.com/favicon.ico"
-
Customization support, in your
config.pyfile you can specify custom elements and attributes to be inserted into the templates. See below.
git clone or download this repo into an html5.flav directory in your
flavours directory, then set:
py["default_flavour"] = "html5"in your config.py file.
There are lots of optional config file settings that can be used to insert HTML elements and attributes into the templates, for example to insert links to CSS files or to add CSS classes.
For now, to find all the settings search the template files for $(.
For example, here are some config.py settings that include some CSS and
JavaScript files from Bootstrap and add a few CSS
classes, to create a simple Bootstrap theme:
py["head_elements"] = """
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="http://static.seanh.cc/circa.seanh.cc.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
"""
py["body_attrs"] = 'class="page"'
py["header_attrs"] = 'class="main-header"'
py["header_nav_ul_attrs"] = 'class="list-unstyled list-inline"'
py["article_attrs"] = 'class="post"'
py["article_footer_attrs"] = 'class="text-muted post-footer"'
py["article_footer_ul_attrs"] = 'class="list-unstyled list-inline"'
py["footer_attrs"] = 'class="text-muted"'
py["footer_ul_attrs"] = 'class="list-unstyled list-inline"'With these settings http://static.seanh.cc/circa.seanh.cc.css would be a link
to a CSS file containing custom CSS rules to be applied on top of Bootstrap's,
for example:
.page {
margin-top:2em;
margin-left:2em;
}
.main-header {
margin-bottom:3em;
}
.post {
margin-bottom:3em;
}
.post-footer {
margin-top:2em;
}