scratch/content/html/en/index.erb
2010-04-16 16:31:56 +02:00

27 lines
946 B
Text

-----
title: Welcome
noSubMenu: true
-----
<%
number_of_articles=5
number_of_char_for_resume=800
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
last_articles = articles.select do |a|
a.reps[0].path =~ /\/#{language}\//
end
last_articles=last_articles.sort { |x,y| y[:created_at] <=> x[:created_at] }[0..(number_of_articles-1)]
%>
<p>Welcome on my personnal website.</p>
<p>Here are my <%= number_of_articles %> last posts begining<sup>&dagger;</sup>.</p>
<hr/>
<p class="small">&dagger; approximatively the <%= number_of_char_for_resume %> first characters.</p>
<% last_articles.each do |a| %>
</div>
<h1><span class="date"><%= a[:created_at].strftime( @config[:dateFormat][language.intern] ) %></span> <%= link_to(a[:title], a) %></h1>
<div class="corps">
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %>
<% end %>