well stuff
This commit is contained in:
parent
693f1944c5
commit
903a308167
4
external/mypage/text.md
vendored
4
external/mypage/text.md
vendored
|
@ -19,5 +19,7 @@ this that
|
|||
|
||||
## Something else
|
||||
|
||||

|
||||
|
||||
more nonsense
|
||||
haha
|
||||
haha [linek](/tags/)
|
||||
|
|
|
@ -62,7 +62,9 @@ extractHTagLinks ident = do
|
|||
pure (to, htags)
|
||||
|
||||
invTags :: [(Identifier, [[String]])] -> [([String], [String])]
|
||||
invTags x = map (fmap (map ('/':) . nub . map toFilePath)) $ groupSort [(t, p) | (p, htl) <- x, ht <- htl, t <- inits ht]
|
||||
invTags x =
|
||||
map (fmap (map ('/' :) . nub . map toFilePath)) $
|
||||
groupSort [(t, p) | (p, htl) <- x, ht <- htl, t <- inits ht]
|
||||
|
||||
makeTag :: [FilePath] -> [String] -> Rules ()
|
||||
makeTag htag pages =
|
||||
|
@ -72,8 +74,14 @@ makeTag htag pages =
|
|||
let ctx =
|
||||
mconcat
|
||||
[ constField "title" ("Pages tagged " ++ joinPath htag)
|
||||
, listField "htags" (field "htag" (return . itemBody)) (traverse makeItem htag)
|
||||
, listField "pages" (field "page" (return . itemBody)) (traverse makeItem pages)
|
||||
, listField
|
||||
"htags"
|
||||
(field "htag" (return . itemBody))
|
||||
(traverse makeItem htag)
|
||||
, listField
|
||||
"pages"
|
||||
(field "page" (return . itemBody))
|
||||
(traverse makeItem pages)
|
||||
, defaultContext
|
||||
]
|
||||
makeItem "" >>= loadAndApplyTemplate "templates/tag.html" ctx >>=
|
|
@ -9,5 +9,16 @@ executable site
|
|||
, hakyll == 4.16.*
|
||||
, filepath
|
||||
, extra
|
||||
, transformers
|
||||
, containers
|
||||
, pandoc
|
||||
, pandoc-types
|
||||
, microlens
|
||||
, microlens-th
|
||||
, microlens-mtl
|
||||
, microlens-aeson
|
||||
, data-default
|
||||
, text
|
||||
, yaml
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
default-language: Haskell2010
|
||||
|
|
Loading…
Reference in a new issue