Merge pull request #94 from dapenggao/patch-2
[blog] / _layouts / post.html
index e6ce4621bf9b41e141d14527171daa21199595f3..ec63afc10d770bfaf47daee2c3d2231ce39c8c05 100644 (file)
@@ -4,17 +4,18 @@ layout: default
 
 <article class="post">
   <h1 class="post-title">{{ page.title }}</h1>
-  <time datetime="{{ page.date | date_to_xmlschema }}" class="page-date">{{ page.date | date_to_string }}</time>
+  <time datetime="{{ page.date | date_to_xmlschema }}" class="post-date">{{ page.date | date_to_string }}</time>
   {{ content }}
 </article>
 
+{% if site.related_posts != empty %}
 <aside class="related">
   <h2>Related Posts</h2>
   <ul class="related-posts">
     {% for post in site.related_posts limit:3 %}
       <li>
         <h3>
-          <a href="{{ site.baseurl }}/{{ post.url }}">
+          <a href="{{ site.baseurl }}{{ post.url }}">
             {{ post.title }}
             <small><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time></small>
           </a>
@@ -23,3 +24,4 @@ layout: default
     {% endfor %}
   </ul>
 </aside>
+{% endif %}