Browse Source

Revert "Downgrading to older compiler"

This reverts commit fbbcc83378.
enp1-edits
Logan McGrath 1 year ago
parent
commit
9d4b2b7fe2
  1. 4
      src/Green/Config.hs
  2. 4
      src/Green/Template/Context.hs
  3. 6
      src/Green/Template/Custom/DateField.hs
  4. 6
      src/Green/Template/Field.hs
  5. 7
      stack.yaml
  6. 19
      stack.yaml.lock

4
src/Green/Config.hs

@ -1,9 +1,9 @@
module Green.Config where
import qualified Data.Aeson.Key as Key
import Data.Aeson.Types
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as Char8
import qualified Data.Text as T
import Data.Yaml
import Green.Common
import Green.Lens
@ -194,7 +194,7 @@ toHakyllConfigurationJSON H.Configuration {..} =
parseSiteConfigJSON :: [(String, String)] -> TimeLocale -> ZonedTime -> Value -> Parser SiteConfig
parseSiteConfigJSON env timeLocale time = withObject "SiteConfig" \allConfig -> do
config <- allConfig .: T.pack envKey
config <- allConfig .: Key.fromString envKey
SiteConfig env
<$> config .: "site-info"
<*> (overrideDebugSettings <$> config .:? "debug-settings" .!= defaultSiteDebug)

4
src/Green/Template/Context.hs

@ -3,6 +3,8 @@ module Green.Template.Context where
import Control.Monad.Except
import Control.Monad.State.Strict
import Data.Aeson
import qualified Data.Aeson.Key as Key
import qualified Data.Aeson.KeyMap as KeyMap
import Data.Bifunctor
import Data.Either
import Data.HashMap.Strict (HashMap)
@ -259,7 +261,7 @@ instance (IntoValue v a) => IntoContext [(String, v)] a where
intoContext = intoContext . HashMap.fromList
instance IntoContext Object a where
intoContext = ic . fmap (bimap T.unpack intoValue) . HashMap.toList
intoContext = ic . fmap (bimap Key.toString intoValue) . KeyMap.toList
where
ic :: [(String, ContextValue a)] -> Context a
ic = intoContext

6
src/Green/Template/Custom/DateField.hs

@ -1,9 +1,9 @@
module Green.Template.Custom.DateField where
import qualified Data.HashMap.Strict as HashMap
import qualified Data.Aeson.Key as Key
import qualified Data.Aeson.KeyMap as KeyMap
import Data.List (tails)
import Data.String.Utils
import qualified Data.Text as T
import Green.Common
import Green.Config
import Green.Template.Context
@ -137,4 +137,4 @@ isPublishedField key = field key f
where
f item = lift do
getMetadata (itemIdentifier item)
<&> isJust . HashMap.lookup (T.pack "published")
<&> isJust . KeyMap.lookup (Key.fromString "published")

6
src/Green/Template/Field.hs

@ -3,8 +3,8 @@
module Green.Template.Field where
import Control.Monad.Except
import qualified Data.HashMap.Strict as HashMap
import qualified Data.Text as T
import qualified Data.Aeson.Key as Key
import qualified Data.Aeson.KeyMap as KeyMap
import Green.Common
import Green.Template.Ast
import Green.Template.Compiler
@ -146,7 +146,7 @@ getMetadataField key item = do
maybe
(noResult $ "tried metadata key " ++ show key)
(return . intoValue)
(HashMap.lookup (T.pack key) m)
(KeyMap.lookup (Key.fromString key) m)
bodyField :: String -> Context String
bodyField key = field key $ return . itemBody

7
stack.yaml

@ -17,8 +17,8 @@
#
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver: lts-18.27
compiler: ghc-8.10.7
resolver: nightly-2022-02-18
compiler: ghc-9.0.2
allow-newer: true
# User packages to be built.
@ -42,8 +42,7 @@ packages:
# - git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
#
extra-deps:
- hakyll-4.15.1.0
extra-deps: []
# Override default flag values for local packages and extra-deps
# flags: {}

19
stack.yaml.lock

@ -3,17 +3,10 @@
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages:
- completed:
hackage: hakyll-4.15.1.0@sha256:df90fdb1e7e09e90557ad23a6d402ce042f820f690595e7e73db82220edcadcf,9924
pantry-tree:
size: 8860
sha256: 474bd1e22b8eb6c7ad8e397c1c6741204fff4b30ebc5d9d47576c43820d17e13
original:
hackage: hakyll-4.15.1.0
snapshots:
- completed:
size: 590102
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/27.yaml
sha256: 79a786674930a89301b0e908fad2822a48882f3d01486117693c377b8edffdbe
original: lts-18.27
- original: nightly-2022-02-18
completed:
sha256: ff6915549722dc8a1f79fce89e7fec1407bf52d2d92becbb9d934381937f95e8
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2022/2/18.yaml
size: 609308
packages: []

Loading…
Cancel
Save