@@ -76,6 +76,11 @@ main = hakyll $ do
76
76
( mconcat
77
77
[ urlField " url" ,
78
78
field " name" (pure . view _1 . itemBody),
79
+ -- Set the language that highlight.js should use for syntax highlighting
80
+ field " language" $ \ (itemBody -> (filename, _, _)) ->
81
+ pure $ case dropWhile (== ' .' ) $ takeExtension filename of
82
+ " hs" -> " haskell"
83
+ other -> other,
79
84
field " before" (maybe (pure " <not present>" ) (fmap itemBody . load . itemIdentifier) . view _2 . itemBody),
80
85
field " after" (maybe (pure " <not present>" ) (fmap itemBody . load . itemIdentifier) . view _3 . itemBody)
81
86
]
@@ -193,10 +198,14 @@ getExampleFiles = do
193
198
[" messages" , id , exampleName, _mdFile] -> pure (id , exampleName)
194
199
_ -> fail " Not processing an example"
195
200
196
- let beforePattern = foldl1 (.||.) $ exampleExtensions <&> \ ext ->
197
- fromGlob (" messages/" <> id <> " /" <> exampleName <> " /before/*." <> ext)
198
- afterPattern = foldl1 (.||.) $ exampleExtensions <&> \ ext ->
199
- fromGlob (" messages/" <> id <> " /" <> exampleName <> " /after/*." <> ext)
201
+ let beforePattern =
202
+ foldl1 (.||.) $
203
+ exampleExtensions <&> \ ext ->
204
+ fromGlob (" messages/" <> id <> " /" <> exampleName <> " /before/*." <> ext)
205
+ afterPattern =
206
+ foldl1 (.||.) $
207
+ exampleExtensions <&> \ ext ->
208
+ fromGlob (" messages/" <> id <> " /" <> exampleName <> " /after/*." <> ext)
200
209
201
210
before <- loadAll (beforePattern .&&. hasVersion " raw" )
202
211
after <- loadAll (afterPattern .&&. hasVersion " raw" )
0 commit comments