summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-09-11 19:33:42 -0700
committerBen Sima <ben@bsima.me>2019-09-11 19:33:42 -0700
commit7c6a690ced8baac64e1e9c667bf581801bd0b679 (patch)
treee2ca477cde042b5da7bbd4acae8af08da8004127
parent9e566efb242f47b9f4a9bdf4657b920b2ed61217 (diff)
[ibb] add the git hash to the end of the page
This is for versioning information. I'll need to pretty it up later, but I wanted something easy to do today.
-rw-r--r--apex/Ibb.hs11
-rw-r--r--lore/Alpha.hs3
-rw-r--r--lore/Biz/Ibb/Core.hs5
-rw-r--r--pack/ibb.nix1
4 files changed, 16 insertions, 4 deletions
diff --git a/apex/Ibb.hs b/apex/Ibb.hs
index 6d934f9..544761d 100644
--- a/apex/Ibb.hs
+++ b/apex/Ibb.hs
@@ -1,6 +1,8 @@
-{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
+{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
@@ -13,6 +15,7 @@ import qualified Biz.Ibb.Keep as Keep
import Data.Maybe (fromMaybe)
import Data.Acid (AcidState)
import qualified Data.Acid.Abstract as Acid
+import GitHash (giHash, tGitInfoCwd)
import qualified Lucid as L
import Lucid.Base
import Miso
@@ -48,8 +51,12 @@ instance L.ToHtml a => L.ToHtml (HtmlPage a) where
L.head_ $ do
L.meta_ [L.charset_ "utf-8"]
jsRef "/static/all.js"
- L.body_ (L.toHtml x)
+ L.body_ $ do
+ page
+ L.p_ gitCommit
where
+ page = L.toHtml x
+ gitCommit = L.toHtml $ giHash $$tGitInfoCwd
jsRef href = L.with (L.script_ mempty)
[ makeAttribute "src" href
, makeAttribute "type" "text/javascript"
diff --git a/lore/Alpha.hs b/lore/Alpha.hs
index 67bfa35..bae7fa5 100644
--- a/lore/Alpha.hs
+++ b/lore/Alpha.hs
@@ -7,8 +7,11 @@ module Alpha (
, (/@)
-- * Debugging tools
, say
+ -- * TODO: remove this
+ , Prelude.read
) where
+import qualified Prelude
import Protolude as X
import Data.String
diff --git a/lore/Biz/Ibb/Core.hs b/lore/Biz/Ibb/Core.hs
index 5d8f805..ff00060 100644
--- a/lore/Biz/Ibb/Core.hs
+++ b/lore/Biz/Ibb/Core.hs
@@ -1,7 +1,8 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE DeriveDataTypeable #-}
-- | Main app logic
module Biz.Ibb.Core where
diff --git a/pack/ibb.nix b/pack/ibb.nix
index c658068..16589b4 100644
--- a/pack/ibb.nix
+++ b/pack/ibb.nix
@@ -13,6 +13,7 @@
"blaze-html"
"blaze-markup"
"bytestring"
+ "githash"
"ixset"
"random"
"safecopy"