From e80a87ab5b0745b61e6606a170c9537b44e104b9 Mon Sep 17 00:00:00 2001 From: gurkenhabicht Date: Sun, 25 Sep 2022 19:15:31 +0200 Subject: [PATCH] included settings for theme, project name and title, cleanup --- settings.toml | 7 ++++- start_site.py | 12 +++++++-- static/github-dark.css | 51 ++++++++++++++++++++++--------------- static/one-dark.css | 52 +++++++++++++++++++++++--------------- static/solarized-dark.css | 51 ++++++++++++++++++++++--------------- static/solarized-light.css | 51 ++++++++++++++++++++++--------------- static/xcode.css | 51 ++++++++++++++++++++++--------------- templates/template.html | 8 +++--- 8 files changed, 172 insertions(+), 111 deletions(-) diff --git a/settings.toml b/settings.toml index 33ea5bf..eeb4ad2 100644 --- a/settings.toml +++ b/settings.toml @@ -1,3 +1,8 @@ +[project] +name = "Husk" +title = "The Real Hugo" + [content] path = "templates/content/" -style = "xcode" # Supported styles are one-dark, solarized-dark, solarized-light, github-dark, xcode +style = "github-dark" # Supported styles are one-dark, solarized-dark, solarized-light, github-dark, xcode + diff --git a/start_site.py b/start_site.py index 64f59e1..8e40b84 100644 --- a/start_site.py +++ b/start_site.py @@ -20,6 +20,10 @@ Markdown(app) app.config["husk"] = toml.load("settings.toml") content_path = app.config["husk"]["content"]["path"] highlight_style = app.config["husk"]["content"]["style"] +stylesheet = f"{highlight_style}.css" +stylesheet_auto_complete = f"{highlight_style}-auto-complete.css" +project_name = app.config["husk"]["project"]["name"] +project_title = app.config["husk"]["project"]["title"] @app.route('/index.json') @@ -42,8 +46,12 @@ def content(path="README"): css_string = formatter.get_style_defs() md_css_string = "" md_template = md_css_string + html - res = render_template("documentation.html", toc=md.toc, md_doc=md_template, tree= - cut_path_tree( + res = render_template( + "documentation.html", + toc=md.toc, md_doc=md_template, + stylesheet=stylesheet, stylesheet_auto_complete=stylesheet_auto_complete, + project_name=project_name, project_title=project_title, + tree=cut_path_tree( make_tree(content_path), content_path, ".md") ) response = make_response(res) diff --git a/static/github-dark.css b/static/github-dark.css index 7967b92..51f39cf 100644 --- a/static/github-dark.css +++ b/static/github-dark.css @@ -4,7 +4,7 @@ blockquote { text-align: center; font-size: 16px; font-style: normal; line-heigh pre { background-color: #0d1117;color: #ecf2f8;border: 1px solid #89929b; font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; overflow: auto; } code { background-color: #0d1117; color: #ecf2f8; } hr { height: 0px; } -a {color: inherit; text-decoration: none; } +a {color: inherit; } a:hover {color: #77bdfb; text-decoration: solid underline;} details > summary{ background-color: #0d1117; font-size: 18px;} details > summary:hover { background-color: #21262d; color: #ecf2f8;} @@ -47,47 +47,56 @@ details summary::marker { content: "\1F4C1\20";} background-color: #0d1117; } - - .HolyGrail-ads ul li { - list-style-type: none!important; - text-align: left; - border: none; - white-space: normal; - } .HolyGrail-nav ul { list-style-type: none!important; padding-left : 0.3em; margin: 0em; text-align: left; - } + } .HolyGrail-nav li { list-style-type: none!important; padding-left : 1em; margin: 0em; text-align: left; - } - .HolyGrail-nav a{ + } + + .HolyGrail-nav a{ overflow-wrap: break-word; + text-decoration: none; + } - } - - .HolyGrail-nav a:hover{ - } + .HolyGrail-nav a:hover{ + text-decoration: solid underline; + } - .HolyGrail-nav a:before{ + .HolyGrail-nav a:before{ content: ""; - } + } + + .HolyGrail-ads ul li { + list-style-type: none!important; + text-align: left; + border: none; + white-space: normal; + } + + .HolyGrail-ads a { + text-decoration: none; + } + + .HolyGrail-ads a:hover { + text-decoration: solid underline; + } .HolyGrail-ads ul{ padding-left: 0.5em; padding-right: 0; - } + } - - .HolyGrail-ads ul li:before { + .HolyGrail-ads ul li:before { content: "\203B\20"; - } + } } diff --git a/static/one-dark.css b/static/one-dark.css index 088fd63..11532f8 100644 --- a/static/one-dark.css +++ b/static/one-dark.css @@ -4,12 +4,14 @@ blockquote { text-align: center; font-size: 16px; font-style: normal; line-heigh pre { background-color: #282C34;color: #979FAD;border: 1px solid #282C34; font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; line-height: 18px; overflow: auto; } code { background-color: #282C34; color: #979FAD; } hr { height: 0px; } -a {color: inherit; text-decoration: none; } +a {color: inherit; } a:hover {color: #2979FF; text-decoration: solid underline;} details > summary{ background-color: #3A3F4B; font-size: 18px;} details > summary:hover { background-color: #2F333D;} details summary::-webkit-details-marker, details summary::marker { content: "\1F4C1\20";} +::selection { background-color: #668799; } +::-moz-selection { background-color: #668799; } .menu { line-height: 1em; font-size: 32px; line-height: 1em; text-decoration: none; } .HolyGrail, @@ -47,46 +49,56 @@ details summary::marker { content: "\1F4C1\20";} } - .HolyGrail-ads ul li { - list-style-type: none!important; - text-align: left; - border: none; - white-space: normal; - } .HolyGrail-nav ul { list-style-type: none!important; padding-left : 0.3em; margin: 0em; text-align: left; - } + } .HolyGrail-nav li { list-style-type: none!important; padding-left : 1em; margin: 0em; text-align: left; - } - .HolyGrail-nav a{ + } + + .HolyGrail-nav a{ overflow-wrap: break-word; + text-decoration: none; + } - } - - .HolyGrail-nav a:hover{ - } + .HolyGrail-nav a:hover{ + text-decoration: solid underline; + } - .HolyGrail-nav a:before{ + .HolyGrail-nav a:before{ content: ""; - } + } + + .HolyGrail-ads ul li { + list-style-type: none!important; + text-align: left; + border: none; + white-space: normal; + } + + .HolyGrail-ads a { + text-decoration: none; + } + + .HolyGrail-ads a:hover { + text-decoration: solid underline; + } .HolyGrail-ads ul{ padding-left: 0.5em; padding-right: 0; - } + } - - .HolyGrail-ads ul li:before { + .HolyGrail-ads ul li:before { content: "\203B\20"; - } + } } diff --git a/static/solarized-dark.css b/static/solarized-dark.css index 6d9fc19..40c51e9 100644 --- a/static/solarized-dark.css +++ b/static/solarized-dark.css @@ -4,7 +4,7 @@ blockquote { text-align: center; font-size: 16px; font-style: normal; line-heigh pre { background-color: #002b36;color: #839496;border: 1px solid #073642; font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; line-height: 18px; overflow: auto; } code { background-color: #002b36; color: #839496; } hr { height: 0px; } -a {color: inherit; text-decoration: none; } +a {color: inherit; } a:hover {color: #cb4b16; text-decoration: solid underline;} details > summary{ background-color: #002b36; font-size: 18px;} details > summary:hover { background-color: #839496; color: #002b36;} @@ -47,47 +47,56 @@ details summary::marker { content: "\1F4C1\20";} background-color: #002b36; } - - .HolyGrail-ads ul li { - list-style-type: none!important; - text-align: left; - border: none; - white-space: normal; - } .HolyGrail-nav ul { list-style-type: none!important; padding-left : 0.3em; margin: 0em; text-align: left; - } + } .HolyGrail-nav li { list-style-type: none!important; padding-left : 1em; margin: 0em; text-align: left; - } - .HolyGrail-nav a{ + } + + .HolyGrail-nav a{ overflow-wrap: break-word; + text-decoration: none; + } - } - - .HolyGrail-nav a:hover{ - } + .HolyGrail-nav a:hover{ + text-decoration: solid underline; + } - .HolyGrail-nav a:before{ + .HolyGrail-nav a:before{ content: ""; - } + } + + .HolyGrail-ads ul li { + list-style-type: none!important; + text-align: left; + border: none; + white-space: normal; + } + + .HolyGrail-ads a { + text-decoration: none; + } + + .HolyGrail-ads a:hover { + text-decoration: solid underline; + } .HolyGrail-ads ul{ padding-left: 0.5em; padding-right: 0; - } + } - - .HolyGrail-ads ul li:before { + .HolyGrail-ads ul li:before { content: "\203B\20"; - } + } } diff --git a/static/solarized-light.css b/static/solarized-light.css index e6d2f08..d42fb1f 100644 --- a/static/solarized-light.css +++ b/static/solarized-light.css @@ -4,7 +4,7 @@ blockquote { text-align: center; font-size: 16px; font-style: normal; line-heigh pre { background-color: #eee8d5;color: #657b83;border: 1px solid #073642; font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; line-height: 18px; overflow: auto; } code { background-color: #eee8d5; color: #657b83; } hr { height: 0px; } -a {color: inherit; text-decoration: none; } +a {color: inherit; } a:hover {color: #cb4b16; text-decoration: solid underline;} details > summary{ background-color: #eee8d5; font-size: 18px;} details > summary:hover { background-color: #073642 ; color: #eee8d5;} @@ -47,47 +47,56 @@ details summary::marker { content: "\1F4C1\20";} background-color: #eee8d5; } - - .HolyGrail-ads ul li { - list-style-type: none!important; - text-align: left; - border: none; - white-space: normal; - } .HolyGrail-nav ul { list-style-type: none!important; padding-left : 0.3em; margin: 0em; text-align: left; - } + } .HolyGrail-nav li { list-style-type: none!important; padding-left : 1em; margin: 0em; text-align: left; - } - .HolyGrail-nav a{ + } + + .HolyGrail-nav a{ overflow-wrap: break-word; + text-decoration: none; + } - } - - .HolyGrail-nav a:hover{ - } + .HolyGrail-nav a:hover{ + text-decoration: solid underline; + } - .HolyGrail-nav a:before{ + .HolyGrail-nav a:before{ content: ""; - } + } + + .HolyGrail-ads ul li { + list-style-type: none!important; + text-align: left; + border: none; + white-space: normal; + } + + .HolyGrail-ads a { + text-decoration: none; + } + + .HolyGrail-ads a:hover { + text-decoration: solid underline; + } .HolyGrail-ads ul{ padding-left: 0.5em; padding-right: 0; - } + } - - .HolyGrail-ads ul li:before { + .HolyGrail-ads ul li:before { content: "\203B\20"; - } + } } diff --git a/static/xcode.css b/static/xcode.css index 040c3f8..bb0460b 100644 --- a/static/xcode.css +++ b/static/xcode.css @@ -4,7 +4,7 @@ blockquote { text-align: center; font-size: 16px; font-style: normal; line-heigh pre { background-color: #fff;color: #262626;border: 1px solid #262626; font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; overflow: auto; } code { background-color: #fff; color: #262626; } hr { height: 0px; } -a {color: inherit; text-decoration: none; } +a {color: inherit; } a:hover {color: #2e9dff; text-decoration: solid underline;} details > summary{ background-color: #ecf5ff; font-size: 18px;} details > summary:hover { background-color: #2e9dff; color: #ecf2f8;} @@ -47,47 +47,56 @@ details summary::marker { content: "\1F4C1\20";} background-color: #ecf5ff; } - - .HolyGrail-ads ul li { - list-style-type: none!important; - text-align: left; - border: none; - white-space: normal; - } .HolyGrail-nav ul { list-style-type: none!important; padding-left : 0.3em; margin: 0em; text-align: left; - } + } .HolyGrail-nav li { list-style-type: none!important; padding-left : 1em; margin: 0em; text-align: left; - } - .HolyGrail-nav a{ + } + + .HolyGrail-nav a{ overflow-wrap: break-word; + text-decoration: none; + } - } - - .HolyGrail-nav a:hover{ - } + .HolyGrail-nav a:hover{ + text-decoration: solid underline; + } - .HolyGrail-nav a:before{ + .HolyGrail-nav a:before{ content: ""; - } + } + + .HolyGrail-ads ul li { + list-style-type: none!important; + text-align: left; + border: none; + white-space: normal; + } + + .HolyGrail-ads a { + text-decoration: none; + } + + .HolyGrail-ads a:hover { + text-decoration: solid underline; + } .HolyGrail-ads ul{ padding-left: 0.5em; padding-right: 0; - } + } - - .HolyGrail-ads ul li:before { + .HolyGrail-ads ul li:before { content: "\203B\20"; - } + } } diff --git a/templates/template.html b/templates/template.html index cebb293..247f43a 100644 --- a/templates/template.html +++ b/templates/template.html @@ -8,10 +8,10 @@ - - + +
- {% block title %}The Real Hugo{% endblock %} + {% block title %}{{ project_title }}{% endblock %} {% endblock %} @@ -19,7 +19,7 @@