From 217208e3f342d31da541b88af8d06aabbf322f86 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sun, 17 Feb 2019 12:11:40 +0100 Subject: fixed hidden directories filter --- LICENSE | 2 +- Makefile | 4 ---- src/WWWStaticus.hs | 4 ++-- src/WWWStaticusPlugins.hs | 4 ---- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/LICENSE b/LICENSE index e0b8508..04a7a8d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright Michal Idziorek (c) 2018 +Copyright Michal Idziorek (c) 2018.,2019 All rights reserved. diff --git a/Makefile b/Makefile index 851c3cf..13b9250 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,3 @@ clean: -rm ${OUTDIR}/* -r showdoc: stack haddock -# firefox /home/miguel/git/staticus_www/staticus/.stack-work/install/x86_64-linux/lts-13.0/8.6.3/doc/index.html - -#hack to get css, copy this to a stanalone css file. file.md needs to have some source-code for pandoc -#stack exec pandoc -- -s file.md --highlight-style pygments diff --git a/src/WWWStaticus.hs b/src/WWWStaticus.hs index cd9e454..2144fe0 100644 --- a/src/WWWStaticus.hs +++ b/src/WWWStaticus.hs @@ -1,7 +1,7 @@ {-| WWWStaticus is a minimalistic yet modular static website generator first coded in April 2018 by Michal Idziorek . - Last Update: Jan 29, 2019 + Last Update: Feb, 2019 -} module WWWStaticus @@ -56,7 +56,7 @@ trvDirTree fp f = unfoldTreeM unf fp >>= sequence_ -- |get list of subdirectories getDirList :: FilePath -> IO [FilePath] -getDirList d = filter (not.isPrefixOf ".") <$> map ((d++"/")++) <$> listDirectory d +getDirList d = map ((d++"/")++) <$> filter (not.isPrefixOf ".") <$> listDirectory d >>= filterM doesDirectoryExist -- |run plugins in a single directory 'path'. diff --git a/src/WWWStaticusPlugins.hs b/src/WWWStaticusPlugins.hs index a569ca9..ccf82bc 100644 --- a/src/WWWStaticusPlugins.hs +++ b/src/WWWStaticusPlugins.hs @@ -55,12 +55,10 @@ staticusPluginsDefault=[ staticusPluginInit ] -- |Creates target directory and sets basic params in map: --- outdir staticusPluginInit::StaticusPlugin staticusPluginInit = StaticusPlugin "init" id runIO where runIO m = do print $ par "path" m - print $ outdir when (not isHome) (createDirectory outdir) c <- getDirList (par "path" m) t <- getDirList (par "dir_in" m) @@ -68,7 +66,6 @@ staticusPluginInit = StaticusPlugin "init" id runIO let submenu= if isHome then "" else concat $ map (\x->"
  • "++x++"
  • ") (menu c) let breadcrumbs=concat $ map (\x->x) brc let breadcrumbs="" - --TODO: check top dirs until file found! add ./config md <- readFile $ par "path" m++"/"++"index.md" tmpl <- readFile $ par "dir_in" m++"/"++"template.html" return $ M.union (M.fromList [ ("outdir",outdir) @@ -119,4 +116,3 @@ staticusPluginWrite = StaticusPlugin "writer" id runIO where runIO m = do writeFile ((par "outdir" m)++"/index.html") (par "final" m) return m - -- cgit v1.2.3