diff --git a/pub/style/style.css b/pub/style/style.css index 9080bbc..a0b7517 100644 --- a/pub/style/style.css +++ b/pub/style/style.css @@ -1,5 +1,3 @@ -/* Default werc style */ - /* General style guidelines: - All font-size at least 14px (recommended 16px) - Line-height: 1.5 for paragraph body, 1.1 for header @@ -14,7 +12,6 @@ body { padding: 0; } - /* # Header # */ .superHeader { color: white; @@ -88,6 +85,55 @@ a:hover { text-decoration: underline; } background-color: transparent; } +/* # Horiz-side # */ +#horiz-side-bar { + width:100%; + float left; + clear: both; + border: 0; + margin: 0; + padding: 0; +} + +#horiz-side-bar ul { + margin: 0; + padding: 0.3em; + list-style-type: none; + list-style-image: none; + background: #eeeeee; + border: 0; +} + +#horiz-side-bar ul:nth-child(even) { + background-color: #dddddd; +} + +#horiz-side-bar li { + display: inline; + white-space: nowrap; + line-height: 1.6em; +} + +#horiz-side-bar li.thisPage a { + color: black!important; + font-weight: bold; +} +#horiz-side-bar ul li a { + margin: 0; + padding: 0.1em 1ex 0.1em 1ex; + color: #336699; + background-color: transparent; + text-decoration: none; + font-size: 1em; + border: 0; +} + +#horiz-side-bar ul li a:hover { + color: black; + text-decoration: none; + text-transform: none; +} + /* # Side # */ #side-bar { @@ -120,7 +166,6 @@ li ul { #side-bar li { margin: 0; - padding: 0.1ex 0; /* Circumvents a rendering bug (?) in MSIE 6.0 XXX should move to iehacks.css, this causes an ugly gap */ } #side-bar a { @@ -135,10 +180,10 @@ li ul { border-left: white solid 0.2em; } -.thisPage, .thisPage a { +#side-bar li.thisPage a { color: black!important; background-color: white; - padding-left: 5mm; + font-style:italic; } #side-bar a:hover { @@ -170,11 +215,15 @@ li ul { /* # Main Copy # */ #main-copy { - max-width: 70em; + padding: 0.5mm 5mm 5mm 5mm; color: black; background-color: transparent; text-align: justify; line-height: 1.5em; +} + +.main-copy-side-bar { + max-width: 70em; margin: 0em 0 0 16em; padding: 0.5mm 5mm 5mm 5mm; border-left: 1px solid #ddd; diff --git a/src/config.d b/src/config.d index 768e4b4..8763cc2 100644 --- a/src/config.d +++ b/src/config.d @@ -2,5 +2,8 @@ const string url_root = "/~j3parker/"; const string dweb_root = "/users/j3parker/www/"; const string site_root = dweb_root ~ "srv/"; -const string site_title = "Test Title"; -const string site_subtitle = "this is a subtitle"; +const string site_title = "This is a Title"; +const string site_subtitle = "but this is a subtitle"; + +const bool nav_tree_vert = false; +const bool nav_tree_chev = false; diff --git a/src/web.d b/src/web.d index a930892..3616241 100755 --- a/src/web.d +++ b/src/web.d @@ -14,35 +14,46 @@ void html_push(string s) { html(s); indent ~= " "; } void write_link(string root, string file, bool expand) { bool isdir = dirExists(file); - html_push("
  • "); - html("» " : ">› ") - ~ last_in_path(file) ~ (isdir ? "/" : "") - ~ (expand? "" : "") ~ ""); + string flair = nav_tree_chev? (expand? "» " : "› ") : ""; + html_push(""); + html("" + ~ flair ~last_in_path(file) ~ (isdir ? "/" : "") + ~ ""); html_pop("
  • "); } void nav_tree_r(string root, string cur_loc, string[] subdirs) { + string[] dirs = dir(cur_loc); + if (dirs.length == 0) return; html_push(""); + if (next) nav_tree_r(root, next_loc, subdirs[1..$]); } // this could be better string[] dir(string path) { string[] files; - foreach(string s; dirEntries(path, SpanMode.shallow)) files ~= s; + foreach(string s; dirEntries(path, SpanMode.shallow)) { + if (s[max(0,$-8)..$] != "index.md") files ~= s; + } sort(files); return files; } @@ -51,11 +62,12 @@ void do_nav_tree(string path) { try { if (isDir(path) && path[path.length - 1] != '/') { path = site_root; } } catch (Exception e) { path = site_root; } - html_push("
    "); + html_push("
    "); string root = get_root_dir(path); string[] subdirs = explode_slashes(path[site_root.length..$]); nav_tree_r(root, site_root, subdirs); + html_pop("
    \n"); } @@ -124,7 +136,7 @@ bool fileExists(string path) { try { if (isFile(path)) return true; else return bool dirExists(string path) { try { if (isDir(path)) return true; else return false; } catch (Exception e) { return false; } } void do_content(string path) { - html_push("
    "); + html_push("
    "); string url = path[site_root.length..$]; switch (url) { case "changelog": diff --git a/srv/.dweb b/srv/.dweb index 3bdf689..5a392e4 100644 --- a/srv/.dweb +++ b/srv/.dweb @@ -36,7 +36,7 @@ Source You can get the source code on [github](https://github.com/j3parker/dweb) or by running - git clone git://github.com/j3parker/Go-OpenGL.git + git clone git://github.com/j3parker/dweb.git Contact --------