71 lines
1.9 KiB
Text
71 lines
1.9 KiB
Text
-----
|
|
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"><%= number_of_articles %> latest articles </a> </li>
|
|
<li> <a href="#tagcloud">Tag Cloud </a></li>
|
|
<li> <a href="#archives">Achives </a></li>
|
|
<li> <a href="#two-words-about-the-content">A little remark</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<h2 id="last-articles">
|
|
Last <%= number_of_articles %> 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(%{Read more <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) %>
|