hakyll-contrib-elm: Compile Elm code for inclusion in Hakyll static site.

[ bsd3, library, program, web ] [ Propose Tags ]

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


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1
Dependencies base (<5), bytestring, directory, hakyll, hakyll-contrib-elm, process, temporary [details]
License BSD-3-Clause
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 by narrative at Thu May 19 17:41:52 UTC 2016
Distributions NixOS:0.1.0.1
Executables hakyll-contrib-elm-example
Downloads 698 total (41 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2016-05-19 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for hakyll-contrib-elm-0.1.0.0

[back to package description]

Use Elm and Hakyll

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