2009-10-09 12:27:31 +00:00
-----
-----
< %
2009-10-12 09:22:31 +00:00
# -- init variables --
class LocalConf
2010-01-19 15:23:37 +00:00
attr_accessor :blog, :article, :languages, :language, :indent
2009-10-12 15:36:17 +00:00
def to_s
instance_variables.map{ |x|
if instance_variable_get(x).class == Array
%{#{x.intern}= [#{instance_variable_get(x).join(', ')}]}
else
%{#{x.intern}= #{instance_variable_get(x)}}
end
}
end
2009-10-09 12:27:31 +00:00
end
2009-10-12 09:22:31 +00:00
conf=LocalConf.new
2010-01-19 15:23:37 +00:00
language=@item_rep.path
language.sub!(/\/Scratch\//,'').sub!(/\/.*$/,'')
conf.language=language
2009-10-12 09:22:31 +00:00
# the current item is an article
2010-01-19 15:23:37 +00:00
article=( ( not @item[:kind].nil? ) & & @item[:kind] == 'article' )
2009-10-12 09:22:31 +00:00
conf.article=article
2010-01-19 15:23:37 +00:00
2009-10-12 09:22:31 +00:00
# the current item is a blog entry page
2010-01-19 15:23:37 +00:00
blog=( ( not @item[:kind].nil? ) & & @item[:kind] == 'blog' )
2009-10-12 09:22:31 +00:00
conf.blog=blog
2010-01-19 15:23:37 +00:00
2009-10-12 09:22:31 +00:00
# all supported languages
languages=@config[:languages]
conf.languages=languages
2009-10-12 15:36:17 +00:00
self.instance_variable_set(:@conf, conf)
2009-10-12 09:22:31 +00:00
2010-01-19 15:23:37 +00:00
puts '--- conf ---'
puts conf.to_s
2009-10-12 09:22:31 +00:00
2009-10-12 15:36:17 +00:00
%><?xml version="1.0" encoding="utf-8"?>
2009-10-09 12:27:31 +00:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "fr" xml:lang = "fr" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" / >
< link rel = "shortcut icon" type = "image/x-icon" href = "/Scratch/img/favicon.ico" / >
< link rel = "stylesheet" type = "text/css" href = "/Scratch/css/twilight.css" / >
2010-01-19 15:23:37 +00:00
< link rel = "stylesheet" type = "text/css" href = "/Scratch/css/layout.css" / >
2010-01-01 21:07:55 +00:00
< link rel = "stylesheet" type = "text/css" href = "/Scratch/css/shadows.css" / >
2010-01-19 15:23:37 +00:00
< link rel = "stylesheet" type = "text/css" href = "/Scratch/css/gen.css" / >
< link rel = "alternate" type = "application/rss+xml" title = "RSS" href = "http://feeds.feedburner.com/yannespositocom<%= language %>" >
2009-10-09 12:27:31 +00:00
< link rel = "stylesheet" type = "text/css" href = "/Scratch/css/js.css" / >
2010-01-19 15:23:37 +00:00
< % @conf.languages.collect do |lang| %>
< link rel = "alternate" lang = "<%= lang %>" xml:lang = "<%= lang %>" title = "<%= item_of_language(lang)[:title] %>" type = "text/html" hreflang = "<%= lang %>" href = "<%= item_of_language(lang)[:path] %>" / >
< % end %>
2009-10-09 12:27:31 +00:00
< script type = "text/javascript" src = "/Scratch/js/jquery-1.3.1.min.js" > < / script >
< script type = "text/javascript" src = "/Scratch/js/jquery.cookie.js" > < / script >
< script type = "text/javascript" src = "/Scratch/js/jquery.ga.js" > < / script >
< script type = "text/javascript" src = "/Scratch/js/index.js" > < / script >
< noscript >
2010-01-19 15:23:37 +00:00
< link rel = "stylesheet" type = "text/css" href = "/Scratch/css/nojs.css" / >
2009-10-09 12:27:31 +00:00
< / noscript >
2010-01-19 15:23:37 +00:00
< title > < %= @item[:title] %>< / title >
< / head >
< body lang = "<%= language %>" >
< script type = "text/javascript" >
document.write('< div id = "blackpage" > < p > < %= tradOf(:loading) %>< / p > < img src = "/Scratch/img/loading.gif" alt = "loading logo" / > < / div > ');
< / script >
2010-01-01 21:07:55 +00:00
< div id = "entete" >
< div id = "rss" >
2010-01-19 15:23:37 +00:00
< span >
2010-01-01 21:07:55 +00:00
< a href = "http://feeds.feedburner.com/yannespositocom<%= language %>" >
< img src = "/Scratch/img/menu/rss-128.png" alt = "rss" height = "32" / >
< / a >
< sup >
< a href = "/Scratch/multi/rss" > < %= tradOf('whatsthis') %>< / a >
< / sup >
< / span >
< / div >
< div id = "choix" >
< %= puts %{tradOf(:langue)} %>
2010-01-19 15:23:37 +00:00
< div id = "choixlang" >
< ul >
< % languages.each do |l| %>
< li > < %= l %>< / li >
< % end %>
< / ul >
< / div >
2010-01-01 21:07:55 +00:00
< / div >
< div id = "liens" >
< % if article %>
2010-01-19 15:23:37 +00:00
< %= puts %{generateMenuForBlog} %>
2010-01-01 21:07:55 +00:00
< % else %>
2010-01-19 15:23:37 +00:00
< %= puts %{generateMenu} %>
2010-01-01 21:07:55 +00:00
< % end %>
< / div >
< / div >
< div id = "content" >
< div id = "titre" >
< h1 >
2010-01-19 15:23:37 +00:00
< %= @item[:title] %>
2010-01-01 21:07:55 +00:00
< / h1 >
2010-01-19 15:23:37 +00:00
< % unless @item[:subtitle].nil? %>
2009-10-09 12:27:31 +00:00
< h2 >
2010-01-19 15:23:37 +00:00
< %= @item[:subtitle] %>
2009-10-09 12:27:31 +00:00
< / h2 >
< % end %>
< / div >
< div class = "flush" > < / div >
2009-10-12 15:36:17 +00:00
< % if @item[:content_for_summary] %>
2010-01-01 21:07:55 +00:00
< div class = "corps summary" >
2009-10-12 15:36:17 +00:00
< % @item[:content_for_summary] %>
< / div >
< % end %>
2010-01-19 15:23:37 +00:00
< %= puts %{generateSubMenuFor} %>
2009-10-09 12:27:31 +00:00
< div class = "flush" > < / div >
2009-10-09 14:32:50 +00:00
< %= puts %{generateLanguageOnlyTag} %>
2009-10-09 12:27:31 +00:00
< div id = "afterheader" >
< div class = "corps" >
2009-10-09 14:32:50 +00:00
< %= yield %>
2009-10-09 12:27:31 +00:00
< / div >
2010-01-19 15:23:37 +00:00
< % if article %>
< % if depthOf(@item) == 3 %>
< div class = "navigation" >
< %= previousFor(@item) %>
< %= nextFor(@item) %>
< / div >
< div class = "flush" > < / div >
< % end %>
2009-10-09 12:27:31 +00:00
2010-01-19 15:23:37 +00:00
< div class = "corps" id = "comment" >
< h2 > < %= tradOf(:comment) %>< / h2 >
< %= generateIntenseDebateThread %>
< / div >
2009-10-09 12:27:31 +00:00
< % end %>
< div id = "bottom" >
< div >
en:Entirely done with::
fr:Site entièrement réalisé avec::
< a href = "http://www.vim.org" > Vim< / a >
fr:et::en:and::
< a href = "http://nanoc.stoneship.org" > nanoc< / a >
< / div >
< div >
2009-10-09 14:32:50 +00:00
< % puts %{validationPage = @items.each{ |p| p.path == '/Scratch/multi/validation/' } } %>
< %= puts %{span_multi_link_to_unless_current( {:en => "Validation: ", :fr => "Validation : "}, validationPage)} %>
2009-10-09 12:27:31 +00:00
< a href = "http://validator.w3.org/check?uri=referer" > [xhtml] < / a >
.
< a href = "http://jigsaw.w3.org/css-validator/check/referer?profile=css3" > [css] < / a >
.
< a href = "http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/en/blog/feed/feed.xml" class = "en" > [rss]< / a >
< a href = "http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/fr/blog/feed/feed.xml" class = "fr" > [rss]< / a >
< / div >
2010-01-01 21:07:55 +00:00
< div >
< en > < a href = "http://creativecommons.org/licenses/by-sa/2.5/deed.en" > Copyright©< / a > < / en >
< fr > < a href = "http://creativecommons.org/licenses/by-sa/2.5/deed.fr" > Droits de reproduction ©< / a > < / fr >
< / div >
2009-10-09 12:27:31 +00:00
< div id = "lastmod" >
2009-10-09 14:32:50 +00:00
< en > Last modified: < %= @item.mtime.strftime("%m/%d/%Y") %> < / en >
< fr > dernière modification: < %= @item.mtime.strftime("%d/%m/%Y") %> < / fr >
2009-10-09 12:27:31 +00:00
< / div >
< / div >
< div class = "clear" > < / div >
< / div >
< / div >
< / body >
< / html >