bamboo 2009.4.22 → 2009.4.23
raw patch · 10 files changed
+44/−39 lines, 10 filesdep ~hackPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hack
API changes (from Hackage documentation)
Files
- bamboo.cabal +3/−3
- changelog.md +9/−1
- readme.md +20/−26
- src/Bamboo.hs +6/−1
- src/Bamboo/Controller/Application.hs +0/−2
- src/Bamboo/Helper/StateHelper.hs +1/−1
- src/Bamboo/Model/Comment.hs +1/−1
- src/Bamboo/Model/Post.hs +2/−2
- src/Bamboo/View/Atom/Comment.hs +1/−1
- src/Bamboo/View/Atom/Post.hs +1/−1
bamboo.cabal view
@@ -1,5 +1,5 @@ Name: bamboo-Version: 2009.4.22+Version: 2009.4.23 Build-type: Simple Synopsis: A simple blog engine on Hack Description: A simple blog engine on Hack@@ -10,12 +10,12 @@ Build-Depends: base Cabal-version: >= 1.2 category: Web-homepage: http://www.haskell.org/haskellwiki/Bamboo+homepage: http://github.com/nfjinjing/bamboo/tree/master data-files: readme.md, changelog.md library ghc-options: -Wall -fno-warn-missing-signatures -fno-warn-name-shadowing -fno-warn-orphans -fno-warn-type-defaults- build-depends: base, cgi, network, haskell98, old-locale, old-time, directory, filepath, containers, process, mps >= 2008.11.6, parsedate >= 3000.0.0, rss >= 3000.0.1, xhtml, kibro >= 0.4.2, utf8-string >= 0.3.3, pandoc, parsec >= 2, MissingH, gravatar >= 0.3, data-default >= 0.2, hcheat >= 2008.11.6, hack >= 2009.4.22+ build-depends: base, cgi, network, haskell98, old-locale, old-time, directory, filepath, containers, process, mps >= 2008.11.6, parsedate >= 3000.0.0, rss >= 3000.0.1, xhtml, kibro >= 0.4.2, utf8-string >= 0.3.3, pandoc, parsec >= 2, MissingH, gravatar >= 0.3, data-default >= 0.2, hcheat >= 2008.11.6, hack >= 2009.4.23 hs-source-dirs: src/ exposed-modules: Bamboo
changelog.md view
@@ -1,4 +1,12 @@-2009.4.21+2009.4.23+---------++### Feature++* A pretty logger to stderr+* Auto set content-size++2009.4.22 ----------- ### Feature
readme.md view
@@ -1,9 +1,11 @@-## Bamboo: a blog engine on Hack+# Bamboo: a simple blog engine on Hack -### Features+Bamboo is a port of [Panda](http://github.com/nfjinjing/panda/tree), 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](http://github.com/nfjinjing/hack/tree). -#### simple file structure+## Features +### simple file structure+ db |---- blog | |---- 08-09-01 first post@@ -16,7 +18,7 @@ |---- static |---- About -#### simple config file+### simple config file blog_title = C大调 blog_subtitle = 野猫不吃薯片@@ -28,11 +30,11 @@ sidebar = Blogroll.md favicon = bamboo_icon.png -#### standard web technology+### standard web technology extend/customize with pure css and javascript ( note the custom part in css and js from the last section ) -#### hacker friendly+### hacker friendly * posts are in plain text * SCM for publishing / data managing ( not really a feature, but a design goal from the beginning )@@ -56,24 +58,19 @@ ### Quick setup -#### install [lighttpd](http://www.lighttpd.net/ )--Note: only version 1.4.19 has been successfully tested, 1.4.20 is bugged for reasons unknown.--#### install [ghc](http://www.haskell.org/ghc/download.html)--#### install [darcs](http://www.darcs.net/) for `cabal-install`--#### install [cabal-install](http://hackage.haskell.org/trac/hackage/wiki/CabalInstall)-- darcs get --partial http://darcs.haskell.org/cabal-install/- cd cabal-install- sh bootstrap.sh- #### install bamboo cabal update; cabal install bamboo +### 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+ #### bootstrap # bamboo is a kibro project@@ -165,7 +162,6 @@ 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@@ -192,16 +188,14 @@ ### analytics -Google analytics is available, put your `tracker_id` in `site.txt`, if you don't want analytics, ignore the setting.--Once site module is introduced, those `js` code could be configured to be gone forever, but not yet in the current release.+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. -### Links+## Links +* [Hack](http://github.com/nfjinjing/hack/tree) * [Kibro](http://chrisdone.com/blog/tag/Kibro)-* [Bamboo on Jinjing's blog](http://jinjing.easymic.com/tag/Bamboo) * [Source](http://github.com/nfjinjing/bamboo/tree)
src/Bamboo.hs view
@@ -14,12 +14,17 @@ import Hack import Hack.Contrib.RawRouter import Hack.Contrib.ContentType+import Hack.Contrib.ContentSize+import Hack.Contrib.SimpleAccessLogger+ import Bamboo.Helper.Env hiding (body, not_found, (>)) default_content_type = "text/plain; charset=UTF-8" middleware_stack = - [ content_type default_content_type+ [ simple_access_logger Nothing Nothing "Bamboo"+ , content_size+ , content_type default_content_type , route paths ]
src/Bamboo/Controller/Application.hs view
@@ -37,8 +37,6 @@ -- helpers--- liftIO: move to an (u)pper level monad-u = liftIO blog_regex = G.url_date_matcher init_post tags x = x.Tag.fill_tag tags.Comment.fill_comment_size tag_list = list
src/Bamboo/Helper/StateHelper.hs view
@@ -27,7 +27,7 @@ where maybe_d = parseCalendarTime defaultTimeLocale format s -format_date = formatCalendarTime defaultTimeLocale+format_time = formatCalendarTime defaultTimeLocale default_date = parse_date "%Y-%m-%d %T" "2000-1-1 00:00:00".fromJust parse_post_date = parse_date G.post_date_format default_parse_date s = s.parse_post_date .fromMaybe default_date
src/Bamboo/Model/Comment.hs view
@@ -80,7 +80,7 @@ let body = at Body let post_id = at PostId - timestamp <- ( getClockTime >>= toCalendarTime ) ^ format_date G.comment_date_format+ timestamp <- ( getClockTime >>= toCalendarTime ) ^ format_time G.comment_date_format let comment_path = post_id_to_uid post_id mkdir_p comment_path
src/Bamboo/Model/Post.hs view
@@ -85,14 +85,14 @@ -- extra id_to_uri id = G.root / ( pretty_date ++ G.url_date_title_seperator ++ formatted_title ++ ext ) where formatted_title = G.url_title_subs.map (\(a,b) -> gsub a b).inject (id.get_title) apply- pretty_date = id.get_date.format_date G.url_date_format+ pretty_date = id.get_date.format_time G.url_date_format ext = id.take_known_extension uri_to_id s = G.post_id / (d ++ " " ++ t) where (raw_d, (_, title_with_sep)) = s.MPS.match G.url_date_matcher.fromJust.fst raw_t = title_with_sep.drop (G.url_date_title_seperator.length) t = G.url_title_subs.map (\(a,b) -> gsub b a) .inject raw_t apply- d = raw_d.parse_date G.url_date_format .fromJust.format_date G.post_date_format+ d = raw_d.parse_date G.url_date_format .fromJust.format_time G.post_date_format -- summary
src/Bamboo/View/Atom/Comment.hs view
@@ -27,7 +27,7 @@ formatted_link = if l.starts_with "http://" then l else "http://" ++ l gravatar = thediv ! [theclass "gravatar"] << image ! [src (gravatar_link x)] -comment_date x = toHtml $ x.date.format_date "%b %e, %Y at %I:%M %p"+comment_date x = toHtml $ x.date.format_time "%b %e, %Y at %I:%M %p" -- form
src/Bamboo/View/Atom/Post.hs view
@@ -29,7 +29,7 @@ render_summary x = if x.is True then entry Summary else render_data title_link x = h2 << hotlink (x.uri) << x.title-post_date x = toHtml $ x.date.format_date "%b %e, %Y"+post_date x = toHtml $ x.date.format_time "%b %e, %Y" post_tags x | x.tags.null = empty_html post_tags x = " | " +++ "Published in " +++ x.tags.map Tag.tag_link .intersperse (", ".toHtml)