From be42575afe0f6ddf8cc5941ae12190ea11689450 Mon Sep 17 00:00:00 2001 From: gurkenhabicht Date: Sat, 29 Oct 2022 00:15:24 +0200 Subject: [PATCH] Added additional styles --- husk_helpers.py | 48 +++++--------- settings.toml | 2 +- start_site.py | 12 ++-- static/stylesheet.css | 37 ++++++----- static/svg/1f4c1.svg | 2 +- style.toml | 138 ++++++++++++++++++++++++++++++++++++++-- templates/pentest_tools | 1 + templates/template.html | 42 ++++++------ 8 files changed, 201 insertions(+), 81 deletions(-) create mode 160000 templates/pentest_tools diff --git a/husk_helpers.py b/husk_helpers.py index cb23fc5..7226744 100644 --- a/husk_helpers.py +++ b/husk_helpers.py @@ -39,40 +39,26 @@ def make_tree(path="templates/content"): if os.listdir(fn): # this line is experimental and needs to be tested tree['children'].append(make_tree(fn)) else: - if fn.endswith('.md') and not name == "README.md": + if fn.endswith('.md'): tree['children'].append(dict(name=fn)) return tree -#def clean_up_tree(tree): -# for key, val in tree.items(): -# if isinstance(val, list): -# val = [ x for x in val if len(val) > 0] -# if isinstance(val, dict): -# clean_tree(tree) -# return tree -#def clean_up_tree(tree): -# ''' -# create a clean directory structure inside the dict without empty lists -# ''' -# import copy -# for key, val in tree.items(): -# if isinstance(val, list): -# if len(val) < 1: -# del tree[key] -# else: -# for item in val: -# if isinstance(item, dict): -# clean_up_tree(item) -# return tree - -#def clean_up_tree(tree): -# ''' -# delete directories without content -# ''' -# for key, val in tree.items(): -# if isinstance(val, list) and len(val) == 0: -# del tree[key] -# return tree +def rem_readme(path, tree): + ''' + This functions puts out the path of the README.md and + which will be index.html + path can be dynamically configured and may have a / at the end nor not + ''' + #if path.endswith('/'): + # path = path[:-1] + #index = f"{path}/README.md" + #for item in tree['children']: + # if isinstance(item, dict): + # for k,v in item.items(): + # if k == "name": + # if v == index: + # del tree['children'][-1][k] + return tree def cut_path_tree(tree, subdir, file_ending): ''' diff --git a/settings.toml b/settings.toml index eeb4ad2..a87c1f1 100644 --- a/settings.toml +++ b/settings.toml @@ -4,5 +4,5 @@ title = "The Real Hugo" [content] path = "templates/content/" -style = "github-dark" # Supported styles are one-dark, solarized-dark, solarized-light, github-dark, xcode +style = "xcode" # Supported styles are one-dark, solarized-dark, solarized-light, github-dark, xcode, nord | taken from https://pygments.org/styles/ diff --git a/start_site.py b/start_site.py index cdfff5f..49ad8ee 100644 --- a/start_site.py +++ b/start_site.py @@ -10,18 +10,17 @@ import markdown.extensions.codehilite import markdown.extensions.toc from markdown.extensions.toc import TocExtension from pygments.formatters import HtmlFormatter -from husk_helpers import make_tree, cut_path_tree, cut_filetype_tree, list_files, build_index +from husk_helpers import make_tree, cut_path_tree, cut_filetype_tree, list_files, build_index, rem_readme import toml app = Flask(__name__) Markdown(app) - app.config["husk"] = toml.load("settings.toml") content_path = app.config["husk"]["content"]["path"] highlight_style = app.config["husk"]["content"]["style"] -stylesheet = "stylesheet.css" -stylesheet_auto_complete = "auto-complete.css" +STYLESHEET = "stylesheet.css" +STYLESHEET_AUTO_COMPLETE = "auto-complete.css" project_name = app.config["husk"]["project"]["name"] project_title = app.config["husk"]["project"]["title"] @@ -53,10 +52,11 @@ def content(path="README"): "documentation.html", toc=md.toc, md_doc=md_template, colors = colors, - stylesheet=stylesheet, stylesheet_auto_complete=stylesheet_auto_complete, + 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") + rem_readme(content_path, make_tree(content_path)) + , content_path, ".md") ) response = make_response(res) response.headers["Content-Type"]: "text/html; charset=utf-8" diff --git a/static/stylesheet.css b/static/stylesheet.css index 54f0bea..17f7396 100644 --- a/static/stylesheet.css +++ b/static/stylesheet.css @@ -1,21 +1,22 @@ -html *{ font-family: Dejavu Sans Mono, MesloGS NF, Menlo, Consolas, Twemoji Mozilla Monospace !important; } +html *{ font-family: Fira Mono, DejaVu Sans Mono, Menlo, Consolas, Liberation Mono, Monaco, Lucida Console, monospace;} body { margin:0; padding: 0; text-decoration: none;} blockquote { text-align: center; font-size: 16px; font-style: normal; line-height: 30px;} -pre { font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; overflow: auto; max-width:100%; border-radius: 5px;} -code { } +pre { font-size: 14px; padding-left: 2ch;padding-top:2ch; padding-bottom: 2ch; overflow: auto; max-width: 100%; border-radius: 5px;} +code { max-width: 100%; overflow: auto; } +img { max-width: 100%; } hr { height: 0px; } a {color: inherit; } a:hover { text-decoration: solid underline;} -details > summary{ font-size: 18px;} +details > summary{ font-size: 16px;} details > summary:hover { } details summary::-webkit-details-marker, -/*details summary::marker { content: "\1F4C1\20";}*/ -details summary::marker { display: none; content: ""; } +details summary::marker { height: auto; content: "\1F4C1\20";} +/*details summary::marker { display: none; content: ""; }*/ ::selection { } ::-moz-selection { } .menu { line-height: 1em; font-size: 32px; text-decoration: none; width: 100%; margin: 0 auto; opacity: 1; } -.banner { float: left; margin-left: 3ch; padding-top: 8px;} -.header-wrapper { width: 100%; position: fixed; top: 0; padding-bottom: 8px; padding-top: 8px; opacity: 0.8; } +.banner { float: left; padding-left: 2em; padding-top: 8px; text-align: center; } +.header-wrapper { width: 100%; position: fixed; top: 0; padding-bottom: 12px; padding-top: 8px; opacity: 0.9; } .HolyGrail, .HolyGrail-body { @@ -35,15 +36,17 @@ details summary::marker { display: none; content: ""; } flex-direction: row; flex: 1; text-align: left; - padding-top: 6vh; + padding-top: 3.6%; } .HolyGrail-content { flex: 1; text-align: left; - margin-left: 1em; - margin-right: 1em; - max-width: 80.5em; + margin-left: 2em; + margin-right: 2em; + /* max-width: 80.5em; */ + overflow: auto; + padding-top: 1em; } .HolyGrail-nav, .HolyGrail-ads { @@ -85,9 +88,9 @@ details summary::marker { display: none; content: ""; } } .HolyGrail-nav li::marker { - /*content: "\1F4DD\20";*/ + content: "\1F4DD\20"; display: none; - content: ""; + /*content: "";*/ } @@ -132,12 +135,12 @@ details summary::marker { display: none; content: ""; } .search-container { /*width: 75%; */ margin: 0 auto; - float: right; + /*margin-right: 0%;*/ - width: 80%; + width: 50%; } .search-container input { - width: 35%; + width: 100%; height: 42px; font-weight: 30px; cursor: pointer; diff --git a/static/svg/1f4c1.svg b/static/svg/1f4c1.svg index 099d58b..83c7d0a 100644 --- a/static/svg/1f4c1.svg +++ b/static/svg/1f4c1.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/style.toml b/style.toml index f08c924..b19bcd0 100644 --- a/style.toml +++ b/style.toml @@ -30,6 +30,38 @@ autocomplete_suggestion_selected = "#ecf2f8" autocomplete_suggestion_hover_background = "#77bdfb" autocomplete_suggestion_hover = "#ecf2f8" +[nord] +body_background ="#616e87" +body = "#d8dee9" +pre_background = "#2e3440" +pre = "#d8dee9" +#pre_border = "#89929b" +pre_border = "none" +code_background = "#2e3440" +code = "#d8dee9" +a = "#a3be8c" +details_background = "#2e3440" +details_hover_background = "#616e87" +details_hover = "#2e3440" +selection_background = "#d08770" +moz_selection_background = "#d08770" +header_background = "#616e87" +nav_background = "#2e3440" +content_border_top = "#2e3440" +content_border_bottom = "#2e3440" +search_input_background = "#2e3440" +search_input = "#d8dee9" +search_input_border = "#616e87" +search_focus_border = "#d08770" +autocomplete_suggestions_background = "#2e3440" +autocomplete_suggestions_border = "#81a1c1" +autocomplete_suggestion = "#d8dee9" +autocomplete_suggestion_b = "#161b22" +autocomplete_suggestion_selected_background = "#77bdfb" +autocomplete_suggestion_selected = "#ecf2f8" +autocomplete_suggestion_hover_background = "#81a1c1" +autocomplete_suggestion_hover = "#d8dee9" + [one-dark] body_background ="#2f333d" body = "#979fad" @@ -38,8 +70,8 @@ pre = "#979fad" pre_border = "#282c34" code_background = "#282c34" code = "#979fad" -a = "#2979ff" -details_background = "#3a3f4b" +a = "#be5046" +details_background = "#282c34" details_hover_background = "#2f333d" details_hover = "#979fad" selection_background = "#668799" @@ -51,13 +83,107 @@ content_border_bottom = "#979fad" search_input_background = "#3a3f4b" search_input = "#979fad" search_input_border = "#282c34" -search_focus_border = "#282c34" +search_focus_border = "#d19a66" autocomplete_suggestions_background = "#3a3f4b" autocomplete_suggestions_border = "#2f333d" autocomplete_suggestion = "#979fad" autocomplete_suggestion_b = "#979fad" -autocomplete_suggestion_selected_background = "#3a3f4b" -autocomplete_suggestion_selected = "#979fad" -autocomplete_suggestion_hover_background = "#979fad" +autocomplete_suggestion_selected_background = "#d19a66" +autocomplete_suggestion_selected = "#3a3f4b" +autocomplete_suggestion_hover_background = "#d19a66" autocomplete_suggestion_hover = "#3a3f4b" +[solarized-dark] +body_background ="#073642" +body = "#93a1a1" +pre_background = "#002b36" +pre = "#839496" +pre_border = "none" +code_background = "#002b36" +code = "#839496" +a = "#b58900" +details_background = "#002b36" +details_hover_background = "#839496" +details_hover = "#002b36" +selection_background = "#fdf6e3" +moz_selection_background = "#fdf6e3" +header_background = "#073642" +nav_background = "#002b36" +content_border_top = "#002b36" +content_border_bottom = "#002b36" +search_input_background = "#839496" +search_input = "#002b36" +search_input_border = "#002b36" +search_focus_border = "#b58900" +autocomplete_suggestions_background = "#eee8d5" +autocomplete_suggestions_border = "#b58900" +autocomplete_suggestion = "#657b83" +autocomplete_suggestion_b = "#1f8dd6" +autocomplete_suggestion_selected_background = "#073642" +autocomplete_suggestion_selected = "#93a1a1" +autocomplete_suggestion_hover_background = "#073642" +autocomplete_suggestion_hover = "#93a1a1" + +[solarized-light] +body_background ="#fdf6e3" +body = "#657b83" +pre_background = "#eee8d5" +pre = "#657b83" +pre_border = "none" +code_background = "#eee8d5" +code = "#657b83" +a = "#073642" +details_background = "#eee8d5" +details_hover_background = "#073642" +details_hover = "#eee8d5" +selection_background = "#073642" +moz_selection_background = "#073642" +header_background = "#fdf6e3" +nav_background = "#eee8d5" +content_border_top = "#002b36" +content_border_bottom = "#002b36" +search_input_background = "#eee8d5" +search_input = "#002b36" +search_input_border = "#002b36" +search_focus_border = "#b58900" +autocomplete_suggestions_background = "#eee8d5" +autocomplete_suggestions_border = "#b58900" +autocomplete_suggestion = "#657b83" +autocomplete_suggestion_b = "#1f8dd6" +autocomplete_suggestion_selected_background = "#073642" +autocomplete_suggestion_selected = "#93a1a1" +autocomplete_suggestion_hover_background = "#073642" +autocomplete_suggestion_hover = "#93a1a1" + +[xcode] +body_background ="#fff" +body = "#262626" +pre_background = "#ecf5ff" +pre = "#262626" +pre_border = "none" +code_background = "#ecf5ff" +code = "#262626" +a = "#2ed9ff" +details_background = "#ecf5ff" +details_hover_background = "#2ed9ff" +details_hover = "#ecf2f8" +selection_background = "#2e9dff" +moz_selection_background = "#2e9dff" +header_background = "#fff" +nav_background = "#ecf5ff" +content_border_top = "#262626" +content_border_bottom = "#262626" +search_input_background = "#ecf5ff" +search_input = "#262626" +search_input_border = "#262626" +search_focus_border = "#2e9dff" +autocomplete_suggestions_background = "#ecf5ff" +autocomplete_suggestions_border = "#262626" +autocomplete_suggestion = "#262626" +autocomplete_suggestion_b = "#262626" +autocomplete_suggestion_selected_background = "#2ed9ff" +autocomplete_suggestion_selected = "#e5e5e5" +autocomplete_suggestion_hover_background = "#2ed9ff" +autocomplete_suggestion_hover = "#e5e5e5" + + diff --git a/templates/pentest_tools b/templates/pentest_tools new file mode 160000 index 0000000..0916deb --- /dev/null +++ b/templates/pentest_tools @@ -0,0 +1 @@ +Subproject commit 0916deb7baeb8c223f4e4d0221372f252c1e9a21 diff --git a/templates/template.html b/templates/template.html index 2e2c6b6..fa14b76 100644 --- a/templates/template.html +++ b/templates/template.html @@ -10,21 +10,21 @@ {% block title %}{{ project_title }}{% endblock %} - + {% endblock %} + + +
@@ -44,10 +49,10 @@
- + - +
@@ -61,10 +66,10 @@ {%- for item in tree.children recursive %} {%- set name = item.name.split('/')[-1] -%} {%- if item.type != "directory" -%} -
  • {{ name }}
  • +
  • {{ name }}
  • {%- else -%} {%- if item.children|length -%} -
    {{ name[0]|upper }}{{ name[1:] }} +
    {{ name[0]|upper }}{{ name[1:] }} {%- endif -%} {%- endif -%} {%- if item.children and item.children|length -%} @@ -86,9 +91,9 @@ function linkClick(obj) { if (obj.open) { //console.log('open'); - if (sessionStorage.getItem(obj.id) && !(sessionStorage.getItem(obj.id) === "open")) { - sessionStorage.removeItem(obj.id); - } + if (sessionStorage.getItem(obj.id) && !(sessionStorage.getItem(obj.id) === "open")) { + sessionStorage.removeItem(obj.id); + } sessionStorage.setItem(obj.id,"open"); //console.log(obj.id); } else { @@ -96,7 +101,6 @@ sessionStorage.removeItem(obj.id); } } - let _keys = Object.keys(sessionStorage); if (_keys) { for ( let i = 0; i < _keys.length; i++ ) {