summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2019-02-17 12:11:40 +0100
committerMiguel <m.i@gmx.at>2019-02-17 12:11:40 +0100
commit217208e3f342d31da541b88af8d06aabbf322f86 (patch)
tree76bdd430152753377fbec60e2c6f230356bbed75
parente4fdf5ac751273bcea58beaafb7d7e98f3a93b85 (diff)
fixed hidden directories filter
-rw-r--r--LICENSE2
-rw-r--r--Makefile4
-rw-r--r--src/WWWStaticus.hs4
-rw-r--r--src/WWWStaticusPlugins.hs4
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 <m.i@gmx.at> (c) 2018
+Copyright Michal Idziorek <m.i@gmx.at> (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 <m.i@gmx.at>.
- 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->"<li><a href=\""++outdir++"/"++x++"/index.html\">"++x++"</a></li>") (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
-