X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6909f339ceb1f147fb185fe92e1b2aebedcc5d45..fb2e00014da40d677f79b6b07e05ae821e7e10e5:/doc/ikiwiki/directive/meta/discussion.mdwn?ds=sidebyside diff --git a/doc/ikiwiki/directive/meta/discussion.mdwn b/doc/ikiwiki/directive/meta/discussion.mdwn index 7c24b5e35..5461d2e8e 100644 --- a/doc/ikiwiki/directive/meta/discussion.mdwn +++ b/doc/ikiwiki/directive/meta/discussion.mdwn @@ -1,2 +1,84 @@ Is there any reason the [language attribute](https://en.wikipedia.org/wiki/Meta_element#The_language_attribute) is not supported? --[[LucaCapello]] + +> Attached a patch against the Git repository, working on Debian ikiwiki_3.20100815.9. --[[LucaCapello]] + +[[patch]] + +----- + +
+From 680e57fd384b65e289d92054835687f3d6f3a19d Mon Sep 17 00:00:00 2001 +From: Luca Capello+Date: Sat, 6 Oct 2012 14:11:19 +0200 +Subject: [PATCH] IkiWiki/Plugin/meta.pm: support the language attribute + +--- + IkiWiki/Plugin/meta.pm | 9 +++++++++ + doc/ikiwiki/directive/meta.mdwn | 4 ++++ + 2 files changed, 13 insertions(+) + +diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm +index 421f1dc..1a49f0c 100644 +--- a/IkiWiki/Plugin/meta.pm ++++ b/IkiWiki/Plugin/meta.pm +@@ -102,6 +102,10 @@ sub preprocess (@) { + $pagestate{$page}{meta}{description}=$value; + # fallthrough + } ++ elsif ($key eq 'language') { ++ $pagestate{$page}{meta}{language}=$value; ++ # fallthrough ++ } + elsif ($key eq 'guid') { + $pagestate{$page}{meta}{guid}=$value; + # fallthrough +@@ -279,6 +283,11 @@ sub preprocess (@) { + push @{$metaheaders{$page}}, ''; + } ++ elsif ($key eq 'language') { ++ push @{$metaheaders{$page}}, ++ ''; ++ } + elsif ($key eq 'name') { + push @{$metaheaders{$page}}, scrub(' + +---- + +I guess patching [[/ikiwiki/directive/meta]] to document the fact this attribute is supported would be good. â [[Jon]] + + +---- + ++1 the language attribute works, I see: + + + +The problem is that it does not generate the lang attribute in `` and that's what's required for [hyphenation](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens) so this would be welcome too! + +Also, being able to use the language variable in templates would be very useful for various css tweaks. â [Hugo](https://hroy.eu) + +---- + +When `title` is set, is there a way to get the real `pagename` in templates (so that I can use `title_overridden` to render the pagename, as the last part of the page URL, in breadcrumbs) ? -- [[BBB]]