bamboo: A simple blog engine on Hack

[ library, web ] [ Propose Tags ]

A simple blog engine on Hack


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 2009.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
Change log changelog.md
Dependencies ansi-wl-pprint, base, base64-string, bytestring, cgi, containers, data-default (>=0.2), directory, filepath, gravatar (>=0.3), hack (>=2009.4.30), hack-contrib (>=2009.4.50), haskell98, hcheat (>=2008.11.6), 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]
License LicenseRef-GPL
Author Wang, Jinjing
Maintainer Wang, Jinjing <nfjinjing@gmail.com>
Category Web
Home page http://github.com/nfjinjing/bamboo/tree/master
Uploaded by JinjingWang at 2009-04-27T23:23:48Z
Distributions
Reverse Dependencies 4 direct, 0 indirect [details]
Downloads 21550 total (31 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for bamboo-2009.4.50

[back to package description]

Bamboo: a simple blog engine on Hack

Bamboo is a port of Panda, but runs on top of Hack. It's an experimental project but quite portable.

Features

plain text as data source

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

simple config

blog_title    = C大调
blog_subtitle = 野猫不吃薯片
host_name     = jinjing.easymic.com
author_email  = nfjinjing@gmail.com

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

hacker friendly

  • posts are in plain text
  • SCM for publishing / data managing ( not really a feature, but a design goal from the beginning )
  • blindly follows the KISS principle from code to UI: be a simple blog, no more no less

Demo

blog

My blog source is available as a git repo:

git clone git://github.com/nfjinjing/jinjing-blog.git

Or browser online

Note: This blog is using the Kibro handler. It's running under lighttpd and in fcgi. Definitely more robust, but require some set up work.

config

jinjing's blog config file

Install

Install Bamboo Middleware

update cabal

cabal update

install bamboo

cabal install happy
cabal install rss --reinstall
cabal install hack
cabal install hack-contrib
cabal install bamboo

Choose a hack handler

Hyena

install hyena
cabal install network --reinstall

git clone git://github.com/tibbe/hyena.git
cd hyena
cabal install

cabal install hack-handler-hyena
get a starter kit ( template )
mkdir myblog
cd myblog

# get a template to start
git clone git://github.com/nfjinjing/bamboo-template.git db
create an entry point

put this into Main.hs

module Main where

import Bamboo
import Hack.Handler.Hyena

import Hack.Utils
import Hack.Contrib.Middleware.ContentType
import Hack.Contrib.Middleware.ContentSize
import Hack.Contrib.Middleware.ShowExceptions
import Hack.Contrib.Middleware.Static


import qualified Hack.Contrib.Head as H

default_content_type = "text/plain; charset=UTF-8"

middleware_stack = 
  [  dummy_middleware

  -- completeness
  ,  content_size
  ,  content_type default_content_type

  -- debuging
  ,  show_exceptions Nothing

  -- optimization
  ,  H.head

  -- static serve
  ,  static (Just "db/public") ["/theme", "/images", "/plugin", "/favicon.ico"]

  -- real app
  ,  bamboo
  ]

app = use middleware_stack dummy_app

main = run app
run
ghc --make -O2 Main.hs
./Main

It should be running on http://127.0.0.1:3000 now.

Kibro

Install Kibro
cabal install kibro
cabal install hack-handler-kibro
Install lighttpd 1.4.19 (used by kibro)
wget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.gz
tar zxfv lighttpd-1.4.19.tar.gz
cd lighttpd-1.4.19
./configure --prefix=$HOME
make
make install

make sure ~/sbin is in your $PATH.

You also need spawn-fcgi in your path. I don't remember how I got mine, but it should come with lighttpd somewhere ...

bootstrap
# bamboo is a kibro project
kibro new myblog
cd myblog

# get a template to start
git clone git://github.com/nfjinjing/bamboo-template.git db
sh db/extra/scripts/bootstrap.sh
run
kibro start

It should be running on http://127.0.0.1:3000 now.