Merge pull request #1608 from southerntofu/bugfix-default-language

[bugfix] config.default_language is exposed to templates
This commit is contained in:
Vincent Prouillet 2021-09-01 20:02:18 +02:00 committed by GitHub
commit 5c428cc141
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,6 +97,7 @@ pub struct SerializedConfig<'a> {
title: &'a Option<String>,
description: &'a Option<String>,
languages: HashMap<&'a String, &'a languages::LanguageOptions>,
default_language: &'a str,
generate_feed: bool,
feed_filename: &'a str,
taxonomies: &'a [taxonomies::Taxonomy],
@ -291,6 +292,7 @@ impl Config {
title: &options.title,
description: &options.description,
languages: self.languages.iter().filter(|(k, _)| k.as_str() != lang).collect(),
default_language: &self.default_language,
generate_feed: options.generate_feed,
feed_filename: &options.feed_filename,
taxonomies: &options.taxonomies,