Adds user selected language in <html lang=""> (#208)

This commit uses the SITE_MAIN_LANGUAGE set in the .env for all
lang attributes in html elements. This improves accessibility.
This commit is contained in:
stalegjelsten 2023-10-16 21:20:12 +02:00 committed by GitHub
parent c44066a556
commit 9d74cb1997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ meta.mainLanguage }}">
<head> <head>
<title>Nothing here</title> <title>Nothing here</title>
<link href="/styles/digital-garden-base.css" rel="stylesheet"> <link href="/styles/digital-garden-base.css" rel="stylesheet">

View File

@ -66,6 +66,7 @@ module.exports = async (data) => {
timestampSettings, timestampSettings,
baseTheme: process.env.BASE_THEME || "dark", baseTheme: process.env.BASE_THEME || "dark",
siteName: process.env.SITE_NAME_HEADER || "Digital Garden", siteName: process.env.SITE_NAME_HEADER || "Digital Garden",
mainLanguage: process.env.SITE_MAIN_LANGUAGE || "en",
siteBaseUrl: baseUrl, siteBaseUrl: baseUrl,
styleSettingsCss, styleSettingsCss,
buildDate: new Date(), buildDate: new Date(),

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ meta.mainLanguage }}">
<head> <head>
<title>{% if title %}{{ title }}{% else %}{{ page.fileSlug }}{% endif %}</title> <title>{% if title %}{{ title }}{% else %}{{ page.fileSlug }}{% endif %}</title>
{%include "components/pageheader.njk"%} {%include "components/pageheader.njk"%}

View File

@ -2,7 +2,7 @@
permalink: "notes/{{ page.fileSlug | slugify }}/" permalink: "notes/{{ page.fileSlug | slugify }}/"
--- ---
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ meta.mainLanguage }}">
<head> <head>
<title>{% if title %}{{ title }}{% else %}{{ page.fileSlug }}{% endif %}</title> <title>{% if title %}{{ title }}{% else %}{{ page.fileSlug }}{% endif %}</title>
{%include "components/pageheader.njk"%} {%include "components/pageheader.njk"%}