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:41:53 +00:00
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
2010-01-19 15:23:37 +00:00
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-20 16:00:39 +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" >
2010-04-27 23:00:16 +00:00
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" / >
< % t=tags %>
< % if t.length > 0 %>
< meta name = "keywords" content = "<%= t %>" >
< % end %>
< link rel = "shortcut icon" type = "image/x-icon" href = "/Scratch/img/favicon.ico" / >
2010-07-31 12:36:46 +00:00
< link rel = "stylesheet" type = "text/css" href = "/Scratch/assets/css/main.css" / >
2010-04-27 23:00:16 +00:00
< link rel = "alternate" type = "application/rss+xml" title = "RSS" href = "http://feeds.feedburner.com/yannespositocom<%= language %>" / >
2010-07-31 12:36:46 +00:00
< %
2010-04-27 23:00:16 +00:00
languages.each do |lang|
2010-02-19 10:26:31 +00:00
item_for_lang=item_of_language(lang)
if not item_for_lang.nil? %>
2010-04-27 23:00:16 +00:00
< link rel = "alternate" lang = "<%= lang %>" xml:lang = "<%= lang %>" title = "<%= item_for_lang[:title] %>" type = "text/html" hreflang = "<%= lang %>" href = "<%= item_for_lang.reps[0].path %>" / > < %
2010-02-19 10:26:31 +00:00
end
2010-04-27 23:00:16 +00:00
end %>
2010-10-03 20:39:03 +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/index.js" > < / script >
2010-04-27 23:00:16 +00:00
< title > < %= @item[:title] %>< / title >
< / head >
< body lang = "<%= language %>" >
2010-10-03 20:39:03 +00:00
< script type = "text/javascript" > / / < ! [ C D A T A [
document.write('< div id = "blackpage" > < img src = "/Scratch/img/loading.gif" alt = "<%= tradOf(:loading) %>" / > < / div > ');
// ]]>
< / script >
2010-01-19 15:23:37 +00:00
2010-04-27 23:00:16 +00:00
< div id = "content" >
< div id = "entete" >
2010-06-25 14:39:33 +00:00
< div id = "choix" >
2010-04-27 23:00:16 +00:00
< div id = "choixrss" >
2010-06-25 14:39:33 +00:00
< a id = "rss" href = "http://feeds.feedburner.com/yannespositocom<%= language %>" >
< %= tradOf(:subscribe) %>
< / a >
2010-04-16 09:18:57 +00:00
< / div >
2010-06-25 14:39:33 +00:00
< div id = "choixlang" >
< %= languages.map do |l|
dest=@item_rep.path.sub(/^\/Scratch\/..\//, %{/Scratch/#{l}/})
if @item_rep.path != dest
%{< a href = "#{dest}" onclick = "setLanguage('#{l}')" > #{ tradOfKeywordIn(:switchTo,l)}< / a > }
else
nil
end
2010-07-08 14:15:46 +00:00
end.join() %>
2010-06-25 14:39:33 +00:00
< / div >
2010-04-27 23:00:16 +00:00
< div id = "liens" >
< %= generateMenu %>
< / div >
2010-01-20 15:20:44 +00:00
< / div >
2010-09-24 14:29:59 +00:00
< / div >
2010-09-27 14:50:32 +00:00
< img src = "/Scratch/img/presentation.png" alt = "Presentation drawing" / >
2010-04-27 23:00:16 +00:00
< div id = "titre" >
< h1 >
< %= @item[:title] %>
< / h1 >
< % unless @item[:subtitle].nil? %>
< h2 >
< %= @item[:subtitle] %>
< / h2 >
< % end %>
< / div >
2009-10-09 12:27:31 +00:00
2010-04-27 23:00:16 +00:00
< div class = "flush" > < / div >
2009-10-09 12:27:31 +00:00
2010-04-27 23:00:16 +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 >
2010-04-27 23:00:16 +00:00
< % end %>
2009-10-12 15:36:17 +00:00
2010-04-27 23:00:16 +00:00
< %= generateSubMenu %>
< div class = "flush" > < / div >
2010-07-31 12:36:46 +00:00
2010-04-27 23:00:16 +00:00
< div id = "afterheader" >
< div class = "corps" >
< %= yield %>
2010-05-05 18:53:54 +00:00
< div class = "return" > < a href = "#entete" onclick = "fastShowMenu()" > ↑ < / a > < / div >
2010-04-27 23:00:16 +00:00
< / div >
2009-10-09 12:27:31 +00:00
< div id = "bottom" >
2010-07-31 21:49:11 +00:00
< div >
< %=tradOf(:copyright) %>
< / div >
< div id = "lastmod" >
2010-09-02 08:20:45 +00:00
< %=tradOf(:last_modified)%>: < %= gitmtime.strftime(@config[:dateFormat][language.intern]) %>
2010-07-31 21:49:11 +00:00
< / div >
2009-10-09 12:27:31 +00:00
< div >
2010-01-20 15:20:44 +00:00
< %= tradOf(:entirely_done_with) %>
2010-04-27 23:00:16 +00:00
< a href = "http://www.vim.org" > Vim< / a >
2010-01-20 15:20:44 +00:00
< %= tradOf(:and) %>
2010-04-27 23:00:16 +00:00
< a href = "http://nanoc.stoneship.org" > nanoc< / a >
2009-10-09 12:27:31 +00:00
< / div >
< div >
2010-04-27 23:00:16 +00:00
< a href = "/Scratch/<%=language%>/validation/" > Validation< / a >
< 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/<%=language%>/blog/feed/feed.xml" > [rss]< / a >
2009-10-09 12:27:31 +00:00
< / div >
< / div >
< div class = "clear" > < / div >
< / div >
2010-04-27 23:00:16 +00:00
< / body >
2009-10-09 12:27:31 +00:00
< / html >