The bamboo package

[Tags: gpl, library]

A simple blog engine on Hack

[Skip to ReadMe]


Versions2009.4.22, 2009.4.23, 2009.4.25, 2009.4.26, 2009.4.27, 2009.4.30, 2009.4.50, 2009.4.52, 2009.5.13, 2009.5.18, 2009.5.18.1, 2009.5.18.2, 2009.5.19, 2009.5.22, 2009.5.23, 2009.5.27, 2009.6.6, 2009.6.8, 2009.6.9, 2009.6.25, 2009.8.16, 2009.11.1, 2010.1.1, 2010.1.26, 2010.2.25
Dependenciesansi-wl-pprint, base, base64-string, bytestring, cgi, containers, data-default (>=0.2), directory, filepath, gravatar (>=0.3), hack (>=2009.4.25), haskell98, hcheat (>=2008.11.6), hyena, kibro (>=0.4.2), MissingH, mps (>=2008.11.6), network, old-locale, old-time, pandoc, parsec (>=2), parsedate (>=3000.0.0), process, rss (>=3000.0.1), template, time, unix, utf8-string (>=0.3.3), xhtml, zlib [details]
AuthorWang, Jinjing
MaintainerWang, Jinjing <>
Home page
UploadedFri Apr 24 19:49:16 UTC 2009 by JinjingWang
Downloads4146 total (86 in last 30 days)
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-11-15 [all 4 reports]



Maintainers' corner

For package maintainers and hackage trustees

Readme for bamboo-2009.4.25

Bamboo: a simple blog engine on Hack

Bamboo is a port of Panda, but runs on top of Hack. All features except comment works out of box. I intend to reduce the code size and make the app more robust by using the benefit of middlewares available in Hack.


simple file structure

|---- blog
|     |---- 08-09-01 first post
|     |---- 09-09-02 learn javascript.html
|---- tag
|     |---- programming
|     |---- funny
|---- static
      |---- About

simple config file

blog_title    = C大调
blog_subtitle = 野猫不吃薯片
host_name     =
author_email  =

navigation    = About
per_page      = 7
sidebar       =
favicon       = bamboo_icon.png

standard web technology

extend/customize with pure css and javascript ( note the custom part in css and js from the last section )

hacker friendly



My blog source is available as a git repo:

git clone git://

Or browser online


jinjing's blog config file


Quick setup

install bamboo

cabal update; cabal install bamboo

Install lighttpd 1.4.19 (used by kibro)

tar zxfv lighttpd-1.4.19.tar.gz
cd lighttpd-1.4.19
./configure --prefix=$HOME
make install


# bamboo is a kibro project
kibro new myblog
cd myblog

# get a template to start
git clone git:// db
sh db/extra/scripts/


kibro start

It should be running on now.

Since Bamboo is based on Kibro, it helps to read how Kibro works.


Install Ruby / Rake, then rake -T to see a list of helper commands.


Edit db/config/site.txt

blog_title   = My shiny blog
host_name    =
author_email =

Restart required. (hint: rake r)

User's guide


All posts are placed in db/blog folder, with naming convention [yy-mm-dd title], in Markdown format by default.

Markdown supports embedding HTML snippets, so embedding youtube video is a peace of cake.

<object width="425" height="344"><param name="movie" value=""></param><param name="allowFullScreen" value="true"></param><embed src="" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>

You can create static pages, in db/static, and link to them via /static/static_file_name inside your blogs.

For example db/static/About, where you can put some profile in.


Create a file in db/tag, the name of the file will be the name of the new tag. edit the tag file, insert the full name of a blog post, e.g. 08-09-04 Welcome to Bamboo

html / tex / restructured text format

Just create the file in blog as usual with an extension (e.g. html, rst, tex ), and you are all set.

customize navigation bar

see example in config/site:

navigation = About, Gallery

Multiple renderer supported, use extension as hints.

Note, the navigation configuration requires the full name of your static page, so you should include extension in configuration as well.

customize sidebar

see example in config/site, config/sidebar/

sidebar    =

Sidebar items are html snippets plugged into view. You can create these plugins in multiple formats, use extension.


Styling is done by editing public/theme/blueprint/css/custom.css, see the default custom.css for inspiration.


New theme can be created without touching Bamboo code, example blueprint theme in db/config/theme/blueprint.txt

container  = container
header     = column span-12 first
navigation = column span-12 first large
main       = column span-9 first
sidebar    = column span-3 last
footer     = footer

css        = screen, blueprint-wp, custom
js         = jquery-1.2.6.min, jquery.getUrlParam, jquery.highlight-2, custom

These are custom class names for each element block.

You can create new themes by adding theme definition files in db/config/theme, put theme resources under db/public/theme/your_theme_name and place

theme = your_new_theme

inside site.txt.

note: css and js are required to be placed under db/public/theme/your_theme_name/css and db/public/theme/your_theme_name/js, leave out the file extensions in site.txt.

syntax highlighting

  type="text/html" \
  data=" \
  ?user_id=56167317@N00&tags=cat-hack" \
  width="500" height="500">

Highlight for HTML is enabled by default, see public/theme/blueprint/js/custom.js for more language support.

Highlight style is configured at config/theme/blueprint.txt, just change highlight/default to any css inside theme/blueprint/css/highlight.


Google analytics is available, put your tracker_id in site.txt, make sure analytics extension is used by adding analytics to the extension option.

final note

try to use <h3> for heading in your posts, at least wordpress is using this convention. <h1> is not styled in the blueprint theme, so they look kind of unfitted. But this does not stop anyone from styling <h1>, <h2> if wished.