You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

71 lines
1.9 KiB

-----
kind: blog
title: Blog
menupriority: 2
noSubMenu: true
-----
<% content_for :js do %>
<script type="text/javascript">
$(document).ready( function(){$('.list').hide();$('#tagcloud a').removeAttr("href")} );
function tagSelected(id) {
$('.list').hide();
$('#'+id).fadeIn();
$('.tag.selected').removeClass('selected');
$('#tag_'+id).addClass('selected');
}
</script>
<% end %>
<%
number_of_articles=5
number_of_char_for_resume=800
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
last_articles = @items.select do |a|
a.reps[0].path =~ /\/#{language}\// && a[:kind] == 'article'
end
last_articles=last_articles.sort { |x,y| y[:created_at] <=> x[:created_at] }[0..(number_of_articles-1)]
%>
<div id="elementblock">
<ul>
<li> <a href="#last-articles">Les <%= number_of_articles %> derniers articles </a></li>
<li> <a href="#tagcloud">Nuage de mots clés </a></li>
<li> <a href="#archives">Achives </a></li>
<li> <a href="#un-petit-mot-sur-le-contenu">Une remarque</a></li>
</ul>
</div>
<h2 id="last-articles">
Les <%= number_of_articles %> derniers articles
</h2>
<% last_articles.each do |a| %>
<article>
<%= calendar_for( a[:created_at], language ) %>
<h1> <%= link_to(a[:title]+%{ <span class="nicer">»</span>}, a) %> </h1>
<div class="content">
<%= repair_html ( excerptize( a.reps[0].compiled_content, {:length => number_of_char_for_resume} ) ) %>
<div class="flush"></div>
<div>
<p>
<%= link_to(%{en lire plus <span class="nicer">»</span>}, a, :class => "small") %>
</p>
</div>
</div>
</article>
<hr/>
<% end %>
<div class="corps">
<h2>Tag Cloud</h2>
<div>
<%= tagCloud %>
</div>
</div>
<h2 id="archives">Archives</h2>
<%= generateBlogSubMenu(language) %>