packages feed

clckwrks-theme-bootstrap (empty) → 0.2.2

raw patch · 5 files changed

+129/−0 lines, 5 filesdep +basedep +clckwrksdep +hspsetup-changed

Dependencies added: base, clckwrks, hsp, text

Files

+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2012, Jeremy Shaw++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of Jeremy Shaw nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ Theme.hs view
@@ -0,0 +1,69 @@+{-# LANGUAGE FlexibleContexts, OverloadedStrings, RecordWildCards #-}+{-# OPTIONS_GHC -F -pgmFtrhsx #-}+module Theme where++import Clckwrks+import Clckwrks.Monad+import Data.Text (Text)+import HSP+import Paths_clckwrks_theme_bootstrap (getDataDir)++theme :: Theme+theme = Theme+    { themeName      = "bootstrap-theme"+    , _themeTemplate = pageTemplate+    , themeBlog      = blog+    , themeDataDir   = getDataDir+    }++pageTemplate :: ( EmbedAsChild (ClckT ClckURL (ServerPartT IO)) headers+                , EmbedAsChild (ClckT ClckURL (ServerPartT IO)) body+                ) =>+                Text+             -> headers+             -> body+             -> XMLGenT (ClckT ClckURL (ServerPartT IO)) XML+pageTemplate ttl hdr bdy =+    <html>+     <head>+      <title><% ttl %></title>+      <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css"        rel="stylesheet" media="screen" />+      <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-responsive.css" rel="stylesheet" />+      <link rel="stylesheet" type="text/css" href=(ThemeData "style.css") />+      <meta name="viewport" content="width=device-width, initial-scale=1.0" />+      <% hdr %>+      <% googleAnalytics %>+     </head>+     <body>+      <h1><% ttl %></h1>+      <% bdy %>+      <script src="http://code.jquery.com/jquery-latest.js"></script>+     </body>+    </html>++postsHTML :: XMLGenT (Clck ClckURL) XML+postsHTML =+    do posts <- getPosts+       <ol class="blog-posts">+        <% mapM postHTML posts %>+        </ol>++postHTML :: Page -> XMLGenT (Clck ClckURL) XML+postHTML Page{..} =+    <li class="blog-post">+     <h2><% pageTitle %></h2>+     <span class="pub-date"><% pageDate %></span>+     <% pageSrc %>+     <p><a href=(ViewPage pageId)>permalink</a></p>+    </li>++blog :: XMLGenT (Clck ClckURL) XML+blog =+    do ttl <- lift getBlogTitle+       pageTemplate ttl () $+           <%>+            <div id="blog-content">+             <h1 class="page-title"><% ttl %></h1>+             <% postsHTML %>+            </div>+           </%>
+ clckwrks-theme-bootstrap.cabal view
@@ -0,0 +1,27 @@+name:                clckwrks-theme-bootstrap+version:             0.2.2+synopsis:            simple bootstrap based template for clckwrks+homepage:            http://www.clckwrks.com/+license:             BSD3+license-file:        LICENSE+author:              Jeremy Shaw+maintainer:          jeremy@n-heptane.com+category:            Clckwrks+build-type:          Simple+cabal-version:       >=1.8++data-files:+  data/style.css++source-repository head+    type:     darcs+    subdir:   clckwrks-theme-bootstrap+    location: http://hub.darcs.net/stepcut/clckwrks++library+  exposed-modules:     Theme+                       Paths_clckwrks_theme_bootstrap+  build-depends:       base             >  4 && <5,+                       clckwrks         == 0.13.*,+                       hsp              == 0.7.*,+                       text             == 0.11.*
+ data/style.css view
@@ -0,0 +1,1 @@+/* customize the theme here */