preferred-dark-theme defaults to default-theme
This commit is contained in:
parent
1ef94c2a7e
commit
9bdec5e7cc
|
@ -150,8 +150,10 @@ The following configuration options are available:
|
||||||
files with the ones found in the specified folder.
|
files with the ones found in the specified folder.
|
||||||
- **default-theme:** The theme color scheme to select by default in the
|
- **default-theme:** The theme color scheme to select by default in the
|
||||||
'Change Theme' dropdown. Defaults to `light`.
|
'Change Theme' dropdown. Defaults to `light`.
|
||||||
- **preferred-dark-theme:** The default theme to use if the browser
|
- **preferred-dark-theme:** The default dark theme. This theme will be used if
|
||||||
requests the dark version of the site. Defaults to `navy`.
|
the browser requests the dark version of the site via the
|
||||||
|
['prefers-color-scheme'](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
|
||||||
|
CSS media query. Defaults to the same theme as `default-theme`.
|
||||||
- **curly-quotes:** Convert straight quotes to curly quotes, except for those
|
- **curly-quotes:** Convert straight quotes to curly quotes, except for those
|
||||||
that occur in code blocks and code spans. Defaults to `false`.
|
that occur in code blocks and code spans. Defaults to `false`.
|
||||||
- **mathjax-support:** Adds support for [MathJax](mathjax.md). Defaults to
|
- **mathjax-support:** Adds support for [MathJax](mathjax.md). Defaults to
|
||||||
|
|
|
@ -420,10 +420,8 @@ pub struct HtmlConfig {
|
||||||
pub theme: Option<PathBuf>,
|
pub theme: Option<PathBuf>,
|
||||||
/// The default theme to use, defaults to 'light'
|
/// The default theme to use, defaults to 'light'
|
||||||
pub default_theme: Option<String>,
|
pub default_theme: Option<String>,
|
||||||
/// The default dark theme.
|
/// The theme to use if the browser requests the dark version of the site.
|
||||||
/// This theme will be used if the browser requests a dark theme
|
/// Defaults to the same as 'default_theme'
|
||||||
/// via the 'prefers-color-scheme' CSS media query.
|
|
||||||
/// Defaults to 'navy'.
|
|
||||||
pub preferred_dark_theme: Option<String>,
|
pub preferred_dark_theme: Option<String>,
|
||||||
/// Use "smart quotes" instead of the usual `"` character.
|
/// Use "smart quotes" instead of the usual `"` character.
|
||||||
pub curly_quotes: bool,
|
pub curly_quotes: bool,
|
||||||
|
|
|
@ -409,7 +409,7 @@ fn make_data(
|
||||||
|
|
||||||
let preferred_dark_theme = match html_config.preferred_dark_theme {
|
let preferred_dark_theme = match html_config.preferred_dark_theme {
|
||||||
Some(ref theme) => theme,
|
Some(ref theme) => theme,
|
||||||
None => "navy",
|
None => default_theme,
|
||||||
};
|
};
|
||||||
data.insert(
|
data.insert(
|
||||||
"preferred_dark_theme".to_owned(),
|
"preferred_dark_theme".to_owned(),
|
||||||
|
|
Loading…
Reference in New Issue