From 1722b95beace7ef904d195cbeeb722f3b6928455 Mon Sep 17 00:00:00 2001 From: daudix Date: Thu, 12 Sep 2024 19:20:33 +0300 Subject: [PATCH] Rename stylesheets key to styles [BREAKING CHANGE] --- CHANGELOG.md | 1 + config.toml | 4 ++-- content/_index.md | 12 ++++++------ content/tricks/index.md | 2 +- templates/partials/head.html | 20 ++++++++++---------- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8d606f..88f7ecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **[BREAKING]** Change the `--active` CSS variable to include `scale()` as well. - **[BREAKING]** Change the way `--bg-color` works. See [Tricks](https://duckquill.daudix.one/tricks/#background-image) page to see how to make background images work. +- **[BREAKING]** Rename `config.extra.stylesheets` to `config.extra.styles`. - Allow enabling table of contents on all pages and sections except for the homepage. - Allow opening original comment attachment by clicking on it. - Allow overriding the `body` block of `base.html. diff --git a/config.toml b/config.toml index 86a46b6..9254126 100644 --- a/config.toml +++ b/config.toml @@ -85,10 +85,10 @@ fix_contrast_dark = true issues_url = "https://codeberg.org/daudix/duckquill/issues" # URL to website's source code source_url = "https://codeberg.org/daudix/duckquill" -# Additional CSS stylesheets; expects them to be in the "./static/" directory. +# Additional CSS styles; expects them to be in the "./static/" directory. # If you are using Sass it will be generated there automatically. # -# stylesheets = [ +# styles = [ # "YOUR_STYLE.css", # "ALSO_YOUR_STYLE.css" # ] diff --git a/content/_index.md b/content/_index.md index 751e8f4..881273b 100644 --- a/content/_index.md +++ b/content/_index.md @@ -130,19 +130,19 @@ Inside that file, copy-paste one of the existing translations from Duckquill and Additionally to translating Duckquill, you can also override the English stings by copy-pasting `en.toml` from Duckquill to the `i18n` directory of your website and adjusting the values to your liking. -### Custom Stylesheets +### Custom Styles -To add your own or override existing styles, create a custom stylesheet and add it in the `config.toml`: +To add your own or override existing styles, create a custom style and add it in the `config.toml`: ```toml [extra] -stylesheets = [ +styles = [ "YOUR_STYLE.css", "ALSO_YOUR_STYLE.css" ] ``` -Additional stylesheets are expected it to be in the `static` directory. If you are using Sass they will be compiled there by default. +Additional styles are expected it to be in the `static` directory. If you are using Sass they will be compiled there by default. If for some reason overridden style is not respected, try using `!important` (don't use it unless needed). You can import styles from Duckquill using: @@ -150,11 +150,11 @@ If for some reason overridden style is not respected, try using `!important` (do @use "../themes/duckquill/sass/NEEDED_FILE.scss"; ``` -You can also load stylesheets per page/section by setting them inside page's front matter: +You can also load styles per page/section by setting them inside page's front matter: ```toml [extra] -stylesheets = [ +styles = [ "YOUR_PAGE_STYLE.css" ] ``` diff --git a/content/tricks/index.md b/content/tricks/index.md index 3f640fa..d0ded75 100644 --- a/content/tricks/index.md +++ b/content/tricks/index.md @@ -18,7 +18,7 @@ Several lesser known Duckquill thingies. ## Styling -Duckquill is pretty easy to restyle with just a few lines of SCSS in the [appropriate location](@/_index.md#custom-stylesheets). Let's see some examples. +Duckquill is pretty easy to restyle with just a few lines of SCSS in the [appropriate location](@/_index.md#custom-styles). Let's see some examples. ### Navbar diff --git a/templates/partials/head.html b/templates/partials/head.html index 979d1e1..1d3852b 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -77,24 +77,24 @@ {%- endif -%} - {%- set stylesheets = [ "style.css" ] %} + {%- set styles = [ "style.css" ] %} {%- if config.extra.katex %} - {%- set stylesheets = stylesheets | concat(with=["katex.css"]) %} + {%- set styles = styles | concat(with=["katex.css"]) %} {%- endif %} - {%- if config.extra.stylesheets %} - {%- set stylesheets = stylesheets | concat(with=config.extra.stylesheets) %} + {%- if config.extra.styles %} + {%- set styles = styles | concat(with=config.extra.styles) %} {%- endif %} - {%- if page.extra.stylesheets %} - {%- set stylesheets = stylesheets | concat(with=page.extra.stylesheets) %} - {%- elif section.extra.stylesheets %} - {%- set stylesheets = stylesheets | concat(with=section.extra.stylesheets) %} + {%- if page.extra.styles %} + {%- set styles = styles | concat(with=page.extra.styles) %} + {%- elif section.extra.styles %} + {%- set styles = styles | concat(with=section.extra.styles) %} {%- endif %} - {%- for stylesheet in stylesheets %} - + {%- for style in styles %} + {%- endfor %} {%- if config.extra.show_copy_button %}