on master help sign in
Merge branch 'master' into type-safe-identifiers
cd0228aJasper Van der Jeugt
examples/hakyll/css/default.css+2−2
@@ -31,7 +31,7 @@ div#header h1 {
31
31
32div#main {
32div#main {
33 margin: 0px auto 0px auto;
33 margin: 0px auto 0px auto;
34− width: 760px;
34+ width: 860px;
35}
35}
36
36
37div#sidebar {
37div#sidebar {
@@ -50,7 +50,7 @@ div#sidebar a {
50}
50}
51
51
52div#content {
52div#content {
53− width: 570px;
53+ width: 670px;
54 float: right;
54 float: right;
55}
55}
56
56
examples/hakyll/examples.markdownnew file+27
@@ -0,0 +1,27 @@
1+---
2+title: Examples
3+---
4+
5+## Simple examples
6+
7+A number of simple examples are available in the GitHub repository. They can be
8+found [here](https://github.com/jaspervdj/hakyll/tree/master/examples). The
9+README located in that directory explains which example does what.
10+
11+## People using Hakyll
12+
13+A lot of sites running Hakyll also publish the source code. This is a very
14+interesting resource to learn from as well. If you're using Hakyll for your
15+site, and the source code is available, please notify me so I can add you to
16+this list. This list has no particular ordering.
17+
18+- <http://jaspervdj.be/>,
19+ [source](https://github.com/jaspervdj/jaspervdj)
20+- <http://ethanschoonover.com/>,
21+ [source](https://github.com/altercation/ethanschoonover.com)
22+- <http://extralogical.net/>,
23+ [source](https://github.com/beastaugh/extralogical.net)
24+- <http://blog.demotera.com/>,
25+ [source](https://bitbucket.org/paul_r/blog-de-demotera)
26+- <http://projects.haskell.org/diagrams/>,
27+ [source](http://patch-tag.com/r/byorgey/diagrams-doc/snapshot/current/content/pretty/web/)
examples/hakyll/hakyll.hs+1
@@ -46,6 +46,7 @@ main = hakyll $ do
46
46
47 pages = [ "about.markdown"
47 pages = [ "about.markdown"
48 , "changelog.markdown"
48 , "changelog.markdown"
49+ , "examples.markdown"
49 , "index.markdown"
50 , "index.markdown"
50 , "philosophy.markdown"
51 , "philosophy.markdown"
51 , "reference.markdown"
52 , "reference.markdown"
examples/hakyll/images/hakyll-system-1.pngnew file

Binary file not shown.

examples/hakyll/images/hakyll-system-2.pngnew file

Binary file not shown.

examples/hakyll/images/hakyll-system-3.pngnew file

Binary file not shown.

examples/hakyll/index.markdown+16−24
@@ -2,12 +2,6 @@
2title: Home
2title: Home
3---
3---
4
4
5−## Hakyll 3
6−
7−Hakyll 3 has been released, and it can be installed by running
8−`cabal install hakyll`. For a limited time (but as long as is necessary) you can
9−access the old site and documentation [here](/hakyll2)
10−
11## Overview
5## Overview
12
6
13Hakyll is a [Haskell](http://haskell.org) library for generating static sites,
7Hakyll 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
15very configurable way and uses an [xmonad](http://xmonad.org)-like DSL for
9very configurable way and uses an [xmonad](http://xmonad.org)-like DSL for
16configuration.
10configuration.
17
11
18−## Why static site generators?
12+Integration with [pandoc](http://johnmacfarlane.net/pandoc/) gives us markdown
13+and TeX support, including syntax highlighting and other goodies.
14+
15+## The Hakyll System
19
16
20−- Static sites are extremely fast.
17+### Write your content in whatever format you prefer
21−- You don't have to worry about security issues.
22
18
23−## Features of Hakyll
19+![Write your content](/images/hakyll-system-1.png)
24
20
25−- Integration with [pandoc](http://johnmacfarlane.net/pandoc/) gives us markdown
21+### Create compilation rules in a Haskell EDSL
26− and TeX support, including syntax highlighting and other goodies.
27−- An easy templating system.
28−- Hakyll also features a simple http server for previewing your site.
29
22
30−## See some examples
23+![Write your rules](/images/hakyll-system-2.png)
31
24
32−Some sites written in Hakyll:
25+### Compile it to HTML and upload it!
33
26
34−- Blog of [Demotera](http://blog.demotera.com/), a French engineering company
27+![Compile it](/images/hakyll-system-3.png)
35−- Personal home page and blog of [Chris Done](http://chrisdone.com/)
28+
36−- Personal home page and blog of [Jasper Van der Jeugt](http://jaspervdj.be/)
29+## Hakyll 3
37−- [The Haskell Alphabet](http://www.cis.upenn.edu/~byorgey/haskell-alphabet/)
30+
38− by Brent Yorgey
31+Hakyll 3 has been released, and it can be installed by running
39−- Personal home page and blog of [Nicolas Wu](http://zenzike.com/)
32+`cabal install hakyll`. For a limited time (but as long as is necessary) you can
40−- Home page of [Ethan Schoonover](http://ethanschoonover.com/)
33+access the old site and documentation [here](/hakyll2).
41−- [Extralogical](http://extralogical.net/) by Benedict Eastaugh
42
34
43## Getting Started
35## Getting Started
44
36
examples/hakyll/sidebar.markdown+1
@@ -4,5 +4,6 @@
4[philosophy](/philosophy.html)
4[philosophy](/philosophy.html)
5[about](/about.html)
5[about](/about.html)
6[tutorial](/tutorial.html)
6[tutorial](/tutorial.html)
7+[examples](/examples.html)
7[reference](/reference.html)
8[reference](/reference.html)
8[changelog](/changelog.html)
9[changelog](/changelog.html)
examples/hakyll/templates/default.html+22
@@ -13,6 +13,22 @@
13 <!-- Metadata. -->
13 <!-- Metadata. -->
14 <meta name="keywords" content="hakyll,static site generator,static,site,generator,haskell,blog"/>
14 <meta name="keywords" content="hakyll,static site generator,static,site,generator,haskell,blog"/>
15 <meta name="description" content="Hakyll - A Static Site Generator in Haskell."/>
15 <meta name="description" content="Hakyll - A Static Site Generator in Haskell."/>
16+
17+ <!-- Flattr JS -->
18+ <!--
19+ <script type="text/javascript">
20+ /* <![CDATA[ */
21+ (function() {
22+ var s = document.createElement('script'), t =
23+ document.getElementsByTagName('script')[0];
24+ s.type = 'text/javascript';
25+ s.async = true;
26+ s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
27+ t.parentNode.insertBefore(s, t);
28+ })();
29+ /* ]]> */
30+ </script>
31+ -->
16 </head>
32 </head>
17 <body>
33 <body>
18 <div id="main">
34 <div id="main">
@@ -23,6 +39,12 @@
23 <!-- Sidebar. -->
39 <!-- Sidebar. -->
24 <div id="sidebar">
40 <div id="sidebar">
25 $sidebar$
41 $sidebar$
42+
43+ <!-- Flattr button -->
44+ <!--
45+ <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://jaspervdj.be/hakyll"></a>
46+ <noscript><a href="http://flattr.com/thing/291889/Hakyll" target="_blank"> <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a></noscript>
47+ -->
26 </div>
48 </div>
27
49
28 <div id="content">
50 <div id="content">
hakyll.cabal+132−103
@@ -1,103 +1,132 @@
1−Name: hakyll
1+Name: hakyll
2−Version: 3.1.2.6
2+Version: 3.1.2.7
3−
3+
4−Synopsis: A simple static site generator library.
4+Synopsis: A static website compiler library
5−Description: A simple static site generator library, mainly aimed at
5+Description:
6− creating blogs and brochure sites.
6+ Hakyll is a static website compiler library. It provides you with the tools to
7+ create a simple or advanced static website using a Haskell DSL and formats
8+ such as markdown or RST. You can find more information, including a tutorial,
9+ on the website:
10+
11+ .
12+
13+ * <http://jaspervdj.be/hakyll>
14+
15+ .
16+
17+ If you seek assistance, there's:
18+
19+ .
20+
21+ * A google group: <http://groups.google.com/group/hakyll>
22+
23+ .
24+
25+ * An IRC channel, @#hakyll@ on freenode
26+
27+ .
28+
29+ Additionally, there's the Haddock documentation in the different modules,
30+ meant as a reference.
31+
7−Author: Jasper Van der Jeugt
32+Author: Jasper Van der Jeugt
8−Maintainer: jaspervdj@gmail.com
33+Maintainer: jaspervdj@gmail.com
9−Homepage: http://jaspervdj.be/hakyll
34+Homepage: http://jaspervdj.be/hakyll
10−Bug-Reports: http://github.com/jaspervdj/Hakyll/issues
35+Bug-Reports: http://github.com/jaspervdj/Hakyll/issues
11−License: BSD3
36+License: BSD3
12−License-File: LICENSE
37+License-File: LICENSE
13−Category: Text
38+Category: Text
39+
14−Cabal-Version: >= 1.6
40+Cabal-Version: >= 1.6
41+Build-Type: Simple
15−Data-Dir: data
42+Data-Dir: data
43+Data-Files:
16−Data-Files: templates/atom.xml
44+ templates/atom.xml
17− templates/atom-item.xml
45+ templates/atom-item.xml
18− templates/rss.xml
46+ templates/rss.xml
19− templates/rss-item.xml
47+ templates/rss-item.xml
20−extra-source-files: src-inotify/Hakyll/Web/Preview/Poll.hs
48+
21− src-interval/Hakyll/Web/Preview/Poll.hs
49+Source-Repository head
22−
23−build-type: Simple
24−
25−source-repository head
26− type: git
50+ Type: git
27− location: git://github.com/jaspervdj/hakyll.git
51+ Location: git://github.com/jaspervdj/hakyll.git
28−
52+
29−library
53+Library
30− ghc-options: -Wall
54+ Ghc-Options: -Wall
31− hs-source-dirs: src
55+ Hs-Source-Dirs: src
32−
56+
57+ Build-Depends:
33− build-depends: base >= 4 && < 5,
58+ base >= 4 && < 5,
34− filepath == 1.*,
59+ filepath == 1.*,
35− directory == 1.*,
60+ directory == 1.*,
36− containers == 0.*,
61+ containers == 0.*,
37− pandoc == 1.*,
62+ pandoc == 1.*,
38− regex-base >= 0.93,
63+ regex-base >= 0.93,
39− regex-pcre >= 0.93,
64+ regex-pcre >= 0.93,
40− mtl >= 1,
65+ mtl >= 1,
41− old-locale == 1.*,
66+ old-locale == 1.*,
42− old-time == 1.*,
67+ old-time == 1.*,
43− time >= 1.1,
68+ time >= 1.1,
44− binary >= 0.5,
69+ binary >= 0.5,
45− hamlet >= 0.7,
70+ hamlet >= 0.7,
46− blaze-html >= 0.4,
71+ blaze-html >= 0.4,
47− snap-server >= 0.4,
72+ snap-server >= 0.4,
48− snap-core >= 0.4,
73+ snap-core >= 0.4,
49− bytestring >= 0.9,
74+ bytestring >= 0.9,
50− utf8-string >= 0.3,
75+ utf8-string >= 0.3,
51− HTTP >= 4000,
76+ HTTP >= 4000,
52− tagsoup >= 0.12,
77+ tagsoup >= 0.12,
53− hopenssl >= 1.4,
78+ hopenssl >= 1.4,
54− unix >= 2.4,
79+ unix >= 2.4,
55− strict-concurrency >= 0.2
80+ strict-concurrency >= 0.2
81+
82+ Exposed-Modules:
56− exposed-modules: Hakyll
83+ Hakyll
57− Hakyll.Main
84+ Hakyll.Main
58− Hakyll.Web.Blaze
85+ Hakyll.Web.Blaze
59− Hakyll.Web.Util.Url
86+ Hakyll.Web.Util.Url
60− Hakyll.Web.Preview.Server
87+ Hakyll.Web.Preview.Server
61− Hakyll.Web.Preview.Poll
88+ Hakyll.Web.Preview.Poll
62− Hakyll.Web.CompressCss
89+ Hakyll.Web.CompressCss
63− Hakyll.Web.Template
90+ Hakyll.Web.Template
64− Hakyll.Web.Feed
91+ Hakyll.Web.Feed
65− Hakyll.Web.Tags
92+ Hakyll.Web.Tags
66− Hakyll.Web.Pandoc
93+ Hakyll.Web.Pandoc
67− Hakyll.Web.Pandoc.FileType
94+ Hakyll.Web.Pandoc.FileType
68− Hakyll.Web.Page
95+ Hakyll.Web.Page
69− Hakyll.Web.Template.Read
96+ Hakyll.Web.Template.Read
70− Hakyll.Web.RelativizeUrls
97+ Hakyll.Web.RelativizeUrls
71− Hakyll.Web.Page.Read
98+ Hakyll.Web.Page.Read
72− Hakyll.Web.Page.Metadata
99+ Hakyll.Web.Page.Metadata
73− Hakyll.Core.Configuration
100+ Hakyll.Core.Configuration
74− Hakyll.Core.DependencyAnalyzer
101+ Hakyll.Core.DependencyAnalyzer
75− Hakyll.Core.Identifier.Pattern
102+ Hakyll.Core.Identifier.Pattern
76− Hakyll.Core.UnixFilter
103+ Hakyll.Core.UnixFilter
77− Hakyll.Core.Util.Arrow
104+ Hakyll.Core.Util.Arrow
78− Hakyll.Core.Util.File
105+ Hakyll.Core.Util.File
79− Hakyll.Core.Util.String
106+ Hakyll.Core.Util.String
80− Hakyll.Core.Resource
107+ Hakyll.Core.Resource
81− Hakyll.Core.Resource.Provider
108+ Hakyll.Core.Resource.Provider
82− Hakyll.Core.Resource.Provider.File
109+ Hakyll.Core.Resource.Provider.File
83− Hakyll.Core.CompiledItem
110+ Hakyll.Core.CompiledItem
84− Hakyll.Core.Compiler
111+ Hakyll.Core.Compiler
85− Hakyll.Core.Run
112+ Hakyll.Core.Run
86− Hakyll.Core.Store
113+ Hakyll.Core.Store
87− Hakyll.Core.Writable
114+ Hakyll.Core.Writable
88− Hakyll.Core.Writable.CopyFile
115+ Hakyll.Core.Writable.CopyFile
89− Hakyll.Core.Writable.WritableTuple
116+ Hakyll.Core.Writable.WritableTuple
90− Hakyll.Core.Identifier
117+ Hakyll.Core.Identifier
91− Hakyll.Core.DirectedGraph.Dot
118+ Hakyll.Core.DirectedGraph.Dot
92− Hakyll.Core.DirectedGraph
119+ Hakyll.Core.DirectedGraph
93− Hakyll.Core.Rules
120+ Hakyll.Core.Rules
94− Hakyll.Core.Routes
121+ Hakyll.Core.Routes
95− Hakyll.Core.Logger
122+ Hakyll.Core.Logger
123+
124+ Other-Modules:
96− other-modules: Paths_hakyll
125+ Paths_hakyll
97− Hakyll.Web.Template.Read.Hakyll
126+ Hakyll.Web.Template.Read.Hakyll
98− Hakyll.Web.Template.Read.Hamlet
127+ Hakyll.Web.Template.Read.Hamlet
99− Hakyll.Web.Template.Internal
128+ Hakyll.Web.Template.Internal
100− Hakyll.Web.Page.Internal
129+ Hakyll.Web.Page.Internal
101− Hakyll.Core.Compiler.Internal
130+ Hakyll.Core.Compiler.Internal
102− Hakyll.Core.DirectedGraph.Internal
131+ Hakyll.Core.DirectedGraph.Internal
103− Hakyll.Core.Rules.Internal
132+ Hakyll.Core.Rules.Internal
src/Hakyll/Web/Page.hs+17−6
@@ -54,6 +54,7 @@ module Hakyll.Web.Page
54 , readPageCompiler
54 , readPageCompiler
55 , pageCompiler
55 , pageCompiler
56 , pageCompilerWith
56 , pageCompilerWith
57+ , pageCompilerWithPandoc
57 , addDefaultFields
58 , addDefaultFields
58 , sortByBaseName
59 , sortByBaseName
59 ) where
60 ) where
@@ -66,7 +67,7 @@ import qualified Data.Map as M
66import Data.List (sortBy)
67import Data.List (sortBy)
67import Data.Ord (comparing)
68import Data.Ord (comparing)
68
69
69−import Text.Pandoc (ParserState, WriterOptions)
70+import Text.Pandoc (Pandoc, ParserState, WriterOptions)
70
71
71import Hakyll.Core.Identifier
72import Hakyll.Core.Identifier
72import Hakyll.Core.Compiler
73import Hakyll.Core.Compiler
@@ -91,16 +92,26 @@ readPageCompiler = getResourceString >>^ readPage
91-- | Read a page, add default fields, substitute fields and render using pandoc
92-- | Read a page, add default fields, substitute fields and render using pandoc
92--
93--
93pageCompiler :: Compiler Resource (Page String)
94pageCompiler :: Compiler Resource (Page String)
94−pageCompiler = cached "Hakyll.Web.Page.pageCompiler" $
95+pageCompiler =
95− readPageCompiler >>> addDefaultFields >>> arr applySelf >>> pageRenderPandoc
96+ pageCompilerWith defaultHakyllParserState defaultHakyllWriterOptions
96
97
97-- | A version of 'pageCompiler' which allows you to specify your own pandoc
98-- | A version of 'pageCompiler' which allows you to specify your own pandoc
98-- options
99-- options
99--
100--
100−pageCompilerWith :: ParserState -> WriterOptions -> Compiler Resource (Page String)
101+pageCompilerWith :: ParserState -> WriterOptions
101−pageCompilerWith state options = cached "pageCompilerWith" $
102+ -> Compiler Resource (Page String)
103+pageCompilerWith state options = pageCompilerWithPandoc state options id
104+
105+-- | An extension of 'pageCompilerWith' which allows you to specify a custom
106+-- pandoc transformer for the content
107+--
108+pageCompilerWithPandoc :: ParserState -> WriterOptions
109+ -> (Pandoc -> Pandoc)
110+ -> Compiler Resource (Page String)
111+pageCompilerWithPandoc state options f = cached "pageCompilerWithPandoc" $
102 readPageCompiler >>> addDefaultFields >>> arr applySelf
112 readPageCompiler >>> addDefaultFields >>> arr applySelf
103− >>> pageRenderPandocWith state options
113+ >>> pageReadPandocWith state
114+ >>> arr (fmap (writePandocWith options . f))
104
115
105-- | Add a number of default metadata fields to a page. These fields include:
116-- | Add a number of default metadata fields to a page. These fields include:
106--
117--