Is it possible to set {{ .Site.LanguageCode }}?

Hej! Yes, you can set languageCode to sv in config.json using a custom theme. But that variable is intended for use only by the RSS template. So you might want to use {{ .Site.Language.Lang }} instead by setting defaultContentLanguage in config.json.

@manton is the only one who can give us official support for multilanguage blogs and timeline entries. But you could hack something together if you really want to. For example, you could have separate categories for each language. Or invent a magic shortcode. Or look for the presence of the :sweden: emoji or a #sv tag or similar in your posts. And implement logic in the templates to set the lang attribute accordingly.

2 Likes