stagen 0.0.0 → 0.1.0
raw patch · 5 files changed
+12/−6 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Stagen.Opts: [optsFavicon] :: Opts -> Maybe FilePath
+ Stagen.Template: [tplFavicon] :: Template -> Maybe Text
- Stagen.Opts: Opts :: Command -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> Int -> Verbose -> TargetDirectory -> Opts
+ Stagen.Opts: Opts :: Command -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> Int -> Verbose -> TargetDirectory -> Opts
- Stagen.Template: Template :: [Text] -> [Text] -> Maybe Text -> Maybe Text -> Template
+ Stagen.Template: Template :: [Text] -> [Text] -> Maybe Text -> Maybe Text -> Maybe Text -> Template
Files
- library/Stagen/Build.hs +3/−1
- library/Stagen/Opts.hs +3/−1
- library/Stagen/Template.hs +3/−1
- package.yaml +1/−1
- stagen.cabal +2/−2
library/Stagen/Build.hs view
@@ -37,6 +37,7 @@ void $ title_ (toHtmlRaw pageTitle) mapM_ (\href -> link_ [rel_ "stylesheet", type_ "text/css", href_ href]) (map TL.toStrict tplStyleSheets) mapM_ (\src -> termWith "script" [src_ src] "") (map TL.toStrict tplScripts)+ mapM_ (\href -> link_ [rel_ "icon", type_ "image/png", href_ href]) tplFavicon body_ . div_ [id_ "wrapper"] $ do div_ [id_ "header"] (try tplHeader) div_ [id_ "content"] (toHtmlRaw pageContent)@@ -62,7 +63,7 @@ addArchiveEntries :: Page -> [(FilePath, Page)] -> Page addArchiveEntries page htmlPathAndPages = let pathAndTitles = map (second pageTitle) htmlPathAndPages- sorter = L.sortBy (\(_,_,a) (_,_,b)-> compare a b)+ sorter = L.sortBy (\(_,_,a) (_,_,b)-> compare b a) content = (pageContent page) <> (toLinks . sorter . getEntries) pathAndTitles in Page{pageTitle = pageTitle page, pageContent = content} where@@ -107,6 +108,7 @@ mkTemplate Opts{..} = do let tplStyleSheets = map TL.pack optsStyleSheets let tplScripts = map TL.pack optsScripts+ let tplFavicon = T.pack <$> optsFavicon tplHeader <- go optsHeader tplFooter <- go optsFooter return Template{..}
library/Stagen/Opts.hs view
@@ -20,6 +20,7 @@ optsHeader :: Maybe FilePath, optsFooter :: Maybe FilePath, optsArchive :: Maybe FilePath,+ optsFavicon :: Maybe FilePath, optsStyleSheets :: [FilePath], optsScripts :: [FilePath], optsIgnore :: [FilePath],@@ -42,6 +43,7 @@ <$> tryStrArg 'e' "header" "Include header" <*> tryStrArg 'f' "footer" "Include footer" <*> tryStrArg 'a' "archive" "Prepend archive to generated page"+ <*> tryStrArg 'v' "favicon" "favicon path" <*> many (strArg 'c' "stylesheet" "Stylesheet file path") <*> many (strArg 's' "script" "Script file path") <*> many (strArg 'i' "ignore" "Don't render this file")@@ -62,4 +64,4 @@ targetDirectory = strArgument (metavar "TARGET_DIRECTORY") <|> pure (optsTargetDirectory def) instance Default Opts where- def = Opts Build Nothing Nothing Nothing [] [] [] 1 Slient "."+ def = Opts Build Nothing Nothing Nothing Nothing [] [] [] 1 Slient "."
library/Stagen/Template.hs view
@@ -1,14 +1,16 @@ module Stagen.Template where +import qualified Data.Text as T import qualified Data.Text.Lazy as TL import Data.Default data Template = Template { tplStyleSheets :: [TL.Text], tplScripts :: [TL.Text],+ tplFavicon :: Maybe T.Text, tplHeader :: Maybe TL.Text, tplFooter :: Maybe TL.Text } deriving Show instance Default Template where- def = Template [] [] Nothing Nothing+ def = Template [] [] Nothing Nothing Nothing
package.yaml view
@@ -1,5 +1,5 @@ name: stagen-version: '0.0.0'+version: '0.1.0' category: Web synopsis: Static site generator description: Low dependency static site generator using markdown
stagen.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.17.0.+-- This file has been generated from package.yaml by hpack version 0.17.1. -- -- see: https://github.com/sol/hpack name: stagen-version: 0.0.0+version: 0.1.0 synopsis: Static site generator description: Low dependency static site generator using markdown category: Web