From 371e666ea9c1b0ef84e8f8d7771a12c52012afae Mon Sep 17 00:00:00 2001 From: david-swift Date: Tue, 18 Feb 2025 16:00:11 +0100 Subject: [PATCH] Simplify navigation bar #1 --- config.toml | 7 ---- sass/_nav.scss | 22 ++----------- templates/partials/extra_features.html | 5 --- templates/partials/head.html | 12 ------- templates/partials/nav.html | 45 -------------------------- 5 files changed, 2 insertions(+), 89 deletions(-) diff --git a/config.toml b/config.toml index 21d1e68..818b705 100644 --- a/config.toml +++ b/config.toml @@ -8,7 +8,6 @@ generate_feeds = true # Only the first file will be used in the navbar feed button, # other feeds will still be available in page's head. feed_filenames = ["rss.xml", "atom.xml"] -build_search_index = true author = "Duck Quack" # Based on https://github.com/welpo/tabi @@ -34,10 +33,6 @@ highlight_themes_css = [ smart_punctuation = true bottom_footnotes = true -[search] -# index_format = "elasticlunr_json" -index_format = "fuse_json" - [extra] # Which theme should be used by default (light/dark). # @@ -134,8 +129,6 @@ csp = [ # auto_hide = true # Whether to show the Atom/RSS feed button in the nav show_feed = true -# Whether to show the manual theme switcher in the nav -show_theme_switcher = true # Whether to show the link to the source repository in the nav show_repo = true # Links used in the nav. diff --git a/sass/_nav.scss b/sass/_nav.scss index 47ad3c4..e365bd8 100644 --- a/sass/_nav.scss +++ b/sass/_nav.scss @@ -151,13 +151,10 @@ } a.active { - box-shadow: var(--edge-highlight); - background-color: var(--accent-color-alpha); color: var(--accent-color); &:hover { - background-color: var(--accent-color); - color: var(--contrast-color); + color: var(--accent-color); /// } } @@ -171,18 +168,6 @@ &.active { color: var(--accent-color); - - &:hover { - color: var(--contrast-color); - } - } - - .icon { - -webkit-mask-image: var(--icon-home); - vertical-align: -0.125em; - mask-image: var(--icon-home); - transition: var(--transition); - margin-inline-end: 0.25rem; } } @@ -195,8 +180,6 @@ color: var(--fg-muted-4); &:hover { - box-shadow: var(--edge-highlight); - background-color: var(--fg-muted-1); color: var(--fg-muted-5); } @@ -323,8 +306,7 @@ color: var(--accent-color); &:hover { - background-color: var(--accent-color); - color: var(--contrast-color); + color: var(--accent-color); } } diff --git a/templates/partials/extra_features.html b/templates/partials/extra_features.html index 4c320c1..cafc5f1 100644 --- a/templates/partials/extra_features.html +++ b/templates/partials/extra_features.html @@ -1,8 +1,3 @@ {%- if config.extra.show_copy_button %} {%- endif %} - -{%- if config.build_search_index %} - - -{%- endif %} diff --git a/templates/partials/head.html b/templates/partials/head.html index 8b64a98..adb3d63 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -83,18 +83,6 @@ {%- set scripts = scripts | concat(with=["katex.min.js", "auto-render.min.js", "katex-init.js"]) %} {%- endif %} - {%- if config.build_search_index %} - {%- if config.search.index_format == "elasticlunr_json" -%} - {%- set scripts = scripts | concat(with=["elasticlunr.min.js", "search-elasticlunr.js"]) %} - {%- elif config.search.index_format == "fuse_json" -%} - {%- set scripts = scripts | concat(with=["fuse.js", "search-fuse.js"]) %} - {%- endif -%} - {%- endif %} - - {%- if config.extra.nav.show_theme_switcher %} - {%- set scripts = scripts | concat(with=["theme-switcher.js"]) %} - {%- endif %} - {%- if page.extra.comments.id %} {%- set scripts = scripts | concat(with=["comments.js"]) %} {%- endif %} diff --git a/templates/partials/nav.html b/templates/partials/nav.html index 766595d..caecb06 100644 --- a/templates/partials/nav.html +++ b/templates/partials/nav.html @@ -14,7 +14,6 @@ {%- if current_url | default(value="/") | trim_end_matches(pat="/") | safe == get_url(path="/", lang=lang) | trim_end_matches(pat='/') | safe -%} class="active" {%- endif -%}> - {{- config.title -}} @@ -63,42 +62,9 @@ {%- endif %} {%- endfor -%} - {%- if config.build_search_index %} - - {%- endif %} {%- if config.languages | length > 0 %} {%- include "partials/language_switcher.html" %} {%- endif -%} - {%- if config.extra.default_theme or config.extra.nav.show_theme_switcher %} -
  • -
    - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
  • - {%- endif %} {%- if config.feed_filenames | length > 1 and config.extra.nav.show_feed -%}
  • @@ -136,15 +102,4 @@ {%- endif %} - {%- if config.build_search_index %} -
    - - -
    -
    -
    -
    - {%- endif %}