From 4b1fac1f1732ef6701a2486d9b065313a0ef153d Mon Sep 17 00:00:00 2001 From: daudix Date: Thu, 14 Nov 2024 19:40:54 +0300 Subject: [PATCH] Backport some changes and fixes Return the separator customization that got lost in some commit Don't blur the nav when it's not visible Don't scale down the article card when clicking on a tag --- CHANGELOG.md | 6 ++++++ config.toml | 15 +++++++++++---- sass/_article-list.scss | 2 +- sass/_nav.scss | 20 +++++++++++++------- templates/article.html | 6 +++--- templates/partials/articles.html | 2 +- templates/partials/head.html | 2 +- templates/partials/title.html | 6 +++--- templates/partials/variables.html | 2 +- 9 files changed, 40 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e2e23..d618bf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://codeberg.org/daudix/duckquill/compare/v6.0.0...main) +### Changed + +- Don't scale down article cards when clicking on tags in them. +- Improve performance of the page when navbar is hidden by using the `config.extra.nav.auto_hide` config variable. +- Replace `config.extra.debug_*` config variables with variables under the `config.extra.debug` section. + ## [6.0.0](https://codeberg.org/daudix/duckquill/compare/v5.4.0...v6.0.0) ### Added diff --git a/config.toml b/config.toml index bb727ff..13142a4 100644 --- a/config.toml +++ b/config.toml @@ -158,6 +158,11 @@ show_backlinks = true # Can be set per page/section. # toc_ordered = true # +# Custom separator used across the theme. +# separator = "•" +# Custom separator used in title tag and posts metadata. +# title_separator = "-" +# # Whether to use Content Security Policy. # Keep in mind that although this can potentially increase security, # it can break some stuff, in which case you will need to set custom policy. @@ -173,10 +178,6 @@ csp = [ { directive = "base-uri", domains = ["'none'"] }, { directive = "form-action", domains = ["'none'"] } ] -# Display outlines around all elements for debugging purposes -# debug_layout = true -# Don't load any styles for debugging purposes -# debug_no_styles = true [extra.nav] # Whether to automatically hide nav when not hovered or focused @@ -254,3 +255,9 @@ show_qr = true # # Your GoatCounter username user = "duckquill" + +[extra.debug] +# Display outlines around all elements for debugging purposes +layout = false +# Don't load any styles for debugging purposes +no_styles = false diff --git a/sass/_article-list.scss b/sass/_article-list.scss index bc2969f..e7086d7 100644 --- a/sass/_article-list.scss +++ b/sass/_article-list.scss @@ -31,7 +31,7 @@ } } - &:active { + &:active:not(:has(.tag:active)) { transform: var(--active); } diff --git a/sass/_nav.scss b/sass/_nav.scss index c7b8955..85ea491 100644 --- a/sass/_nav.scss +++ b/sass/_nav.scss @@ -31,15 +31,22 @@ opacity: 0; } - &:hover + #site-nav { + &:hover + #site-nav, + & + #site-nav:hover, + & + #site-nav:has(*:focus-visible, *:focus) { transform: none; opacity: 1; pointer-events: auto; + + &::before { + -webkit-backdrop-filter: var(--blur); + backdrop-filter: var(--blur); + } } & + #site-nav { position: fixed; - transform: translateY(calc(-50% - 1rem)) scale(0.5); + transform: translateY(-1rem) scale(0.5); transform-origin: top; opacity: 0; transition: var(--transition); @@ -47,11 +54,10 @@ width: max-content; pointer-events: none; - &:hover, - &:has(*:focus-visible, *:focus) { - transform: none; - opacity: 1; - pointer-events: all; + &::before { + -webkit-backdrop-filter: saturate(1) blur(0); + backdrop-filter: saturate(1) blur(0); + transition: var(--transition); } } } diff --git a/templates/article.html b/templates/article.html index 19f813d..1d8fa67 100644 --- a/templates/article.html +++ b/templates/article.html @@ -27,7 +27,7 @@ {{ page.date | date(format=date_format, locale=date_locale) -}} {%- if page.updated -%} - + {{ config.extra.separator | default(value="•") }} {%- if page.authors -%} - • {% include "partials/authors.html" -%} + {{ config.extra.separator | default(value="•") }} {% include "partials/authors.html" -%} {%- endif -%} {%- if page.taxonomies -%} diff --git a/templates/partials/head.html b/templates/partials/head.html index f158152..8b64a98 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -54,7 +54,7 @@ {%- set styles = styles | concat(with=section.extra.styles) %} {%- endif %} - {%- if not config.extra.debug_no_styles %} + {%- if not config.extra.debug.no_styles %} {%- for style in styles %} {%- endfor %} diff --git a/templates/partials/title.html b/templates/partials/title.html index e88d0ee..22e3f14 100644 --- a/templates/partials/title.html +++ b/templates/partials/title.html @@ -1,7 +1,7 @@ {%- if page.title -%} - {{- page.title }} - {{ config.title -}} + {{- page.title }} {{ config.extra.title_separator | default(value="-") }} {{ config.title -}} {%- elif section.title -%} - {{- section.title }} - {{ config.title -}} + {{- section.title }} {{ config.extra.title_separator | default(value="-") }} {{ config.title -}} {%- else -%} - {{- config.title -}} + {{- config.title -}} {%- endif -%} diff --git a/templates/partials/variables.html b/templates/partials/variables.html index 2bf2de3..f837834 100644 --- a/templates/partials/variables.html +++ b/templates/partials/variables.html @@ -63,7 +63,7 @@ } {%- endif -%} - {%- if page.extra.debug_layout or section.extra.debug_layout or config.extra.debug_layout -%} + {%- if config.extra.debug.layout -%} *, *::before, *::after {