Quellcode durchsuchen

Merge pull request #44 from cbarrick/html5

Better HTML 5 semantics
Mark Otto vor 10 Jahren
Ursprung
Commit
53d15bec08
4 geänderte Dateien mit 21 neuen und 19 gelöschten Zeilen
  1. 10 8
      _layouts/default.html
  2. 2 2
      _layouts/page.html
  3. 6 6
      _layouts/post.html
  4. 3 3
      index.html

+ 10 - 8
_layouts/default.html

@@ -6,20 +6,22 @@
   <body>
 
     <div class="container content">
-      <div class="masthead">
+      <header class="masthead">
         <h3 class="masthead-title">
           <a href="{{ site.baseurl }}" title="Home">{{ site.title }}</a>
           <small>{{ site.tagline }}</small>
         </h3>
-      </div>
+      </header>
 
-      {{ content }}
+      <main>
+        {{ content }}
+      </main>
 
-      <div class="footer">
-        <p>
-          &copy; {{ site.time | date: '%Y' }}. All rights reserved.
-        </p>
-      </div>
+      <footer class="footer">
+        <small>
+          &copy; <time datetime="{{ site.time | date_to_xmlschema }}">{{ site.time | date: '%Y' }}</time>. All rights reserved.
+        </small>
+      </footer>
     </div>
 
   </body>

+ 2 - 2
_layouts/page.html

@@ -2,7 +2,7 @@
 layout: default
 ---
 
-<div class="page">
+<article class="page">
   <h1 class="page-title">{{ page.title }}</h1>
   {{ content }}
-</div>
+</article>

+ 6 - 6
_layouts/post.html

@@ -2,13 +2,13 @@
 layout: default
 ---
 
-<div class="post">
+<article class="post">
   <h1 class="post-title">{{ page.title }}</h1>
-  <span class="post-date">{{ page.date | date_to_string }}</span>
+  <time datetime="{{ page.date | date_to_xmlschema }}" class="page-date">{{ page.date | date_to_string }}</time>
   {{ content }}
-</div>
+</article>
 
-<div class="related">
+<aside class="related">
   <h2>Related Posts</h2>
   <ul class="related-posts">
     {% for post in site.related_posts limit:3 %}
@@ -16,10 +16,10 @@ layout: default
         <h3>
           <a href="{{ site.baseurl }}{{ post.url }}">
             {{ post.title }}
-            <small>{{ post.date | date_to_string }}</small>
+            <small><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time></small>
           </a>
         </h3>
       </li>
     {% endfor %}
   </ul>
-</div>
+</aside>

+ 3 - 3
index.html

@@ -5,17 +5,17 @@ title: Home
 
 <div class="posts">
   {% for post in paginator.posts %}
-  <div class="post">
+  <article class="post">
     <h1 class="post-title">
       <a href="{{ post.url }}">
         {{ post.title }}
       </a>
     </h1>
 
-    <span class="post-date">{{ post.date | date_to_string }}</span>
+    <time datetime="{{ post.date | date_to_xmlschema }}" class="post-date">{{ post.date | date_to_string }}</time>
 
     {{ post.content }}
-  </div>
+  </article>
   {% endfor %}
 </div>