Better naming "item_intro" (instead of article_intro)
This commit is contained in:
parent
75d3a20cc3
commit
220866997f
7 changed files with 32 additions and 26 deletions
|
|
@ -84,7 +84,7 @@ kind: empty
|
|||
<% latest_articles(5).each do |item| %>
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<%= render 'article_intro', :article => item, :extended => true %>
|
||||
<%= render 'item_intro', :item => item, :extended => true %>
|
||||
<p>
|
||||
<a itemprop="blogPost" href="<%= item.path() %>">Zum Artikel</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="row">
|
||||
<% latest_articles.select { |a| a[:created_at].year == @year }.each do |item| %>
|
||||
<div class="span8">
|
||||
<%= render 'article_intro', :article => item, :extended => true %>
|
||||
<%= render 'item_intro', :item => item, :extended => true %>
|
||||
<p>
|
||||
<a itemprop="blogPost" href="<%= item.path() %>">Zum Artikel</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,14 +6,12 @@
|
|||
<% if item.attributes.has_key?(:subtitle) then %>
|
||||
<br/><small><%= item[:subtitle] %></small>
|
||||
<% end %></h1>
|
||||
<ul class="unstyled">
|
||||
<li><i class="icon-calendar"></i> <time itemprop="dateCreated" datetime="<%= @item[:created_at].strftime("%Y-%m-%d") %>"><%= @item[:created_at].strftime("%d.%m.%Y") %></time></li>
|
||||
<% if @item[:author] %><li><i class="icon-pencil"></i> @item[:author]</li><% end %>
|
||||
<% if @item[:refers_to] %><li><i class="icon-cogs"></i> <a href="<%= @items[sanitize_path(@item[:refers_to])].path() %>"><%= @items[sanitize_path(@item[:refers_to])][:title] %></a></li><% end %>
|
||||
<li><i class="icon-bookmark"></i> <a itemprop="url" href="<%= item.path() %>">Permalink</a></li>
|
||||
</ul>
|
||||
<p>
|
||||
<i class="icon-calendar"></i> <time itemprop="dateCreated" datetime="<%= @item[:created_at].strftime("%Y-%m-%d") %>"><%= @item[:created_at].strftime("%d.%m.%Y") %></time>
|
||||
<% if @item[:author] %>- <i class="icon-pencil"></i> @item[:author]<% end %>
|
||||
<% if @item[:refers_to] %>- <i class="icon-cogs"></i> <a href="<%= @items[sanitize_path(@item[:refers_to])].path() %>"><%= @items[sanitize_path(@item[:refers_to])][:title] %></a><% end %>
|
||||
- <i class="icon-bookmark"></i> <a itemprop="url" href="<%= item.path() %>">Permalink</a>
|
||||
</header>
|
||||
<div class="clearfix"></div>
|
||||
<p>
|
||||
<section>
|
||||
<%= yield %>
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
<article>
|
||||
<header><% if !@h then @h='h1' end %>
|
||||
<<%= @h %>><a href="<%= @article.path() %>"><%= @article[:title]%></a>
|
||||
<% if @article.attributes.has_key?(:subtitle) then %>
|
||||
<br/><small><%= @article[:subtitle] %></small>
|
||||
<% end %></<%= @h %>>
|
||||
</header>
|
||||
<div class="clearfix"></div>
|
||||
<section>
|
||||
<% if @extended then %>
|
||||
<%= article_summary(@article) %>
|
||||
<% end %>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
23
layouts/item_intro.erb
Normal file
23
layouts/item_intro.erb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<article>
|
||||
<header><% if !@h then @h='h1' end %>
|
||||
<<%= @h %>><a href="<%= @item.path() %>"><%= @item[:title]%></a>
|
||||
<% if @item.attributes.has_key?(:subtitle) then %>
|
||||
<br/><small><%= @item[:subtitle] %></small>
|
||||
<% end %></<%= @h %>>
|
||||
<%if @item[:kind]=='article' %>
|
||||
<p>
|
||||
<ul class="unstyled inline">
|
||||
<li><i class="icon-calendar"></i> <time itemprop="dateCreated" datetime="<%= @item[:created_at].strftime("%Y-%m-%d") %>"><%= @item[:created_at].strftime("%d.%m.%Y") %></time></li>
|
||||
<% if @item[:author] %><li><i class="icon-pencil"></i> @item[:author]</li><% end %>
|
||||
<% if @item[:refers_to] %><li><i class="icon-cogs"></i> <a href="<%= @items[sanitize_path(@item[:refers_to])].path() %>"><%= @items[sanitize_path(@item[:refers_to])][:title] %></a></li><% end %>
|
||||
<li><i class="icon-bookmark"></i> <a itemprop="url" href="<%= item.path() %>">Permalink</a></li>
|
||||
<% end %>
|
||||
</header>
|
||||
<div class="clearfix"></div>
|
||||
<section>
|
||||
<% if @extended then %>
|
||||
<%= article_summary(@item) %>
|
||||
<% end %>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
</div>
|
||||
<% latest_articles_referred_to(item.identifier,5).each do |item| %>
|
||||
<div class="span8">
|
||||
<%= render 'article_intro', :article => item, :extended => true %>
|
||||
<%= render 'item_intro', :item => item, :extended => true %>
|
||||
<p>
|
||||
<a itemprop="blogPost" href="<%= item.path() %>">Zum Artikel</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<% @projects.each do |prj| %>
|
||||
<div class="span8">
|
||||
<%= render 'article_intro', :article => prj, :h => 'h2', :extended => @extended %>
|
||||
<%= render 'item_intro', :item => prj, :h => 'h2', :extended => @extended %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue