summaryrefslogtreecommitdiff
path: root/src/Site.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Site.hs')
-rw-r--r--src/Site.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Site.hs b/src/Site.hs
index 279532f..1bda7ec 100644
--- a/src/Site.hs
+++ b/src/Site.hs
@@ -17,6 +17,10 @@ import Text.Pandoc.Walk (query)
17import Text.Pandoc.Error 17import Text.Pandoc.Error
18import Control.Applicative (Alternative(..), Applicative(..)) 18import Control.Applicative (Alternative(..), Applicative(..))
19 19
20import qualified Crypto.Hash.SHA256 as SHA256 (hash)
21import qualified Data.ByteString.Char8 as CBS
22import Data.Hex
23
20import System.FilePath (takeBaseName, (</>), (<.>)) 24import System.FilePath (takeBaseName, (</>), (<.>))
21 25
22main :: IO () 26main :: IO ()
@@ -135,7 +139,7 @@ tagTranslation = mapMaybe charTrans
135 | otherwise = Nothing 139 | otherwise = Nothing
136 140
137mathTranslation' :: String -> Identifier 141mathTranslation' :: String -> Identifier
138mathTranslation' = fromCapture "math/*.svg" . id -- TODO hash math 142mathTranslation' = fromCapture "math/*.svg" . CBS.unpack . hex . SHA256.hash . CBS.pack
139 143
140addTag :: MonadMetadata m => String -> Pattern -> Tags -> m Tags 144addTag :: MonadMetadata m => String -> Pattern -> Tags -> m Tags
141addTag name pattern tags = do 145addTag name pattern tags = do