The hakyll-contrib-elm package

[Tags:bsd3, library, program]

A Hakyll extension which allows building and including Elm projects in static sites.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1
Dependencies base (>=4.8 && <5), bytestring (>=0.9 && <0.11), directory (>=1.0 && <1.3), hakyll (>=4.7 && <4.9), hakyll-contrib-elm (==0.1.*), process (>=1.0 && <1.3), temporary (==1.2.*) [details]
License BSD3
Copyright 2016 Erik Stevenson
Author Erik Stevenson
Maintainer eriknstevenson@gmail.com
Category Web
Home page https://github.com/narrative/hakyll-contrib-elm#readme
Bug tracker https://github.com/narrative/hakyll-contrib-elm/issues
Uploaded Thu May 19 19:38:34 UTC 2016 by narrative
Distributions NixOS:0.1.0.1
Downloads 105 total (14 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-05-19 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for hakyll-contrib-elm

Readme for hakyll-contrib-elm-0.1.0.1

Use Elm and Hakyll

Elm has changed significantly since v0.10, and using the compiler as a library is no longer viable/preferred. This hakyll extension works with Elm v0.17 and improves upon previous similar solutions by working with multi-module elm programs (via elm-make).

Usage

Verify you have the elm-make build tool installed: npm install -g elm

{-# LANGUAGE OverloadedStrings #-}

module Main where

import Hakyll
import Hakyll.Contrib.Elm

main :: IO ()
main = hakyll $ do

  match "elm/*.elm" $ do
    route $ setExtension "js" `composeRoutes` gsubRoute "elm/" (const "js/")
    compile elmMake

  match "index.html" $ do
    route idRoute
    compile $
      getResourceBody
      >>= loadAndApplyTemplate "templates/layout.html" defaultContext

  match "templates/*" $ compile templateCompiler