summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2019-02-19 17:16:35 +0100
committerMiguel <m.i@gmx.at>2019-02-19 17:16:35 +0100
commit1caaf4edbd23c3dd805fbc519da6c2007f73d77a (patch)
treecc1350753f8e92d8a37f711c3925576d27a23def /src
parent03b2e5d7d0d752785730212e4b765e775650efd0 (diff)
fix paths
Diffstat (limited to 'src')
-rw-r--r--src/WWWStaticusPlugins.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/WWWStaticusPlugins.hs b/src/WWWStaticusPlugins.hs
index 6718977..fe509f3 100644
--- a/src/WWWStaticusPlugins.hs
+++ b/src/WWWStaticusPlugins.hs
@@ -80,8 +80,8 @@ staticusPluginInit = StaticusPlugin "init" id runIO
c <- getDirList (par "path" m)
t <- getDirList (par "dir_in" m)
- let menutop= concat $ map (\x->"<li class=\"nav-item"++(if length brc>=1 && brc!!0==x then " active" else "")++"\"><a class=\"nav-link\" href=\""++par "dir_out" m++"/"++x++"/index.html\">"++x++"</a></li>") (menu t)
- let submenu= if isHome then "" else concat $ map (\x->"<li><a href=\""++outdir++"/"++x++"/index.html\">"++cln x++"</a></li>") (menu c)
+ let menutop= concat $ map (\x->"<li class=\"nav-item"++(if length brc>=1 && brc!!0==x then " active" else "")++"\"><a class=\"nav-link\" href=\""++htmlroot++"/"++x++"/index.html\">"++x++"</a></li>") (menu t)
+ let submenu= if isHome then "" else concat $ map (\x->"<li><a href=\""++htmlroot_dir++"/"++x++"/index.html\">"++cln x++"</a></li>") (menu c)
let breadcrumbs=concat $ map (\(x,d)->"<li class=\"breadcrumb-item"++(if d==0 then " active" else "")++"\">"++(if d==0 then "" else "<a href=."++concat(take d (repeat "/.."))++"/index.html>")++cln x++(if d==0 then "" else "</a>")++"</li>") (zip ("home":brc) [brcl,brcl-1..])
md <- readFile $ par "path" m++"/"++"index.md"
@@ -96,6 +96,8 @@ staticusPluginInit = StaticusPlugin "init" id runIO
]) m
where outdir = par "dir_out" m ++ "/" ++ intercalate "/" brc
+ htmlroot_dir = htmlroot ++ "/" ++ intercalate "/" brc
+ htmlroot = par "html_root" m
brc = remUnder $ splitOn "/" (drop (length (par "dir_in" m)) (par "path" m))
brcl = length brc
remUnder = filter (not.null) . map (dropWhile(=='_').dropWhile(/='_'))