1 Is there any reason the [language attribute](https://en.wikipedia.org/wiki/Meta_element#The_language_attribute) is not supported?
4 > Attached a patch against the Git repository, working on Debian ikiwiki_3.20100815.9. --[[LucaCapello]]
11 From 680e57fd384b65e289d92054835687f3d6f3a19d Mon Sep 17 00:00:00 2001
12 From: Luca Capello <luca@pca.it>
13 Date: Sat, 6 Oct 2012 14:11:19 +0200
14 Subject: [PATCH] IkiWiki/Plugin/meta.pm: support the language attribute
17 IkiWiki/Plugin/meta.pm | 9 +++++++++
18 doc/ikiwiki/directive/meta.mdwn | 4 ++++
19 2 files changed, 13 insertions(+)
21 diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
22 index 421f1dc..1a49f0c 100644
23 --- a/IkiWiki/Plugin/meta.pm
24 +++ b/IkiWiki/Plugin/meta.pm
25 @@ -102,6 +102,10 @@ sub preprocess (@) {
26 $pagestate{$page}{meta}{description}=$value;
29 + elsif ($key eq 'language') {
30 + $pagestate{$page}{meta}{language}=$value;
33 elsif ($key eq 'guid') {
34 $pagestate{$page}{meta}{guid}=$value;
36 @@ -279,6 +283,11 @@ sub preprocess (@) {
37 push @{$metaheaders{$page}}, '<meta name="'.$key.
38 '" content="'.encode_entities($value).'" />';
40 + elsif ($key eq 'language') {
41 + push @{$metaheaders{$page}},
42 + '<meta http-equiv="Content-Language" content="'.
43 + encode_entities($value).'" />';
45 elsif ($key eq 'name') {
46 push @{$metaheaders{$page}}, scrub('<meta name="'.
47 encode_entities($value).
48 diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn
49 index 984f685..b82fa58 100644
50 --- a/doc/ikiwiki/directive/meta.mdwn
51 +++ b/doc/ikiwiki/directive/meta.mdwn
52 @@ -59,6 +59,10 @@ Supported fields:
53 Specifies a short description for the page. This will be put in
54 the html header, and can also be displayed by eg, the [[map]] directive.
58 + Specifies the natural language for the page, for example, "en".
62 Specifies keywords summarizing the contents of the page. This
69 I guess patching [[/ikiwiki/directive/meta]] to document the fact this attribute is supported would be good. — [[Jon]]
74 +1 the language attribute works, I see:
76 <meta name="language" content="en" />
78 The problem is that it does not generate the lang attribute in `<html>` and that's what's required for [hyphenation](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens) so this would be welcome too!
80 Also, being able to use the language variable in templates would be very useful for various css tweaks. — [Hugo](https://hroy.eu)