Allow configuring lang attribute on <html> tag (#608)

Add a page/site configuration variable named "language", which can be
set either in _config.yml or in a front matter in order to customize
value of "lang" attribute on <html> element.  Previously, it was
hardcoded to "en".
This commit is contained in:
Sebastian Skałacki 2020-04-22 23:58:01 +02:00 committed by GitHub
parent 6025683e3d
commit 4a19f20383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,8 @@ This file lists all non-trivial changes to Beautiful Jekyll.
I often make small changes to documentation, to the demo site, or to the general look-and-feel. These changes will not be listed here. Any other minor changes will also not be listed here. I often make small changes to documentation, to the demo site, or to the general look-and-feel. These changes will not be listed here. Any other minor changes will also not be listed here.
**2020-04-22** Add support for configuring lang attribute on &lt;html&gt; tag (#608) (thanks @skalee)
**2020-04-18** Add ability to disable round logo (thanks @gpotter2) **2020-04-18** Add ability to disable round logo (thanks @gpotter2)
**2020-04-01** Add support for Utterances comments (#596) (thanks @colynn) **2020-04-01** Add support for Utterances comments (#596) (thanks @colynn)

View File

@ -160,6 +160,7 @@ image | If you want to add a personalized image to your blog post that wil
share-img | If you want to specify an image to use when sharing the page on Facebook or Twitter, then provide the image's full URL here. share-img | If you want to specify an image to use when sharing the page on Facebook or Twitter, then provide the image's full URL here.
social-share | If you don't want to show buttons to share a blog post on social media, use `social-share: false` (this feature is turned on by default). social-share | If you don't want to show buttons to share a blog post on social media, use `social-share: false` (this feature is turned on by default).
use-site-title | If you want to use the site title rather than page title as HTML document title (ie. browser tab title), use `use-site-title: true`. When set, the document title will take the format `Site Title - Site Description` (eg. `My website - A virtual proof that name is awesome!`). By default, it will use `Page Title` if it exists, or `Site Title` otherwise. use-site-title | If you want to use the site title rather than page title as HTML document title (ie. browser tab title), use `use-site-title: true`. When set, the document title will take the format `Site Title - Site Description` (eg. `My website - A virtual proof that name is awesome!`). By default, it will use `Page Title` if it exists, or `Site Title` otherwise.
language | A HTML language code to be set on &lt;html&gt; element (see [W3Schools website](https://www.w3schools.com/tags/ref_language_codes.asp) for more on this topic). Also, language can be set site-wide in `_config.yml`.
layout | What type of page this is (default is `post` for blog posts and `page` for other pages. You can use `minimal` if you don't want a header and footer) layout | What type of page this is (default is `post` for blog posts and `page` for other pages. You can use `minimal` if you don't want a header and footer)
js | List of local JavaScript files to include in the page (eg. `/js/mypage.js`) js | List of local JavaScript files to include in the page (eg. `/js/mypage.js`)
ext-js | List of external JavaScript files to include in the page (eg. `//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js`). External JavaScript files that support [Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be specified using the `href` and `sri` parameters eg.<br/>`href: "//code.jquery.com/jquery-3.1.1.min.js"`<br/>`sri: "sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="` ext-js | List of external JavaScript files to include in the page (eg. `//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js`). External JavaScript files that support [Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be specified using the `href` and `sri` parameters eg.<br/>`href: "//code.jquery.com/jquery-3.1.1.min.js"`<br/>`sri: "sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="`

View File

@ -15,7 +15,7 @@ common-js:
--- ---
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ page.language | default: site.language | default: 'en' }}">
<!-- Beautiful Jekyll | MIT license | Copyright Dean Attali 2016 --> <!-- Beautiful Jekyll | MIT license | Copyright Dean Attali 2016 -->
{% include head.html %} {% include head.html %}

View File

@ -8,7 +8,7 @@ common-js:
--- ---
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ page.language | default: site.language | default: 'en' }}">
{% include head.html %} {% include head.html %}