ablog icon indicating copy to clipboard operation
ablog copied to clipboard

Markup the article language

Open Marrin opened this issue 2 years ago • 0 comments

Describe the feature

The <html> element has a lang attribute for the whole page/site but the blog post text doesn't have its own attribute. Which is fine if the blog post is in the language of the site, but it may break things if it is not.

For instance my blog is in English for all but one blog post which I marked as German (de) in the .. post:: directive. As Sphinx's basic.css allows the browser to automatically hyphenate text, the wrong rules for hyphenation are used in that German post.

Proposed solution

Extend the <div class="body" role="main"> with a lang attribute with the value given with :language: in the post, at least if it differs from the one in the <html> element.

Marrin avatar Jul 27 '23 14:07 Marrin