-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.hs
65 lines (55 loc) · 2.07 KB
/
site.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Data.Monoid (mappend)
import Hakyll
import Hakyll.Web.Sass (sassCompilerWith)
import Text.Sass.Options
import qualified Bindings.Libsass as Lib
saasOptions = SassOptions
{ sassPrecision = 5
, sassOutputStyle = Lib.SassStyleNested
, sassSourceComments = False
, sassSourceMapEmbed = False
, sassSourceMapContents = False
, sassOmitSourceMapUrl = False
, sassIsIndentedSyntax = False
, sassIndent = " "
, sassLinefeed = "\n"
, sassInputPath = Nothing
, sassOutputPath = Nothing
, sassPluginPaths = Nothing
, sassIncludePaths = Just ["./scss/3rdParty/foundation/", "./scss/project/"]
, sassSourceMapFile = Nothing
, sassSourceMapRoot = Nothing
, sassFunctions = Nothing
, sassHeaders = Nothing
, sassImporters = Nothing
}
--------------------------------------------------------------------------------
main :: IO ()
main = hakyll $ do
match "htmls/*.html" $ do
route $ gsubRoute "htmls/" $ const ""
compile copyFileCompiler
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "js/*" $ do
route idRoute
compile copyFileCompiler
match "pages/*.html" $ do
route $ gsubRoute "pages/" $ const ""
compile $ do
getResourceBody
>>= applyAsTemplate standardCtx
>>= loadAndApplyTemplate "templates/default.html" standardCtx
>>= relativizeUrls
match "templates/*" $ compile templateCompiler
match "scss/project/styling.scss" $ do
route $ constRoute "css/styling.css"
compile $ sassCompilerWith saasOptions
--------------------------------------------------------------------------------
standardCtx :: Context String
standardCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext