on master help sign in
Start simple init program
commit6307ecd094c0ab2f937909dacdce08f8a4bb7780 authorJasper Van der Jeugt <m@jaspervdj.be> dateWed 5 Dec 2012, 23:29 (14 years ago) parent3f13de0
13 files changed+199−32
.gitignore+1 data/example/about.rst+17 data/example/code.lhs+21 data/example/css/default.css+27 data/example/css/syntax.css+18 data/example/images/haskell-logo.png data/example/index.markdown+27 data/example/site.hs+23 data/example/templates/default.html+21 hakyll.cabal+21−3 src/Hakyll/Init.hs+23 web/philosophy.markdown−28 web/templates/default.html−1
.gitignore+1
@@ -13,6 +13,7 @@ tags
1313tests/Main
1414_cache
1515_store
16+_site
1617
1718# Rest of the file: ignore examples
1819web/_cache
data/example/about.rstnew file+17
@@ -0,0 +1,17 @@
1+---
2+title: About
3+---
4+Nullam imperdiet sodales orci vitae molestie. Nunc quam orci, pharetra a
5+rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
6+Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
7+habitasse platea dictumst. Morbi fringilla mattis odio, et mattis tellus
8+accumsan vitae.
9+
10+1. Amamus Unicode 碁
11+2. Interdum nex magna.
12+
13+Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
14+risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
15+elementum libero eget leo aliquet quis euismod orci vestibulum. Duis rhoncus
16+lorem consequat tellus vestibulum aliquam. Quisque orci orci, malesuada porta
17+blandit et, interdum nec magna.
data/example/code.lhsnew file+21
@@ -0,0 +1,21 @@
1+---
2+title: Code
3+---
4+Etiam condimentum auctor semper. Donec lobortis, magna id sodales sollicitudin,
5+lectus mi egestas nulla, pulvinar lobortis nunc eros id nisl. Curabitur
6+imperdiet, erat at accumsan vulputate.
7+
8+> reverse' [] = []
9+> reverse' (x:xs) = (reverse' xs) ++ [x]
10+
11+Purus nunc blandit nulla, dictum.
12+
13+vestibulum sem lorem eget ipsum. Nunc tincidunt, turpis ut fermentum dapibus,
14+justo tortor bibendum sem, at facilisis justo odio luctus lectus. Quisque nec
15+ligula ipsum. Nunc augue lacus, ullamcorper vel dapibus in, mattis eget elit.
16+
17+> main = print $ reverse' [1 .. 10]
18+
19+Integer ut dui eu felis mollis vestibulum. Etiam at nibh id diam aliquet
20+vestibulum sit amet a nibh. Aliquam erat volutpat. Etiam vitae nulla at dolor
21+fringilla tempor ut a nunc. Pellentesque elementum elit lorem.
data/example/css/default.cssnew file+27
@@ -0,0 +1,27 @@
1+body {
2+ width: 600px;
3+ margin: 0px auto 0px auto;
4+}
5+
6+div#navigation {
7+ text-align: center;
8+ border-bottom: 4px solid black;
9+}
10+
11+div#navigation a {
12+ color: white;
13+ text-decoration: none;
14+ background-color: black;
15+ padding: 3px 10px 3px 10px;
16+ margin: 0px 10px 0px 10px;
17+}
18+
19+div.figure {
20+ float: right;
21+ margin: 20px 0px 20px 20px;
22+}
23+
24+div.figure p.caption {
25+ text-align: center;
26+ font-style: italic;
27+}
data/example/css/syntax.cssnew file+18
@@ -0,0 +1,18 @@
1+/* Generated by pandoc. */
2+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
3+ { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
4+td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
5+td.sourceCode { padding-left: 5px; }
6+pre.sourceCode span.kw { color: #007020; font-weight: bold; }
7+pre.sourceCode span.dt { color: #902000; }
8+pre.sourceCode span.dv { color: #40a070; }
9+pre.sourceCode span.bn { color: #40a070; }
10+pre.sourceCode span.fl { color: #40a070; }
11+pre.sourceCode span.ch { color: #4070a0; }
12+pre.sourceCode span.st { color: #4070a0; }
13+pre.sourceCode span.co { color: #60a0b0; font-style: italic; }
14+pre.sourceCode span.ot { color: #007020; }
15+pre.sourceCode span.al { color: red; font-weight: bold; }
16+pre.sourceCode span.fu { color: #06287e; }
17+pre.sourceCode span.re { }
18+pre.sourceCode span.er { color: red; font-weight: bold; }
data/example/images/haskell-logo.pngnew file

Binary file not shown.

data/example/index.markdownnew file+27
@@ -0,0 +1,27 @@
1+---
2+title: Home
3+---
4+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempor, urna et
5+auctor tincidunt, eros mauris facilisis purus, eget sollicitudin leo massa sit
6+amet ipsum. Vivamus eu massa in urna vehicula rutrum eget sit amet purus.
7+
8+![Haskell logo](/images/haskell-logo.png)
9+
10+- Mauris sit amet justo mi.
11+- Curabitur vel quam felis.
12+- In hac habitasse platea dictumst.
13+
14+Etiam nec consequat risus. Donec consequat est vitae neque fermentum
15+feugiat nec ac nibh. Nulla rhoncus, odio quis scelerisque rutrum, metus sem
16+tempor ante, a ornare ipsum felis sed ligula. Morbi urna lectus, scelerisque
17+non pharetra in, rutrum quis ligula. Phasellus semper ullamcorper arcu eu
18+auctor.
19+
20+Aliquam sagittis tincidunt libero ut elementum. Ut sit amet vestibulum metus.
21+Ut aliquet congue neque eu tincidunt. Integer eu elit sed massa sollicitudin
22+vehicula nec ut sem. Cras euismod enim eget purus lacinia non feugiat urna
23+imperdiet. Aliquam justo sem, viverra eu vehicula vitae, imperdiet vel magna.
24+
25+Pellentesque enim dui, interdum elementum vehicula luctus, feugiat vitae arcu.
26+Vestibulum ut felis justo. Quisque vestibulum mauris eget ipsum luctus
27+consequat.
data/example/site.hsnew file+23
@@ -0,0 +1,23 @@
1+--------------------------------------------------------------------------------
2+{-# LANGUAGE OverloadedStrings #-}
3+import Hakyll
4+
5+
6+--------------------------------------------------------------------------------
7+main :: IO ()
8+main = hakyll $ do
9+ match "images/*" $ do
10+ route idRoute
11+ compile copyFileCompiler
12+
13+ match "css/*" $ do
14+ route idRoute
15+ compile compressCssCompiler
16+
17+ match (fromList ["about.rst", "index.markdown", "code.lhs"]) $ do
18+ route $ setExtension "html"
19+ compile $ pageCompiler
20+ >>= requireApplyTemplate "templates/default.html" defaultContext
21+ >>= relativizeUrls
22+
23+ match "templates/*" $ compile templateCompiler
data/example/templates/default.htmlnew file+21
@@ -0,0 +1,21 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5+ <head>
6+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7+ <title>MyAweSomeCompany - $title$</title>
8+ <link rel="stylesheet" type="text/css" href="/css/default.css" />
9+ <link rel="stylesheet" type="text/css" href="/css/syntax.css" />
10+ </head>
11+ <body>
12+ <h1>MyAweSomeCompany - $title$</h1>
13+ <div id="navigation">
14+ <a href="/">Home</a>
15+ <a href="/about.html">About</a>
16+ <a href="/code.html">Code</a>
17+ </div>
18+
19+ $body$
20+ </body>
21+</html>
hakyll.cabal+21−3
@@ -41,11 +41,19 @@ Cabal-Version: >= 1.8
4141Build-Type: Simple
4242Data-Dir: data
4343
44−Data-Files:
45− templates/atom.xml
44+Data-files:
45+ example/about.rst
46+ example/code.lhs
47+ example/css/default.css
48+ example/css/syntax.css
49+ example/images/haskell-logo.png
50+ example/index.markdown
51+ example/site.hs
52+ example/templates/default.html
4653 templates/atom-item.xml
47− templates/rss.xml
54+ templates/atom.xml
4855 templates/rss-item.xml
56+ templates/rss.xml
4957
5058Extra-source-files:
5159 tests/data/example.md
@@ -214,3 +222,13 @@ Test-suite hakyll-tests
214222 Hakyll.Web.Urls.Relativize.Tests
215223 Hakyll.Web.Util.Html.Tests
216224 TestSuite.Util
225+
226+Executable hakyll-init
227+ Ghc-options: -Wall
228+ Hs-source-dirs: src
229+ Main-is: Hakyll/Init.hs
230+
231+ Build-depends:
232+ base >= 4 && < 5,
233+ directory >= 1.0 && < 1.3,
234+ filepath >= 1.0 && < 1.4
src/Hakyll/Init.hsnew file+23
@@ -0,0 +1,23 @@
1+--------------------------------------------------------------------------------
2+module Main
3+ ( main
4+ ) where
5+
6+
7+--------------------------------------------------------------------------------
8+import System.Directory (copyFile)
9+
10+
11+--------------------------------------------------------------------------------
12+import Hakyll.Core.Util.File
13+import Paths_hakyll
14+
15+
16+--------------------------------------------------------------------------------
17+main :: IO ()
18+main = do
19+ let dstDir = "."
20+ srcDir <- getDataFileName "example"
21+ files <- getRecursiveContents srcDir
22+ print files
23+ return ()
web/philosophy.markdowndeleted−28
@@ -1,28 +0,0 @@
1−---
2−title: Philosophy
3−---
4−
5−# Small-to-medium sites
6−
7−Hakyll was written to be used for small-to-medium sites. You can do some
8−advanced things with it, but don't use it to build a big online shop.
9−
10−# Hakyll.hs
11−
12−It should be possible to put all configuration in one file, so data and
13−configuration can be strictly separated. In addition, we think this file should
14−never exceed a 100 lines of code.
15−
16−# High-level
17−
18−Hakyll tries to provide as many high-level functions as possible for common
19−tasks, while the lower-level functions should also be accessible. If you think
20−you're writing something that can be used for many sites, please send a patch,
21−or your `hakyll.hs`, and we will see what we can do.
22−
23−# Well-documented
24−
25−A key to being easy-to-use is documentation. That's why we try to provide as
26−many working examples as possible. If you ever create a site using hakyll,
27−please consider open-sourcing it, as people might be able to learn from your
28−code.
web/templates/default.html−1
@@ -26,7 +26,6 @@
2626 <a href="/index.html">home</a>
2727 <a href="/tutorials.html">tutorials</a>
2828 <a href="/reference.html">reference</a>
29− <a href="/philosophy.html">philosophy</a>
3029 <a href="/about.html">about</a>
3130 <a href="/tutorials/faq.html">faq</a>
3231 <a href="/examples.html">examples</a>