diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Site.hs | 6 |
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) | |||
17 | import Text.Pandoc.Error | 17 | import Text.Pandoc.Error |
18 | import Control.Applicative (Alternative(..), Applicative(..)) | 18 | import Control.Applicative (Alternative(..), Applicative(..)) |
19 | 19 | ||
20 | import qualified Crypto.Hash.SHA256 as SHA256 (hash) | ||
21 | import qualified Data.ByteString.Char8 as CBS | ||
22 | import Data.Hex | ||
23 | |||
20 | import System.FilePath (takeBaseName, (</>), (<.>)) | 24 | import System.FilePath (takeBaseName, (</>), (<.>)) |
21 | 25 | ||
22 | main :: IO () | 26 | main :: IO () |
@@ -135,7 +139,7 @@ tagTranslation = mapMaybe charTrans | |||
135 | | otherwise = Nothing | 139 | | otherwise = Nothing |
136 | 140 | ||
137 | mathTranslation' :: String -> Identifier | 141 | mathTranslation' :: String -> Identifier |
138 | mathTranslation' = fromCapture "math/*.svg" . id -- TODO hash math | 142 | mathTranslation' = fromCapture "math/*.svg" . CBS.unpack . hex . SHA256.hash . CBS.pack |
139 | 143 | ||
140 | addTag :: MonadMetadata m => String -> Pattern -> Tags -> m Tags | 144 | addTag :: MonadMetadata m => String -> Pattern -> Tags -> m Tags |
141 | addTag name pattern tags = do | 145 | addTag name pattern tags = do |