diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | src/WWWStaticusPlugins.hs | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,7 @@ INDIR=/home/miguel/git/idziorek_net +OUTDIR=/mnt/andromeda/htmlpub/idziorek_net OUTDIR=/tmp/idziorek_net +HTMLROOT=https://www.idziorek.net HTMLROOT=/tmp/idziorek_net run: build clean 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(/='_')) |
