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