{-# LANGUAGE NoMonomorphismRestriction#-}
{-# LANGUAGE NoImplicitPrelude #-}
module Bamboo.Theme.Blueprint (blueprint) where

import Bamboo.Theme.Blueprint.Env hiding (header, body, Search)
import Bamboo.Type.ThemeInterface
import qualified Bamboo.Theme.Blueprint.Control.Post as PostV
import qualified Bamboo.Theme.Blueprint.Control.Search as SearchV
import qualified Bamboo.Theme.Blueprint.Control.Static as StaticV
import qualified Bamboo.Theme.Blueprint.Control.Tag as TagV
import qualified Bamboo.Theme.Blueprint.Widget.RSS as RSSV
import qualified Bamboo.Type.State as S

blueprint :: Theme
blueprint Index x     = PostV.list x .output_html
blueprint IndexFeed x = RSSV.rss x "" "" .render_rss .to_sb .output_plain_rss
blueprint Post x      = x. PostV.view .output_html
blueprint Search x    = SearchV.view x .output_html
blueprint Static x    = StaticV.view x .output_html
blueprint Tag x       = TagV.view x .output_html
blueprint TagFeed x   = RSSV.rss x (x.config.tag_id) (x.S.tag_name)
    .render_rss
    .to_sb
    .output_plain_rss