Better init file
This commit is contained in:
parent
a43794f540
commit
4a2367e791
10 changed files with 184 additions and 31 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,6 +6,8 @@ output/Scratch/fr
|
||||||
output/Scratch/en
|
output/Scratch/en
|
||||||
output/Scratch/assets
|
output/Scratch/assets
|
||||||
output/Scratch/sitemap.xml
|
output/Scratch/sitemap.xml
|
||||||
|
output/index.html
|
||||||
tmp/
|
tmp/
|
||||||
recupen.pl
|
recupen.pl
|
||||||
recupfr.pl
|
recupfr.pl
|
||||||
|
.sass-cache
|
||||||
|
|
24
Rules
24
Rules
|
@ -16,23 +16,6 @@ end
|
||||||
route '/css/*' do
|
route '/css/*' do
|
||||||
'/Scratch/assets' + item.identifier.chop + '.css'
|
'/Scratch/assets' + item.identifier.chop + '.css'
|
||||||
end
|
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
|
compile '/img/*' do
|
||||||
end
|
end
|
||||||
route '/img/*' do
|
route '/img/*' do
|
||||||
|
@ -52,6 +35,13 @@ route '/js/*' do
|
||||||
'/Scratch/assets' + item.identifier.chop + '.js'
|
'/Scratch/assets' + item.identifier.chop + '.js'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
compile '/html' do
|
||||||
|
filter :erb
|
||||||
|
layout 'default' unless item[:layout] == "none"
|
||||||
|
end
|
||||||
|
route '/html' do
|
||||||
|
'/index.html'
|
||||||
|
end
|
||||||
|
|
||||||
compile '/html/*' do
|
compile '/html/*' do
|
||||||
# item[:extension] returns 'html.erb' for multi-dotted filename
|
# item[:extension] returns 'html.erb' for multi-dotted filename
|
||||||
|
|
10
config.rb
Normal file
10
config.rb
Normal 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
|
||||||
|
}
|
|
@ -5,8 +5,12 @@ data_sources:
|
||||||
type: filesystem_unified
|
type: filesystem_unified
|
||||||
output_dir: output
|
output_dir: output
|
||||||
ultraviolet_theme: "twilight"
|
ultraviolet_theme: "twilight"
|
||||||
|
webprefix: "/Scratch"
|
||||||
base_url: "http://yannesposito.com"
|
base_url: "http://yannesposito.com"
|
||||||
author_uri: "http://yannesposito.com"
|
author_uri: "http://yannesposito.com"
|
||||||
|
rss_uri:
|
||||||
|
fr: "http://feeds.feedburner.com/yannespositocomfr"
|
||||||
|
en: "http://feeds.feedburner.com/yannespositocomen"
|
||||||
|
|
||||||
# les langues
|
# les langues
|
||||||
languages:
|
languages:
|
||||||
|
|
138
content/html/index.erb
Normal file
138
content/html/index.erb
Normal 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>&</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>&</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>&</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>&</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 → Post Doc → Consultant<br/>
|
||||||
|
<i>Geek → G33K → G33|<
|
||||||
|
</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>&</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>
|
|
@ -9,7 +9,7 @@
|
||||||
<%= meta_tags %>
|
<%= meta_tags %>
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
|
<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="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 %>
|
<%= meta_alternate %>
|
||||||
<script type="text/javascript" src="/Scratch/js/jquery-1.3.1.min.js"></script>
|
<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.cookie.js"></script>
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
<% unless @item[:no_entete] %>
|
||||||
<div id="entete">
|
<div id="entete">
|
||||||
<div id="choix">
|
<div id="choix">
|
||||||
<div id="choixrss"><%= choixrss %> </div>
|
<div id="choixrss"><%= choixrss %> </div>
|
||||||
|
@ -32,14 +33,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<img src="/Scratch/img/presentation.png" alt="Presentation drawing"/>
|
<img src="/Scratch/img/presentation.png" alt="Presentation drawing"/>
|
||||||
<div id="titre">
|
<div id="titre">
|
||||||
<h1>
|
<h1>
|
||||||
<%= @item[:title] %>
|
<%= @item[:content_for_title].nil? ? @item[:title] : @item[:content_for_title] %>
|
||||||
</h1>
|
</h1>
|
||||||
<% unless @item[:subtitle].nil? %>
|
<% unless @item[:subtitle].nil? and @item[:content_for_subtitle].nil? %>
|
||||||
<h2>
|
<h2>
|
||||||
<%= @item[:subtitle] %>
|
<%= @item[:content_for_subtitle].nil? ? @item[:subtitle] : @item[:content_for_subtitle] %>
|
||||||
</h2>
|
</h2>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -59,7 +61,9 @@
|
||||||
<div id="afterheader">
|
<div id="afterheader">
|
||||||
<div class="corps">
|
<div class="corps">
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
|
<% unless @item[:no_entete] %>
|
||||||
<div class="return"><a href="#entete" onclick="fastShowMenu()">↑</a></div>
|
<div class="return"><a href="#entete" onclick="fastShowMenu()">↑</a></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div id="bottom">
|
<div id="bottom">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -17,8 +17,7 @@ def meta_alternate
|
||||||
end
|
end
|
||||||
|
|
||||||
def choixrss
|
def choixrss
|
||||||
rssurl=%{http://feeds.feedburner.com/yannespositocom#{ @conf.language }}
|
return %{<a id="rss" href="#{@config[:rss_uri][@conf.language.intern]}">#{ tradOf(:subscribe) }</a>}
|
||||||
return %{<a id="rss" href="#{rssurl}">#{ tradOf(:subscribe) }</a>}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def choixlang
|
def choixlang
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
def tradOf(keyword)
|
def tradOf(keyword)
|
||||||
language=@item.path
|
language=@conf.language
|
||||||
language.match('/Scratch/(..)')
|
|
||||||
language=$1
|
|
||||||
tradOfKeywordIn(keyword, language )
|
tradOfKeywordIn(keyword, language )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
def homepage
|
def homepage
|
||||||
@items.find do |i|
|
@items.find do |i|
|
||||||
i.reps[0].path == %{/Scratch/#{@conf.language}/}
|
i.reps[0].path == %{#{@config[:webprefix]}/#{@conf.language}/}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,6 +11,9 @@ end
|
||||||
|
|
||||||
def generateMenu
|
def generateMenu
|
||||||
home=homepage
|
home=homepage
|
||||||
|
if home.nil?
|
||||||
|
return ''
|
||||||
|
end
|
||||||
liste=[]
|
liste=[]
|
||||||
liste<<=link_to_unless_current(home[:title],home.reps[0])
|
liste<<=link_to_unless_current(home[:title],home.reps[0])
|
||||||
sortedChildrenByMenuPriority(home).each do |page|
|
sortedChildrenByMenuPriority(home).each do |page|
|
||||||
|
@ -105,7 +108,7 @@ def blogimage(val,title="no name", divclass=nil)
|
||||||
else
|
else
|
||||||
imgpath=@item.path
|
imgpath=@item.path
|
||||||
end
|
end
|
||||||
imgpath=imgpath.sub(%r{/Scratch/../},'/Scratch/img/')+val
|
imgpath=imgpath.sub(%r{#{@config[:webprefix]}/../},@config[:webprefix]+'/img/')+val
|
||||||
if not divclass.nil?
|
if not divclass.nil?
|
||||||
cls=%{ class="#{divclass}"}
|
cls=%{ class="#{divclass}"}
|
||||||
end
|
end
|
||||||
|
@ -117,8 +120,8 @@ def leftblogimage(val,title="no name")
|
||||||
end
|
end
|
||||||
|
|
||||||
def lnkto(title,item)
|
def lnkto(title,item)
|
||||||
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
|
language=@item_rep.path.sub(/#{@config[:webprefix]}\//,'').sub(/\/.*$/,'')
|
||||||
link_to(title, "/Scratch/#{language}"+item)
|
link_to(title, "#{@config[:webprefix]}/#{language}"+item)
|
||||||
end
|
end
|
||||||
|
|
||||||
def nextFor(page)
|
def nextFor(page)
|
||||||
|
|
|
@ -15,7 +15,12 @@ def setItemConf
|
||||||
# -- init variables --
|
# -- init variables --
|
||||||
conf=LocalConf.new
|
conf=LocalConf.new
|
||||||
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
|
language=@item_rep.path.sub(/\/Scratch\//,'').sub(/\/.*$/,'')
|
||||||
conf.language=language
|
if language != ''
|
||||||
|
conf.language=language
|
||||||
|
else
|
||||||
|
conf.language='en'
|
||||||
|
language=conf.language
|
||||||
|
end
|
||||||
|
|
||||||
# the current item is an article
|
# the current item is an article
|
||||||
article=( ( not @item[:kind].nil? ) && @item[:kind] == 'article' )
|
article=( ( not @item[:kind].nil? ) && @item[:kind] == 'article' )
|
||||||
|
|
Loading…
Reference in a new issue