From 7ff2d79c53f710c8f726488c00f4a61cfa7e28b2 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 29 May 2011 08:27:52 +0200 Subject: Add pageCompilerWithPandoc --- src/Hakyll/Web/Page.hs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Hakyll/Web/Page.hs b/src/Hakyll/Web/Page.hs index a9c622c..1450702 100644 --- a/src/Hakyll/Web/Page.hs +++ b/src/Hakyll/Web/Page.hs @@ -54,6 +54,7 @@ module Hakyll.Web.Page , readPageCompiler , pageCompiler , pageCompilerWith + , pageCompilerWithPandoc , addDefaultFields , sortByBaseName ) where @@ -66,7 +67,7 @@ import qualified Data.Map as M import Data.List (sortBy) import Data.Ord (comparing) -import Text.Pandoc (ParserState, WriterOptions) +import Text.Pandoc (Pandoc, ParserState, WriterOptions) import Hakyll.Core.Identifier import Hakyll.Core.Compiler @@ -91,16 +92,26 @@ readPageCompiler = getResourceString >>^ readPage -- | Read a page, add default fields, substitute fields and render using pandoc -- pageCompiler :: Compiler Resource (Page String) -pageCompiler = cached "Hakyll.Web.Page.pageCompiler" $ - readPageCompiler >>> addDefaultFields >>> arr applySelf >>> pageRenderPandoc +pageCompiler = + pageCompilerWith defaultHakyllParserState defaultHakyllWriterOptions -- | A version of 'pageCompiler' which allows you to specify your own pandoc -- options -- -pageCompilerWith :: ParserState -> WriterOptions -> Compiler Resource (Page String) -pageCompilerWith state options = cached "pageCompilerWith" $ +pageCompilerWith :: ParserState -> WriterOptions + -> Compiler Resource (Page String) +pageCompilerWith state options = pageCompilerWithPandoc state options id + +-- | An extension of 'pageCompilerWith' which allows you to specify a custom +-- pandoc transformer for the content +-- +pageCompilerWithPandoc :: ParserState -> WriterOptions + -> (Pandoc -> Pandoc) + -> Compiler Resource (Page String) +pageCompilerWithPandoc state options f = cached "pageCompilerWithPandoc" $ readPageCompiler >>> addDefaultFields >>> arr applySelf - >>> pageRenderPandocWith state options + >>> pageReadPandocWith state + >>> arr (fmap (writePandocWith options . f)) -- | Add a number of default metadata fields to a page. These fields include: -- -- cgit v1.2.3 From 6d23197ee2b86f554b95da541c30bce813ea2c69 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 29 May 2011 08:28:17 +0200 Subject: Version bump (3.1.2.7) --- hakyll.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hakyll.cabal b/hakyll.cabal index b8ff57c..3abfc12 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -1,5 +1,5 @@ Name: hakyll -Version: 3.1.2.6 +Version: 3.1.2.7 Synopsis: A simple static site generator library. Description: A simple static site generator library, mainly aimed at -- cgit v1.2.3 From 24ace73c42f0b6d3c764b56b7cc4b0f009d5fe2b Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 29 May 2011 08:30:36 +0200 Subject: Cabal sdist fix --- hakyll.cabal | 2 -- 1 file changed, 2 deletions(-) diff --git a/hakyll.cabal b/hakyll.cabal index 3abfc12..e30c50c 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -17,8 +17,6 @@ Data-Files: templates/atom.xml templates/atom-item.xml templates/rss.xml templates/rss-item.xml -extra-source-files: src-inotify/Hakyll/Web/Preview/Poll.hs - src-interval/Hakyll/Web/Preview/Poll.hs build-type: Simple -- cgit v1.2.3 From cea0dd0cd09ee80940d485103835227acab7483a Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 29 May 2011 10:45:46 +0200 Subject: Update cabal file with links etc. --- hakyll.cabal | 233 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 132 insertions(+), 101 deletions(-) diff --git a/hakyll.cabal b/hakyll.cabal index e30c50c..f7be8b2 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -1,101 +1,132 @@ -Name: hakyll -Version: 3.1.2.7 - -Synopsis: A simple static site generator library. -Description: A simple static site generator library, mainly aimed at - creating blogs and brochure sites. -Author: Jasper Van der Jeugt -Maintainer: jaspervdj@gmail.com -Homepage: http://jaspervdj.be/hakyll -Bug-Reports: http://github.com/jaspervdj/Hakyll/issues -License: BSD3 -License-File: LICENSE -Category: Text -Cabal-Version: >= 1.6 -Data-Dir: data -Data-Files: templates/atom.xml - templates/atom-item.xml - templates/rss.xml - templates/rss-item.xml - -build-type: Simple - -source-repository head - type: git - location: git://github.com/jaspervdj/hakyll.git - -library - ghc-options: -Wall - hs-source-dirs: src - - build-depends: base >= 4 && < 5, - filepath == 1.*, - directory == 1.*, - containers == 0.*, - pandoc == 1.*, - regex-base >= 0.93, - regex-pcre >= 0.93, - mtl >= 1, - old-locale == 1.*, - old-time == 1.*, - time >= 1.1, - binary >= 0.5, - hamlet >= 0.7, - blaze-html >= 0.4, - snap-server >= 0.4, - snap-core >= 0.4, - bytestring >= 0.9, - utf8-string >= 0.3, - HTTP >= 4000, - tagsoup >= 0.12, - hopenssl >= 1.4, - unix >= 2.4, - strict-concurrency >= 0.2 - exposed-modules: Hakyll - Hakyll.Main - Hakyll.Web.Blaze - Hakyll.Web.Util.Url - Hakyll.Web.Preview.Server - Hakyll.Web.Preview.Poll - Hakyll.Web.CompressCss - Hakyll.Web.Template - Hakyll.Web.Feed - Hakyll.Web.Tags - Hakyll.Web.Pandoc - Hakyll.Web.Pandoc.FileType - Hakyll.Web.Page - Hakyll.Web.Template.Read - Hakyll.Web.RelativizeUrls - Hakyll.Web.Page.Read - Hakyll.Web.Page.Metadata - Hakyll.Core.Configuration - Hakyll.Core.DependencyAnalyzer - Hakyll.Core.Identifier.Pattern - Hakyll.Core.UnixFilter - Hakyll.Core.Util.Arrow - Hakyll.Core.Util.File - Hakyll.Core.Util.String - Hakyll.Core.Resource - Hakyll.Core.Resource.Provider - Hakyll.Core.Resource.Provider.File - Hakyll.Core.CompiledItem - Hakyll.Core.Compiler - Hakyll.Core.Run - Hakyll.Core.Store - Hakyll.Core.Writable - Hakyll.Core.Writable.CopyFile - Hakyll.Core.Writable.WritableTuple - Hakyll.Core.Identifier - Hakyll.Core.DirectedGraph.Dot - Hakyll.Core.DirectedGraph - Hakyll.Core.Rules - Hakyll.Core.Routes - Hakyll.Core.Logger - other-modules: Paths_hakyll - Hakyll.Web.Template.Read.Hakyll - Hakyll.Web.Template.Read.Hamlet - Hakyll.Web.Template.Internal - Hakyll.Web.Page.Internal - Hakyll.Core.Compiler.Internal - Hakyll.Core.DirectedGraph.Internal - Hakyll.Core.Rules.Internal +Name: hakyll +Version: 3.1.2.7 + +Synopsis: A static website compiler library +Description: + Hakyll is a static website compiler library. It provides you with the tools to + create a simple or advanced static website using a Haskell DSL and formats + such as markdown or RST. You can find more information, including a tutorial, + on the website: + + . + + * + + . + + If you seek assistance, there's: + + . + + * A google group: + + . + + * An IRC channel, @#hakyll@ on freenode + + . + + Additionally, there's the Haddock documentation in the different modules, + meant as a reference. + +Author: Jasper Van der Jeugt +Maintainer: jaspervdj@gmail.com +Homepage: http://jaspervdj.be/hakyll +Bug-Reports: http://github.com/jaspervdj/Hakyll/issues +License: BSD3 +License-File: LICENSE +Category: Text + +Cabal-Version: >= 1.6 +Build-Type: Simple +Data-Dir: data +Data-Files: + templates/atom.xml + templates/atom-item.xml + templates/rss.xml + templates/rss-item.xml + +Source-Repository head + Type: git + Location: git://github.com/jaspervdj/hakyll.git + +Library + Ghc-Options: -Wall + Hs-Source-Dirs: src + + Build-Depends: + base >= 4 && < 5, + filepath == 1.*, + directory == 1.*, + containers == 0.*, + pandoc == 1.*, + regex-base >= 0.93, + regex-pcre >= 0.93, + mtl >= 1, + old-locale == 1.*, + old-time == 1.*, + time >= 1.1, + binary >= 0.5, + hamlet >= 0.7, + blaze-html >= 0.4, + snap-server >= 0.4, + snap-core >= 0.4, + bytestring >= 0.9, + utf8-string >= 0.3, + HTTP >= 4000, + tagsoup >= 0.12, + hopenssl >= 1.4, + unix >= 2.4, + strict-concurrency >= 0.2 + + Exposed-Modules: + Hakyll + Hakyll.Main + Hakyll.Web.Blaze + Hakyll.Web.Util.Url + Hakyll.Web.Preview.Server + Hakyll.Web.Preview.Poll + Hakyll.Web.CompressCss + Hakyll.Web.Template + Hakyll.Web.Feed + Hakyll.Web.Tags + Hakyll.Web.Pandoc + Hakyll.Web.Pandoc.FileType + Hakyll.Web.Page + Hakyll.Web.Template.Read + Hakyll.Web.RelativizeUrls + Hakyll.Web.Page.Read + Hakyll.Web.Page.Metadata + Hakyll.Core.Configuration + Hakyll.Core.DependencyAnalyzer + Hakyll.Core.Identifier.Pattern + Hakyll.Core.UnixFilter + Hakyll.Core.Util.Arrow + Hakyll.Core.Util.File + Hakyll.Core.Util.String + Hakyll.Core.Resource + Hakyll.Core.Resource.Provider + Hakyll.Core.Resource.Provider.File + Hakyll.Core.CompiledItem + Hakyll.Core.Compiler + Hakyll.Core.Run + Hakyll.Core.Store + Hakyll.Core.Writable + Hakyll.Core.Writable.CopyFile + Hakyll.Core.Writable.WritableTuple + Hakyll.Core.Identifier + Hakyll.Core.DirectedGraph.Dot + Hakyll.Core.DirectedGraph + Hakyll.Core.Rules + Hakyll.Core.Routes + Hakyll.Core.Logger + + Other-Modules: + Paths_hakyll + Hakyll.Web.Template.Read.Hakyll + Hakyll.Web.Template.Read.Hamlet + Hakyll.Web.Template.Internal + Hakyll.Web.Page.Internal + Hakyll.Core.Compiler.Internal + Hakyll.Core.DirectedGraph.Internal + Hakyll.Core.Rules.Internal -- cgit v1.2.3 From 790002e8b9d07a46b4fb50a13b1a17cd3f54b140 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 29 May 2011 11:43:54 +0200 Subject: Site update --- examples/hakyll/css/default.css | 4 +-- examples/hakyll/examples.markdown | 27 +++++++++++++++++++ examples/hakyll/hakyll.hs | 1 + examples/hakyll/images/hakyll-system-1.png | Bin 0 -> 34950 bytes examples/hakyll/images/hakyll-system-2.png | Bin 0 -> 29373 bytes examples/hakyll/images/hakyll-system-3.png | Bin 0 -> 28774 bytes examples/hakyll/index.markdown | 40 ++++++++++++----------------- examples/hakyll/sidebar.markdown | 1 + 8 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 examples/hakyll/examples.markdown create mode 100644 examples/hakyll/images/hakyll-system-1.png create mode 100644 examples/hakyll/images/hakyll-system-2.png create mode 100644 examples/hakyll/images/hakyll-system-3.png diff --git a/examples/hakyll/css/default.css b/examples/hakyll/css/default.css index f895f48..06f664c 100644 --- a/examples/hakyll/css/default.css +++ b/examples/hakyll/css/default.css @@ -31,7 +31,7 @@ div#header h1 { div#main { margin: 0px auto 0px auto; - width: 760px; + width: 860px; } div#sidebar { @@ -50,7 +50,7 @@ div#sidebar a { } div#content { - width: 570px; + width: 670px; float: right; } diff --git a/examples/hakyll/examples.markdown b/examples/hakyll/examples.markdown new file mode 100644 index 0000000..453a22e --- /dev/null +++ b/examples/hakyll/examples.markdown @@ -0,0 +1,27 @@ +--- +title: Examples +--- + +## Simple examples + +A number of simple examples are available in the GitHub repository. They can be +found [here](https://github.com/jaspervdj/hakyll/tree/master/examples). The +README located in that directory explains which example does what. + +## People using Hakyll + +A lot of sites running Hakyll also publish the source code. This is a very +interesting resource to learn from as well. If you're using Hakyll for your +site, and the source code is available, please notify me so I can add you to +this list. This list has no particular ordering. + +- , + [source](https://github.com/jaspervdj/jaspervdj) +- , + [source](https://github.com/altercation/ethanschoonover.com) +- , + [source](https://github.com/beastaugh/extralogical.net) +- , + [source](https://bitbucket.org/paul_r/blog-de-demotera) +- , + [source](http://patch-tag.com/r/byorgey/diagrams-doc/snapshot/current/content/pretty/web/) diff --git a/examples/hakyll/hakyll.hs b/examples/hakyll/hakyll.hs index 60ddc33..5ee755f 100644 --- a/examples/hakyll/hakyll.hs +++ b/examples/hakyll/hakyll.hs @@ -46,6 +46,7 @@ main = hakyll $ do pages = [ "about.markdown" , "changelog.markdown" + , "examples.markdown" , "index.markdown" , "philosophy.markdown" , "reference.markdown" diff --git a/examples/hakyll/images/hakyll-system-1.png b/examples/hakyll/images/hakyll-system-1.png new file mode 100644 index 0000000..69e850c Binary files /dev/null and b/examples/hakyll/images/hakyll-system-1.png differ diff --git a/examples/hakyll/images/hakyll-system-2.png b/examples/hakyll/images/hakyll-system-2.png new file mode 100644 index 0000000..eb424a9 Binary files /dev/null and b/examples/hakyll/images/hakyll-system-2.png differ diff --git a/examples/hakyll/images/hakyll-system-3.png b/examples/hakyll/images/hakyll-system-3.png new file mode 100644 index 0000000..cdffe2d Binary files /dev/null and b/examples/hakyll/images/hakyll-system-3.png differ diff --git a/examples/hakyll/index.markdown b/examples/hakyll/index.markdown index c430ab3..ee44cf3 100644 --- a/examples/hakyll/index.markdown +++ b/examples/hakyll/index.markdown @@ -2,12 +2,6 @@ title: Home --- -## Hakyll 3 - -Hakyll 3 has been released, and it can be installed by running -`cabal install hakyll`. For a limited time (but as long as is necessary) you can -access the old site and documentation [here](/hakyll2) - ## Overview Hakyll is a [Haskell](http://haskell.org) library for generating static sites, @@ -15,30 +9,28 @@ mostly aimed at small-to-medium sites and personal blogs. It is written in a very configurable way and uses an [xmonad](http://xmonad.org)-like DSL for configuration. -## Why static site generators? +Integration with [pandoc](http://johnmacfarlane.net/pandoc/) gives us markdown +and TeX support, including syntax highlighting and other goodies. + +## The Hakyll System -- Static sites are extremely fast. -- You don't have to worry about security issues. +### Write your content in whatever format you prefer -## Features of Hakyll +![Write your content](/images/hakyll-system-1.png) -- Integration with [pandoc](http://johnmacfarlane.net/pandoc/) gives us markdown - and TeX support, including syntax highlighting and other goodies. -- An easy templating system. -- Hakyll also features a simple http server for previewing your site. +### Create compilation rules in a Haskell EDSL -## See some examples +![Write your rules](/images/hakyll-system-2.png) -Some sites written in Hakyll: +### Compile it to HTML and upload it! -- Blog of [Demotera](http://blog.demotera.com/), a French engineering company -- Personal home page and blog of [Chris Done](http://chrisdone.com/) -- Personal home page and blog of [Jasper Van der Jeugt](http://jaspervdj.be/) -- [The Haskell Alphabet](http://www.cis.upenn.edu/~byorgey/haskell-alphabet/) - by Brent Yorgey -- Personal home page and blog of [Nicolas Wu](http://zenzike.com/) -- Home page of [Ethan Schoonover](http://ethanschoonover.com/) -- [Extralogical](http://extralogical.net/) by Benedict Eastaugh +![Compile it](/images/hakyll-system-3.png) + +## Hakyll 3 + +Hakyll 3 has been released, and it can be installed by running +`cabal install hakyll`. For a limited time (but as long as is necessary) you can +access the old site and documentation [here](/hakyll2). ## Getting Started diff --git a/examples/hakyll/sidebar.markdown b/examples/hakyll/sidebar.markdown index fb40b5d..8396c75 100644 --- a/examples/hakyll/sidebar.markdown +++ b/examples/hakyll/sidebar.markdown @@ -4,5 +4,6 @@ [philosophy](/philosophy.html) [about](/about.html) [tutorial](/tutorial.html) +[examples](/examples.html) [reference](/reference.html) [changelog](/changelog.html) -- cgit v1.2.3 From 51f0bfc195aca8b911614fe3d84cb2551d722e3d Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 29 May 2011 12:12:05 +0200 Subject: Add flattr button (disabled for now) --- examples/hakyll/templates/default.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/hakyll/templates/default.html b/examples/hakyll/templates/default.html index 139564b..040292c 100644 --- a/examples/hakyll/templates/default.html +++ b/examples/hakyll/templates/default.html @@ -13,6 +13,22 @@ + + +
@@ -23,6 +39,12 @@
-- cgit v1.2.3