Skip to content

Commit

Permalink
Adds hentry microformat support to Publify default theme.
Browse files Browse the repository at this point in the history
See issue publify#219 for more information.
  • Loading branch information
Frédéric de Villamil committed Sep 4, 2013
1 parent 5205937 commit 2671fd7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 18 deletions.
13 changes: 8 additions & 5 deletions themes/bootstrap/views/articles/_article.html.erb
@@ -1,8 +1,11 @@
<div id="article-<%= article.id %>">
<h2 class='page-header'><%= (controller.controller_name == 'redirect') ? article.title : link_to_permalink(article,article.title) %></h2>
<%= render 'articles/protected_article_content', { :article => article } %>
<%= render 'articles/meta', article: article %>
<article id="article-<%= article.id %>" class='h-entry hentry h-as-note'>
<h2 class='page-header p-name entry-title'><%= (controller.controller_name == 'redirect') ? article.title : link_to_permalink(article,article.title) %></h2>
<div class='e-content entry-content article'>
<%= render 'articles/protected_article_content', { :article => article } %>
<%= render 'articles/meta', article: article %>
</div>

<div class='comments'>
<%= render 'articles/comment_counter', article: article %>
</div>
</div>
</article>
1 change: 1 addition & 0 deletions themes/bootstrap/views/articles/_meta.html.erb
Expand Up @@ -2,6 +2,7 @@
<p><small>
<%= _("Published on") %>
<%= display_date_and_time(article.published_at) %>
<%= _("by") %> <span class='p-author h-card'><%= article.user.nickname %></span>
<%= category_links(article, _("under")) unless article.categories.empty? %>.
<%= tag_links(article) unless article.tags.empty? %>
</small></p>
Expand Down
4 changes: 3 additions & 1 deletion themes/bootstrap/views/articles/index.html.erb
@@ -1,4 +1,6 @@
<%= render @articles %>
<div class='hfeed'>
<%= render @articles %>
</div>
<div class='paginate'>
<%= paginate(@articles)%>
</div>
12 changes: 7 additions & 5 deletions themes/bootstrap/views/categories/_article.html.erb
@@ -1,8 +1,10 @@
<div id="article-<%= article.id %>">
<h2><%= link_to_permalink(article, article.title) %></h2>
<%= render 'articles/protected_article_content', { :article => article } %>
<%= render 'articles/meta', article: article %>
<article id="article-<%= article.id %>" class='h-entry hentry h-as-note'>
<h2 class='page-header p-name entry-title'><%= link_to_permalink(article, article.title) %></h2>
<div class='e-content entry-content article'>
<%= render 'articles/protected_article_content', { :article => article } %>
<%= render 'articles/meta', article: article %>
</div>
<div class='comments'>
<%= render 'articles/comment_counter', article: article %>
</div>
</div>
</article0>
4 changes: 3 additions & 1 deletion themes/bootstrap/views/categories/show.html.erb
@@ -1,5 +1,7 @@
<h1 class='page-header'><%= link_to @grouping.name, @grouping.permalink_url %></h1>
<%= render :partial => 'article', :collection => @articles %>
<div class='hfeed'>
<%= render :partial => 'article', :collection => @articles %>
</div>
<div id='paginate'>
<%= paginate @articles, { :previous_label => _('Previous'), :next_label => _('Next') } %>
</div>
12 changes: 7 additions & 5 deletions themes/bootstrap/views/tags/_article.html.erb
@@ -1,8 +1,10 @@
<div id="article-<%= article.id %>">
<h2 class='page-header'><%= link_to_permalink(article,article.title) %></h2>
<%= render 'articles/protected_article_content', { :article => article } %>
<%= render 'articles/meta', article: article %>
<article id="article-<%= article.id %>" class='h-entry hentry h-as-note'>
<h2 class='page-header p-name entry-title'><%= link_to_permalink(article,article.title) %></h2>
<div class='e-content entry-content article'>
<%= render 'articles/protected_article_content', { :article => article } %>
<%= render 'articles/meta', article: article %>
</div>
<div class='comments'>
<%= render 'articles/comment_counter', article: article %>
</div>
</div>
</article>
5 changes: 4 additions & 1 deletion themes/bootstrap/views/tags/show.html.erb
@@ -1,4 +1,7 @@
<%= render :partial => 'article', :collection => @articles %>
<div class='hfeed'>
<%= render :partial => 'article', :collection => @articles %>
</div>

<div id='paginate'>
<%= paginate @articles, { :previous_label => _('Previous'), :next_label => _('Next') } %>
</div>

0 comments on commit 2671fd7

Please sign in to comment.