adapt comment.tmpl to html5
authorJoey Hess <joey@kitenet.net>
Sun, 2 May 2010 20:12:08 +0000 (16:12 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 2 May 2010 20:12:08 +0000 (16:12 -0400)
Note that I put comment-header in a <header> despite it being
below the comment. Using a <footer> would be confusing given
the class name. Also, the content is semantically closer to
a header than a footer.

IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/inline.pm
doc/style.css
templates/comment.tmpl

index 02f1d93011f0f3afda8ede7b4c67ddd047b5f438..89560c88b11e803787df08bff66d50836756275c 100644 (file)
@@ -673,6 +673,7 @@ sub previewcomment ($$$) {
        my $template = template("comment.tmpl");
        $template->param(content => $preview);
        $template->param(ctime => displaytime($time, undef, 1));
+       $template->param(html5 => $config{html5});
 
        IkiWiki::run_hooks(pagetemplate => sub {
                shift->(page => $location,
index 2df59f414b026eab4ea4fdcf508b6dd3f58a6ae0..933e30646d51bc22fb377df5d288245008c94b38 100644 (file)
@@ -362,6 +362,7 @@ sub preprocess_inline (@) {
                                $template->param(mtime => displaytime($pagemtime{$page}, $params{timeformat}));
                                $template->param(first => 1) if $page eq $list[0];
                                $template->param(last => 1) if $page eq $list[$#list];
+                               $template->param(html5 => $config{html5});
        
                                if ($actions) {
                                        my $file = $pagesources{$page};
index 69c7f80d8085fdae3d4eacbffa3ab393d49a855a..c857157b614e20b1be0b8e47c9305a3bd4249ed5 100644 (file)
@@ -49,7 +49,7 @@
        border-bottom: 1px solid #000;
 }
 
-div.inlinecontent {
+.inlinecontent {
        margin-top: .4em;
 }
 
index fb76ea00494880863a8973b1942ae11a2e4e5a87..39cba0ff92ad99bc59baecd6b6b7fa34deb76676 100644 (file)
@@ -1,20 +1,20 @@
-<div class="comment" id="<TMPL_VAR NAME=COMMENTID>">
+<TMPL_IF HTML5><article class="comment" id="<TMPL_VAR NAME=COMMENTID>">
+<TMPL_ELSE><div class="comment" id="<TMPL_VAR NAME=COMMENTID>"></TMPL_IF>
 
-<div class="comment-subject">
+<TMPL_IF HTML5><header class="comment-subject"><TMPL_ELSE><div class="comment-subject"></TMPL_IF>
 <TMPL_IF PERMALINK>
 <a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a>
 <TMPL_ELSE>
 <TMPL_VAR TITLE>
 </TMPL_IF>
-</div>
+<TMPL_IF HTML5></header><TMPL_ELSE></div></TMPL_IF>
 
-<div class="inlinecontent">
+<TMPL_IF HTML5><section class="inlinecontent"><TMPL_ELSE><div class="inlinecontent"></TMPL_IF>
 <TMPL_VAR CONTENT>
-</div>
+<TMPL_IF HTML5></section><TMPL_ELSE></div></TMPL_IF>
 
-<div class="comment-header">
+<TMPL_IF HTML5><header class="comment-header"><TMPL_ELSE><div class="comment-header"></TMPL_IF>
 Comment by
-
 <TMPL_IF NAME="COMMENTUSER">
 <TMPL_IF NAME="COMMENTOPENID">
 <span class="author" title="OpenID">
@@ -29,10 +29,10 @@ Comment by
 </TMPL_IF>
 </span>
 </TMPL_IF>
-<TMPL_ELSE><!-- !COMMENTUSER -->
+<TMPL_ELSE>
 <TMPL_IF NAME=COMMENTIP>
 <span class="author" title="Unauthenticated, from <TMPL_VAR NAME=COMMENTIP>">
-<TMPL_ELSE><!-- !COMMENTIP -->
+<TMPL_ELSE>
 <span class="author" title="Unauthenticated, from unknown IP address">
 </TMPL_IF>
 <TMPL_IF NAME="AUTHORURL">
@@ -41,19 +41,18 @@ Comment by
 <TMPL_VAR NAME=AUTHOR>
 </TMPL_IF>
 </span>
-</TMPL_IF><!-- !COMMENTUSER -->
-
+</TMPL_IF>
 &mdash; <TMPL_VAR CTIME>
-</div>
+<TMPL_IF HTML5></header><TMPL_ELSE></div></TMPL_IF>
 
 <TMPL_IF NAME="HAVE_ACTIONS">
-<div class="actions">
+<TMPL_IF HTML5><nav class="actions"><TMPL_ELSE><div class="actions"></TMPL_IF>
 <ul>
 <TMPL_IF NAME="REMOVEURL">
 <li><a href="<TMPL_VAR REMOVEURL>" rel="nofollow">Remove comment</a></li>
 </TMPL_IF>
 </ul>
-</div><!--.actions-->
+<TMPL_IF HTML5></nav><TMPL_ELSE></div></TMPL_IF>
 </TMPL_IF>
 
-</div><!--.comment-->
+<TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF>