Allow overriding HTML lang on a per-page basis (#4862)
The W3C [recommends](https://www.w3.org/International/questions/qa-html-language-declarations) to specify language using identifiers as per [RFC 5646](https://tools.ietf.org/html/rfc5646) which uses dashes.
This commit is contained in:
parent
7b6b45055c
commit
b82680b103
@ -11,7 +11,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="{{ include.type | default: 'list' }}__item">
|
<div class="{{ include.type | default: 'list' }}__item">
|
||||||
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
|
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork"{% if post.locale %} lang="{{ post.locale }}"{% endif %}>
|
||||||
{% if include.type == "grid" and teaser %}
|
{% if include.type == "grid" and teaser %}
|
||||||
<div class="archive__item-teaser">
|
<div class="archive__item-teaser">
|
||||||
<img src="{{ teaser | relative_url }}" alt="">
|
<img src="{{ teaser | relative_url }}" alt="">
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
|
<span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if forloop.last %}
|
{% if forloop.last %}
|
||||||
<li class="current">{{ page.title }}</li>
|
<li class="current"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>{{ page.title }}</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% assign i = i | plus: 1 %}
|
{% assign i = i | plus: 1 %}
|
||||||
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||||
|
@ -20,7 +20,7 @@ author_profile: false
|
|||||||
|
|
||||||
<div class="archive">
|
<div class="archive">
|
||||||
{% unless page.header.overlay_color or page.header.overlay_image %}
|
{% unless page.header.overlay_color or page.header.overlay_image %}
|
||||||
<h1 id="page-title" class="page__title">{{ page.title }}</h1>
|
<h1 id="page-title" class="page__title"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>{{ page.title }}</h1>
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
{% for post in page.posts %}
|
{% for post in page.posts %}
|
||||||
{% include archive-single.html %}
|
{% include archive-single.html %}
|
||||||
|
@ -19,7 +19,7 @@ layout: default
|
|||||||
|
|
||||||
<div class="archive">
|
<div class="archive">
|
||||||
{% unless page.header.overlay_color or page.header.overlay_image %}
|
{% unless page.header.overlay_color or page.header.overlay_image %}
|
||||||
<h1 id="page-title" class="page__title">{{ page.title }}</h1>
|
<h1 id="page-title" class="page__title"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>{{ page.title }}</h1>
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
{% include copyright.html %}
|
{% include copyright.html %}
|
||||||
<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
|
<html lang="{{ site.locale | replace: "_", "-" | default: "en" }}" class="no-js">
|
||||||
<head>
|
<head>
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
{% include head/custom.html %}
|
{% include head/custom.html %}
|
||||||
|
@ -17,7 +17,7 @@ layout: default
|
|||||||
|
|
||||||
<div class="archive">
|
<div class="archive">
|
||||||
{% unless page.header.overlay_color or page.header.overlay_image %}
|
{% unless page.header.overlay_color or page.header.overlay_image %}
|
||||||
<h1 id="page-title" class="page__title">{{ page.title }}</h1>
|
<h1 id="page-title" class="page__title"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>{{ page.title }}</h1>
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
@ -21,7 +21,7 @@ layout: default
|
|||||||
<div id="main" role="main">
|
<div id="main" role="main">
|
||||||
{% include sidebar.html %}
|
{% include sidebar.html %}
|
||||||
|
|
||||||
<article class="page" itemscope itemtype="https://schema.org/CreativeWork">
|
<article class="page" itemscope itemtype="https://schema.org/CreativeWork"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>
|
||||||
{% if page.title %}<meta itemprop="headline" content="{{ page.title | replace: '|', '|' | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
{% if page.title %}<meta itemprop="headline" content="{{ page.title | replace: '|', '|' | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
||||||
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
||||||
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
|
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
|
||||||
|
@ -9,7 +9,7 @@ layout: default
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="main" role="main">
|
<div id="main" role="main">
|
||||||
<article class="splash" itemscope itemtype="https://schema.org/CreativeWork">
|
<article class="splash" itemscope itemtype="https://schema.org/CreativeWork"{% if page.locale %} lang="{{ page.locale }}"{% endif %}>
|
||||||
{% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
{% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
||||||
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
{% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
|
||||||
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
|
{% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date_to_xmlschema }}">{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user