Better init file

This commit is contained in:
Yann Esposito (Yogsototh) 2010-12-01 17:36:28 +01:00
parent a43794f540
commit 4a2367e791
10 changed files with 184 additions and 31 deletions

2
.gitignore vendored
View file

@ -6,6 +6,8 @@ output/Scratch/fr
output/Scratch/en
output/Scratch/assets
output/Scratch/sitemap.xml
output/index.html
tmp/
recupen.pl
recupfr.pl
.sass-cache

24
Rules
View file

@ -16,23 +16,6 @@ end
route '/css/*' do
'/Scratch/assets' + item.identifier.chop + '.css'
end
# compile '/css/*', :rep => :mozilla do
# filter :mozilla
# filter :sass
# filter :rainpress
# end
# route '/css/*', :rep => :mozilla do
# '/Scratch/assets' + item.identifier.chop + '_mozilla.css'
# end
# compile '/css/*', :rep => :webkit do
# filter :webkit
# filter :sass
# filter :rainpress
# end
# route '/css/*', :rep => :webkit do
# '/Scratch/assets' + item.identifier.chop + '_webkit.css'
# end
compile '/img/*' do
end
route '/img/*' do
@ -52,6 +35,13 @@ route '/js/*' do
'/Scratch/assets' + item.identifier.chop + '.js'
end
compile '/html' do
filter :erb
layout 'default' unless item[:layout] == "none"
end
route '/html' do
'/index.html'
end
compile '/html/*' do
# item[:extension] returns 'html.erb' for multi-dotted filename

10
config.rb Normal file
View file

@ -0,0 +1,10 @@
http_path = "/"
project_path = "."
sass_dir = "compass"
css_dir = "output/Scratch/assets/css"
images_dir = "output/Scratch/assets/img"
# wehn using SCSS:
sass_options = {
:syntax => :scss
}

View file

@ -5,8 +5,12 @@ data_sources:
type: filesystem_unified
output_dir: output
ultraviolet_theme: "twilight"
webprefix: "/Scratch"
base_url: "http://yannesposito.com"
author_uri: "http://yannesposito.com"
rss_uri:
fr: "http://feeds.feedburner.com/yannespositocomfr"
en: "http://feeds.feedburner.com/yannespositocomen"
# les langues
languages:

138
content/html/index.erb Normal file
View file

@ -0,0 +1,138 @@
---
title: Yann Esposito
noSubMenu: true
no_entete: true
---
<% content_for :title do %>
<span style="font-weight: normal; font-size: 2.5em; margin-top: 0; line-height: 1ex">
<span style="letter-spacing:-.20em">Ya</span><span style="display:inline-block; width:.1em;"></span><span style="letter-spacing: -.12em">nn</span>
<span style="letter-spacing: -.10em">Esposito</span>
</span>
<% end %>
<% content_for :subtitle do %>
<span style="letter-spacing: 2.7em; color: #111;">Yogsototh</span>
<% end %>
<div class="languageLabel"><i>English</i></div>
<div class="flush"></div>
<div class="block left">
<h3>
<a href="/Scratch/en/" onclick="setLanguage('en')">
Blog
<span class="nicer">»</span>
</a>
</h3>
<p>
Computer, Philosophy <i>&amp;</i> Life.
</p>
</div>
<div class="block left">
<h3>
<a href="/Scratch/en/softwares" onclick="setLanguage('en')">
Softwares
<span class="nicer">»</span>
</a>
</h3>
<p>
Password Manager,
Screensavers <i>&amp;</i>
Scientific Applications.
</p>
</div>
<div class="block right">
<h3>
<a href="/Scratch/en/about/contact" onclick="setLanguage('en')">Contact
<span class="nicer">»</span>
</a>
</h3>
<p>
Don't be shy, I'll be happy to talk to <i>you</i>.
</p>
</h3>
</div>
<div class="flush"></div>
<hr/>
<div class="languageLabel"><i>Français</i></div>
<div class="flush"></div>
<div class="block left">
<h3>
<a href="/Scratch/fr/" onclick="setLanguage('fr')">
Blog
<span class="nicer">»</span>
</a>
</h3>
<p>
Ordinateurs, philosophie <i>&amp;</i> des choses de la vie.
</p>
</div>
<div class="block left">
<h3>
<a href="/Scratch/fr/softwares" onclick="setLanguage('fr')">
Logiciels
<span class="nicer">»</span>
</a>
</h3>
<p>
Des économiseurs d'écran,
un gestionnaire de mots de passe <i>&amp;</i>
des applications scientifiques.
</p>
</div>
<div class="block right">
<h3>
<a href="/Scratch/fr/about/contact" onclick="setLanguage('fr')">
Contact
<span class="nicer">»</span>
</a>
</h3>
<p>
Au diable la timidité, n'hésitez pas à me contacter, je serai ravi de <i>vous</i> parler.
</p>
</div>
<div class="flush"></div>
<div class="block left">
<h3>
<a href="http://j.mp/btfRJ2">
Curriculum Vitæ
<span class="nicer">»</span>
</a>
</h3>
<p>
Doctorat &rarr; Post Doc &rarr; Consultant<br/>
<i>Geek &rarr; G33K &rarr; G33|&lt;
</i>
</p>
</h4>
</div>
<div class="block left">
<h3>
<a href="http://yann.esposito.free.fr/enseignement/enseignement.php">
Enseignement
<span class="nicer">»</span>
</a>
</h3>
<p>
Informatique:<br/>
TD, TD <i>&amp;</i> solutions<br/>
BAC+1 à BAC+5<br/>
<i><a href="http://yann.esposito.free.fr/enseignement/projetrez0/projetrez0.html">Projet réseau anonyme
<span class="nicer">»</span></a>
</i>
</p>
</div>
<div class="block right">
<h3>
<a href="http://web.me.com/yann.esposito/Perso/Welcome.html">
Photos
<span class="nicer">»</span>
</a>
</h3>
<p>
<a href="mailto:yannesposito@gmail.com?Subject=Permission%20site%20famille" >
Cliquez ici pour avoir le mot de passe.
<span class="nicer">»</span>
</a>
</p>
</div>
<div class="flush"></div>
</div>

View file

@ -9,7 +9,7 @@
<%= meta_tags %>
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/main.css" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocom<%= language %>"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="<%= @config[:rss_uri][language.intern] %>"/>
<%= meta_alternate %>
<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>
@ -23,6 +23,7 @@
</script>
<div id="content">
<% unless @item[:no_entete] %>
<div id="entete">
<div id="choix">
<div id="choixrss"><%= choixrss %> </div>
@ -32,14 +33,15 @@
</div>
</div>
</div>
<% end %>
<img src="/Scratch/img/presentation.png" alt="Presentation drawing"/>
<div id="titre">
<h1>
<%= @item[:title] %>
<%= @item[:content_for_title].nil? ? @item[:title] : @item[:content_for_title] %>
</h1>
<% unless @item[:subtitle].nil? %>
<% unless @item[:subtitle].nil? and @item[:content_for_subtitle].nil? %>
<h2>
<%= @item[:subtitle] %>
<%= @item[:content_for_subtitle].nil? ? @item[:subtitle] : @item[:content_for_subtitle] %>
</h2>
<% end %>
</div>
@ -59,7 +61,9 @@
<div id="afterheader">
<div class="corps">
<%= yield %>
<% unless @item[:no_entete] %>
<div class="return"><a href="#entete" onclick="fastShowMenu()">&uarr;</a></div>
<% end %>
</div>
<div id="bottom">
<div>

View file

@ -17,8 +17,7 @@ def meta_alternate
end
def choixrss
rssurl=%{http://feeds.feedburner.com/yannespositocom#{ @conf.language }}
return %{<a id="rss" href="#{rssurl}">#{ tradOf(:subscribe) }</a>}
return %{<a id="rss" href="#{@config[:rss_uri][@conf.language.intern]}">#{ tradOf(:subscribe) }</a>}
end
def choixlang

View file

@ -1,7 +1,5 @@
def tradOf(keyword)
language=@item.path
language.match('/Scratch/(..)')
language=$1
language=@conf.language
tradOfKeywordIn(keyword, language )
end

View file

@ -1,6 +1,6 @@
def homepage
@items.find do |i|
i.reps[0].path == %{/Scratch/#{@conf.language}/}
i.reps[0].path == %{#{@config[:webprefix]}/#{@conf.language}/}
end
end
@ -11,6 +11,9 @@ end
def generateMenu
home=homepage
if home.nil?
return ''
end
liste=[]
liste<<=link_to_unless_current(home[:title],home.reps[0])
sortedChildrenByMenuPriority(home).each do |page|
@ -105,7 +108,7 @@ def blogimage(val,title="no name", divclass=nil)
else
imgpath=@item.path
end
imgpath=imgpath.sub(%r{/Scratch/../},'/Scratch/img/')+val
imgpath=imgpath.sub(%r{#{@config[:webprefix]}/../},@config[:webprefix]+'/img/')+val
if not divclass.nil?
cls=%{ class="#{divclass}"}
end
@ -117,8 +120,8 @@ def leftblogimage(val,title="no name")
end
def lnkto(title,item)
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
link_to(title, "/Scratch/#{language}"+item)
language=@item_rep.path.sub(/#{@config[:webprefix]}\//,'').sub(/\/.*$/,'')
link_to(title, "#{@config[:webprefix]}/#{language}"+item)
end
def nextFor(page)

View file

@ -15,7 +15,12 @@ def setItemConf
# -- init variables --
conf=LocalConf.new
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
if language != ''
conf.language=language
else
conf.language='en'
language=conf.language
end
# the current item is an article
article=( ( not @item[:kind].nil? ) && @item[:kind] == 'article' )