From 7c6a690ced8baac64e1e9c667bf581801bd0b679 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 11 Sep 2019 19:33:42 -0700 Subject: [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. --- apex/Ibb.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apex') 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" -- cgit v1.2.3