-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Initial navya-website.cabal generated by cabal init. For further | ||
-- documentation, see http://haskell.org/cabal/users-guide/ | ||
|
||
name: navya-website | ||
version: 0.1.0.0 | ||
synopsis: Navya's website | ||
-- description: | ||
homepage: http://github.com/navya/navya-website | ||
license: MIT | ||
license-file: LICENSE | ||
author: rejuvyesh | ||
maintainer: [email protected] | ||
-- copyright: | ||
category: Web | ||
build-type: Simple | ||
extra-source-files: README.md | ||
cabal-version: >=1.10 | ||
|
||
executable navya-website | ||
main-is: Main.hs | ||
-- other-modules: | ||
other-extensions: UnicodeSyntax, Arrows, OverloadedStrings | ||
build-depends: base >=4.6 && <4.7, filepath >=1.3 && <1.4, pandoc >=1.12 && <1.13, hakyll | ||
hs-source-dirs: src | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
-- File: Main.hs | ||
|
||
{-# LANGUAGE UnicodeSyntax #-} | ||
{-# LANGUAGE Arrows #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Main where | ||
|
||
import Text.Pandoc as Pandoc | ||
|
||
import Hakyll | ||
|
||
main ∷ IO () | ||
main = hakyll$ do | ||
match ("images/*" .||. "js/*" .||. "favicon.ico" .||. "fonts/*") $ do | ||
route idRoute | ||
compile copyFileCompiler | ||
|
||
match "css/*" $ do | ||
route idRoute | ||
compile compressCssCompiler | ||
|
||
match (fromList pages) $ do | ||
route $ setExtension ".html" | ||
compile $ pandocCompiler | ||
>>= loadAndApplyTemplate "templates/default.html" defaultContext | ||
>>= relativizeUrls | ||
>>= removeIndexHtml | ||
|
||
where | ||
pages = | ||
[ "about/index.md" | ||
, "people/index.md" | ||
, "services/index.md" | ||
, "gallery/index.md"] | ||
|
||
removeIndexHtml ∷ Item String → Compiler (Item String) | ||
removeIndexHtml item = return $ fmap (withUrls removeIndexStr) item | ||
where | ||
removeIndexStr ∷ String → String | ||
removeIndexStr str@(x:xs) | str == "/index.html" = "" | ||
| otherwise = x:removeIndexStr xs | ||
removeIndexStr [] = [] | ||
|
||
|
||
|