Rename stylesheets key to styles [BREAKING CHANGE]

This commit is contained in:
daudix
2024-09-12 19:20:33 +03:00
parent 6b69b2b51d
commit 1722b95bea
5 changed files with 20 additions and 19 deletions

View File

@ -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 `--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]** 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 enabling table of contents on all pages and sections except for the homepage.
- Allow opening original comment attachment by clicking on it. - Allow opening original comment attachment by clicking on it.
- Allow overriding the `body` block of `base.html. - Allow overriding the `body` block of `base.html.

View File

@ -85,10 +85,10 @@ fix_contrast_dark = true
issues_url = "https://codeberg.org/daudix/duckquill/issues" issues_url = "https://codeberg.org/daudix/duckquill/issues"
# URL to website's source code # URL to website's source code
source_url = "https://codeberg.org/daudix/duckquill" 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. # If you are using Sass it will be generated there automatically.
# #
# stylesheets = [ # styles = [
# "YOUR_STYLE.css", # "YOUR_STYLE.css",
# "ALSO_YOUR_STYLE.css" # "ALSO_YOUR_STYLE.css"
# ] # ]

View File

@ -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. 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 ```toml
[extra] [extra]
stylesheets = [ styles = [
"YOUR_STYLE.css", "YOUR_STYLE.css",
"ALSO_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: 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"; @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 ```toml
[extra] [extra]
stylesheets = [ styles = [
"YOUR_PAGE_STYLE.css" "YOUR_PAGE_STYLE.css"
] ]
``` ```

View File

@ -18,7 +18,7 @@ Several lesser known Duckquill thingies.
## Styling ## 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 ### Navbar

View File

@ -77,24 +77,24 @@
{%- endif -%} {%- endif -%}
</style> </style>
{%- set stylesheets = [ "style.css" ] %} {%- set styles = [ "style.css" ] %}
{%- if config.extra.katex %} {%- if config.extra.katex %}
{%- set stylesheets = stylesheets | concat(with=["katex.css"]) %} {%- set styles = styles | concat(with=["katex.css"]) %}
{%- endif %} {%- endif %}
{%- if config.extra.stylesheets %} {%- if config.extra.styles %}
{%- set stylesheets = stylesheets | concat(with=config.extra.stylesheets) %} {%- set styles = styles | concat(with=config.extra.styles) %}
{%- endif %} {%- endif %}
{%- if page.extra.stylesheets %} {%- if page.extra.styles %}
{%- set stylesheets = stylesheets | concat(with=page.extra.stylesheets) %} {%- set styles = styles | concat(with=page.extra.styles) %}
{%- elif section.extra.stylesheets %} {%- elif section.extra.styles %}
{%- set stylesheets = stylesheets | concat(with=section.extra.stylesheets) %} {%- set styles = styles | concat(with=section.extra.styles) %}
{%- endif %} {%- endif %}
{%- for stylesheet in stylesheets %} {%- for style in styles %}
<link type="text/css" rel="stylesheet" href="{{ get_url(path=stylesheet) | safe }}" /> <link type="text/css" rel="stylesheet" href="{{ get_url(path=style) | safe }}" />
{%- endfor %} {%- endfor %}
{%- if config.extra.show_copy_button %} {%- if config.extra.show_copy_button %}