diff --git a/README.md b/README.md
new file mode 100644
index 000000000..e560dd0a8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,60 @@
+# yannesposito.com
+
+This is the source code of yannesposito.com website.
+
+It is mainly a multi-language blog based on [nanoc](nanoc.stoneship.org).
+
+_Notice, this is not a clean system.
+Mainly because I use it for some years now.
+I just want it to work, not to be a nice piece of code.
+But in the end I know I will make it clean._
+
+What you'll need to use it:
+
+- [nanoc](nanoc.stoneship.org) → `gem install nanoc`
+- [zsh](zsh.org) → By default installed on most good system
+- A bunch of gems: `gem install ultraviolet krambook sass rainpress`
+
+Optionally
+
+- [graphviz](graphviz.org)
+
+Here is a short explanation of each file role:
+
+
+ config.rb → nanoc central configuration file
+ config.ru → Rack server configuration
+ config.yaml → A YAML configuration file (mostly strings)
+ content/ → The directory where nanoc will search most content
+ img_latest_blog_dir@ → A link to the latest blog image directory
+ latest.md@ → A link to the latest blog file
+ layouts/ → HTML Layouts for your webpages
+ lib/ → Some ruby files loaded by nanoc before generating
+ multi/ → Where you should write content
+ output/ → Where the content is loaded
+ Rakefile → Ruby actions
+ README.md → This file
+ resources/ → Some file I used and wanted to keep
+ Rules → Generation rules
+ tasks/ → Where I putted most of my scripts
+
+
+Here are features I added:
+
+ analytics.rb → Functions to add web analytics code
+ calendar.rb → Function show a date nicely in HTML
+ gitmtime.rb → Show time using git last change log
+ graph.rb → Use graphviz to draw graphs
+ helpers.rb → Some standard nanoc helpers are added
+ html.rb → Layout block helper
+ intenseDebate.rb → IntenseDebate integration
+ macros.rb → Macros system (%latex => LaTeX, etc...)
+ mail.rb → My uniquely encoded personal email
+ multiMenu.rb → The machinery for the menu
+ multi.rb → The machinery for helping to be multi-language
+ nanoc_item_conf.rb
+ repair_html.rb
+ syntaxColorize.rb
+ tag.rb
+ ultraviolet.rb
+ y.rb
diff --git a/Rules b/Rules
index d35466c90..1c0aaa969 100644
--- a/Rules
+++ b/Rules
@@ -9,7 +9,6 @@
# CSS
compile '/css/*' do
- # filter :no_custom_css
filter :sass
filter :rainpress
end
diff --git a/config.ru b/config.ru
index 7591c9e6d..866e6b446 100644
--- a/config.ru
+++ b/config.ru
@@ -1,3 +1,5 @@
+# This file is needed if you want to host this website
+# using ruby rack. In particular on heroku.
require 'rubygems'
require 'rack'
require 'rack/contrib'
diff --git a/content/css/main.css b/content/css/main.css
index dcb448613..6c284e5da 100644
--- a/content/css/main.css
+++ b/content/css/main.css
@@ -10,6 +10,7 @@ $secondRevealColor: #AA5533
$lighterRevealColor: $revealColor + #666
$imageBackgroundColor: $mainBackgroundColor
$imageBorderColor: #cccccc
+$borderColor: #cccccc
$mainLinkColor: $mainTextColor
$textLinkColor: #555555
$highlightColor: #888888
@@ -61,6 +62,9 @@ $codeBlockBackgroundColor: $behindColor
=secondColor
color: $behindColor
+ border: $borderColor solid 1px
+ border-radius: 5px
+ box-shadow: 0 0 2px $borderColor inset
background:
color: $lighterColor
a
@@ -396,9 +400,7 @@ $hauteur_menu: 4em
$contentMargin: 0em
.encadre, .black, .red, .intro, .resume, .shadow
- padding:
- left: 2em
- right: 2em
+ padding: 2em
margin:
top: 2em
bottom: 2em
diff --git a/content/html/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md b/content/html/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
index be71574f4..eab5e9c6d 100644
--- a/content/html/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
+++ b/content/html/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
@@ -27,7 +27,7 @@ def gitmtime
ext=%{.#{@item[:extension]}}
filepath<<=ext
if not FileTest.exists?(filepath)
- filepath.sub!(ext,%{/index#{ext}})
+ filepath.sub!(ext,%{#{@item.raw_filename}#{ext}})
end
str=`git log -1 --format='%ci' -- #{filepath}`
if str.nil? or str.empty?
@@ -43,4 +43,5 @@ But it works as expected.
Now the date you see at the bottom is exactly the date I modified the _content_ of the page.
-Thanks to Eric Sunshine to provide me some hints at cleaning my code.
+_Edit_:
+Thanks to Eric Sunshine and Kris to provide me some hints at cleaning my code.
diff --git a/content/html/en/blog/Learn-Vim-Progressively.md b/content/html/en/blog/Learn-Vim-Progressively.md
index d72d0b4d1..077c0a434 100644
--- a/content/html/en/blog/Learn-Vim-Progressively.md
+++ b/content/html/en/blog/Learn-Vim-Progressively.md
@@ -213,11 +213,12 @@ With all preceding commands you should be comfortable to use vim.
But now, here are the killer features.
Some of these features were the reason I started to use vim.
-### Move on current line: `0` `^` `$` `f` `F` `t` `T` `,` `;`
+### Move on current line: `0` `^` `$` `g_` `f` `F` `t` `T` `,` `;`
> - `0` → go to column 0
> - `^` → go to first character on the line
-> - `$` → go to the last character on the line
+> - `$` → go to the last column
+> - `g_` → go to the last character on the line
> - `fa` → go to next occurrence of the letter `a` on the line. `,` (resp. `;`) will seek for the next (resp. previous) occurrence.
> - `t,` → go just before the character `,`.
> - `3fa` → search the 3rd occurrence of `a` on this line.
@@ -260,7 +261,7 @@ Typically: `0I-- [ESC]`
<%= blogimage("rectangular-blocks.gif","Rectangular blocks") %>
-Not on windows you might have to use `` instead of `` if your clipboard is not empty.
+Note on windows you might have to use `` instead of `` if your clipboard is not empty.
### Completion: `` and ``.
diff --git a/content/html/fr/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md b/content/html/fr/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
index a95c1a01e..d019da167 100644
--- a/content/html/fr/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
+++ b/content/html/fr/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
@@ -27,7 +27,7 @@ def gitmtime
ext=%{.#{@item[:extension]}}
filepath<<=ext
if not FileTest.exists?(filepath)
- filepath.sub!(ext,%{/index#{ext}})
+ filepath.sub!(ext,%{#{@item.raw_filename}#{ext}})
end
str=`git log -1 --format='%ci' -- #{filepath}`
if str.nil? or str.empty?
@@ -43,4 +43,5 @@ Bien entendu je sais que c'est très lent et absolument pas optimisé.
Mais ça fonctionne comme prévu.
Maintenant la date que vous voyez en bas de la page correspond exactement à la dernière date de modification de son contenu.
-Je tiens à remercier Eric Sunshine pour ses conseils sur ce problème.
+_Mise à jour_:
+Je tiens à remercier Eric Sunshine et Kris pour leurs conseils sur ce problème.
diff --git a/content/html/fr/blog/Learn-Vim-Progressively.md b/content/html/fr/blog/Learn-Vim-Progressively.md
index 50ec72c12..83bffda0d 100644
--- a/content/html/fr/blog/Learn-Vim-Progressively.md
+++ b/content/html/fr/blog/Learn-Vim-Progressively.md
@@ -219,11 +219,12 @@ Jusqu'ici vous avez appris les commandes les plus courantes.
Mais voici les killer features de vim.
Celles que je n'ai retrouvé que dans vim (ou presque).
-### Déplacement sur la ligne : `0` `^` `$` `f` `F` `t` `T` `,` `;`
+### Déplacement sur la ligne : `0` `^` `$` `g_` `f` `F` `t` `T` `,` `;`
> - `0` → aller à la colonne 0,
> - `^` → aller au premier caractère de la ligne
-> - `$` → aller au dernier caractère de la ligne
+> - `$` → aller à la dernière colonne de la ligne
+> - `g_` → aller au dernier caractère de la ligne
> - `fa` → vous amène à la prochaine occurrence de a sur la ligne courante. `,` (resp. `;`) recherche l'occurrence suivante (resp. précédente).
> - `t,` → vous amène juste avant le `,`.
> - `3fa` → recherche la 3ième occurrence de `a`.
diff --git a/img_latest_blog_dir b/img_latest_blog_dir
index 822bb2e00..6edf35902 120000
--- a/img_latest_blog_dir
+++ b/img_latest_blog_dir
@@ -1 +1 @@
-./output/Scratch/img/blog/programming-language-experience
\ No newline at end of file
+/home/e640846/Sites/webroot/output/Scratch/img/blog/Higher-order-function-in-zsh
\ No newline at end of file
diff --git a/latest.md b/latest.md
index f8eddf7dc..ed9648ff9 120000
--- a/latest.md
+++ b/latest.md
@@ -1 +1 @@
-./multi/blog/programming-language-experience.md
\ No newline at end of file
+./multi/blog/Higher-order-function-in-zsh.md
\ No newline at end of file
diff --git a/lib/blog.rb b/lib/blog.rb
new file mode 100644
index 000000000..4c0978998
--- /dev/null
+++ b/lib/blog.rb
@@ -0,0 +1,19 @@
+# Helper to find an image corresponding to the current
+# article
+def blogimage(val,title="no name", divclass=nil)
+ if depthOf( @item ) == 4
+ imgpath=@item.parent.path
+ else
+ imgpath=@item.path
+ end
+ imgpath=imgpath.sub(%r{#{@config[:webprefix]}/../},@config[:webprefix]+'/img/')+val
+ if not divclass.nil?
+ cls=%{ class="#{divclass}"}
+ end
+ return %{}
+end
+
+# Return a blog image with class left added
+def leftblogimage(val,title="no name")
+ return blogimage(val, title, "left")
+end
diff --git a/lib/css.rb b/lib/css.rb
deleted file mode 100644
index 0dada1386..000000000
--- a/lib/css.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-class NoCustomCSS < Nanoc3::Filter
- identifier :no_custom_css
- def run(content, params={})
- res=""
- content.each do |line|
- res <<= line if not res=~/^\s*-(moz|webkit)/
- end
- return res
- end
-end
-
-class MozillaCSS < Nanoc3::Filter
- identifier :mozilla
- def run(content, params={})
- res=""
- content.each do |line|
- res <<= line if not res=~/-webkit/
- end
- return res
- end
-end
-
-class WebkitCSS < Nanoc3::Filter
- identifier :webkit
- def run(content, params={})
- res=""
- content.each do |line|
- res <<= line if not res=~/-moz/
- end
- return res
- end
-end
diff --git a/lib/gitmtime.rb b/lib/gitmtime.rb
index 49f8cf571..82671298f 100644
--- a/lib/gitmtime.rb
+++ b/lib/gitmtime.rb
@@ -3,7 +3,7 @@ def gitmtime
ext=%{.#{@item[:extension]}}
filepath<<=ext
if not FileTest.exists?(filepath)
- filepath.sub!(ext,%{/index#{ext}})
+ filepath.sub!(ext,%{#{@item.raw_filename}#{ext}})
end
str=`git log -1 --format='%ci' -- #{filepath}`
if str.nil? or str.empty?
diff --git a/lib/helpers.rb b/lib/helpers.rb
index 4e0ded6a9..c68bad653 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -7,7 +7,6 @@
# <% content_for :summary do %>
# Sommaire que je veux ecrire
# <% end %>
-#
# Pour remplir à la fois le texte et le sommaire
include Nanoc3::Helpers::Capturing
diff --git a/lib/multiMenu.rb b/lib/multiMenu.rb
index 0537a03cf..3ef77eea8 100644
--- a/lib/multiMenu.rb
+++ b/lib/multiMenu.rb
@@ -1,14 +1,17 @@
+# give item corresponding to the homepage of the current language
def homepage
@items.find do |i|
i.reps[0].path == %{#{@config[:webprefix]}/#{@conf.language}/}
end
end
+# Explicit, give the children of a node in the menu, sorted by menu priority
def sortedChildrenByMenuPriority(item)
item.children.reject{|p| p[:isHidden]}.
sort!{|x,y| x[:menupriority] <=> y[:menupriority]}
end
+# Generate the menu for the current item
def generateMenu
home=homepage
if home.nil?
@@ -22,6 +25,7 @@ def generateMenu
"
"+liste.join("
\n
")+"
"
end
+# get the depth of an item in the menu
def depthOf(item)
res=0
while item.parent != nil
@@ -31,6 +35,8 @@ def depthOf(item)
return res
end
+# get the list of item children of a node sorted
+# by menupriority or date depending of the kind fo page
def getSortedChildren(parent)
if parent[:kind] == "blog"
return parent.children.reject{|p| p[:isHidden]}.sort!{|x,y| x[:created_at] <=> y[:created_at] }
@@ -39,6 +45,7 @@ def getSortedChildren(parent)
end
end
+# For the page blog, the submenu is very specific
def generateBlogSubMenu(language)
year=0
res=""
@@ -63,6 +70,7 @@ def generateBlogSubMenu(language)
end
end
+# Generate a submenu, not always needed
def generateSubMenu()
if @item[:noSubMenu]
return
@@ -102,23 +110,6 @@ def generateSubMenu()
end
# =======================
-def blogimage(val,title="no name", divclass=nil)
- if depthOf( @item ) == 4
- imgpath=@item.parent.path
- else
- imgpath=@item.path
- end
- imgpath=imgpath.sub(%r{#{@config[:webprefix]}/../},@config[:webprefix]+'/img/')+val
- if not divclass.nil?
- cls=%{ class="#{divclass}"}
- end
- return %{}
-end
-
-def leftblogimage(val,title="no name")
- return blogimage(val, title, "left")
-end
-
def lnkto(title,item)
language=@item_rep.path.sub(/#{@config[:webprefix]}\//,'').sub(/\/.*$/,'')
link_to(title, "#{@config[:webprefix]}/#{language}"+item)
diff --git a/lib/repair_html.rb b/lib/repair_html.rb
index dc2f9d324..87222b809 100644
--- a/lib/repair_html.rb
+++ b/lib/repair_html.rb
@@ -11,36 +11,23 @@ def repair_html( html, debug=false )
depth=0
html.scan( %r{<(/?)(\w*)([^>]*)>} ).each do |m|
if m[-1] == "/"
- if debug
- puts 'IGNORE: <'+m[0]+m[1]+'/>' + depth.to_s
- puts 'parents='+parents.join('; ')
- end
next
end
if m[0] == ""
parents[depth]=m[1]
depth+=1
- if debug
- puts '<'+m[0]+m[1]+'> ' + depth.to_s
- puts 'parents='+parents.join('; ')
- end
else
depth-=1
- if (not debug) and (depth <0)
- puts 'ERROR repair_html !'
- # puts 'HTML: ' + html
- # puts '---'
- # repair_html(html,true)
- # puts 'END_ERROR'
- end
- if debug
- puts '<'+m[0]+m[1]+'> ' + depth.to_s
+ # -1 is normal for my layout
+ if (depth <= -2)
+ puts "WARNING: Intermiedate Depth <= -2"
end
end
end
res=html.sub(/<[^>]*$/m,'')
depth -= 1
- if (depth < 0)
+ if (depth < -1)
+ puts "ERROR: Final Depth < 0"
parents=[]
depth=0
html.scan( %r{<(/?)(\w*)[^>]*(/?)>} ).each do |m|
diff --git a/multi/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md b/multi/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
index 470ebb94c..eda4616cf 100644
--- a/multi/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
+++ b/multi/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes.md
@@ -35,7 +35,7 @@ def gitmtime
ext=%{.#{@item[:extension]}}
filepath<<=ext
if not FileTest.exists?(filepath)
- filepath.sub!(ext,%{/index#{ext}})
+ filepath.sub!(ext,%{#{@item.raw_filename}#{ext}})
end
str=`git log -1 --format='%ci' -- #{filepath}`
if str.nil? or str.empty?
@@ -54,5 +54,7 @@ fr: Bien entendu je sais que c'est très lent et absolument pas optimisé.
fr: Mais ça fonctionne comme prévu.
fr: Maintenant la date que vous voyez en bas de la page correspond exactement à la dernière date de modification de son contenu.
-en: Thanks to Eric Sunshine to provide me some hints at cleaning my code.
-fr: Je tiens à remercier Eric Sunshine pour ses conseils sur ce problème.
+en: _Edit_:
+en: Thanks to Eric Sunshine and Kris to provide me some hints at cleaning my code.
+fr: _Mise à jour_:
+fr: Je tiens à remercier Eric Sunshine et Kris pour leurs conseils sur ce problème.
diff --git a/multi/blog/Higher-order-function-in-zsh.md b/multi/blog/Higher-order-function-in-zsh.md
new file mode 100644
index 000000000..490b5bfad
--- /dev/null
+++ b/multi/blog/Higher-order-function-in-zsh.md
@@ -0,0 +1,90 @@
+-----
+isHidden: false
+menupriority: 1
+kind: article
+created_at: 2011-09-27T15:15:23+02:00
+en: title: Higher order function in zsh
+fr: title: Higher order function in zsh
+author_name: Yann Esposito
+author_uri: yannesposito.com
+# tags:
+-----
+<%= blogimage("main.png","Title image") %>
+
+begindiv(intro)
+
+en: <%= tldr %> some simple implementation of higher order function for zsh.
+fr: <%= tlal %> des fonctions d'ordres supérieurs en zsh.
+
+enddiv
+
+fr: Tout d'abord, pourquoi c'est important d'avoir ces fonctions.
+fr: Plus je programmais avec zsh plus j'essayais d'avoir un style fonctionnel.
+
+fr: Le minimum pour pouvoir avoir du code plus lisible c'est de posséder les fonctions `map`, `filter` et `fold`.
+
+fr: Voici pourquoi avec une comparaison.
+fr: Commençons par un programme qui converti tous les gif en png dans plusieurs répertoires projets contenant tous des répertoires resources.
+fr: Avant :
+
+
+# for each directory in projects dir
+for toProject in /path/to/projects/*(/N); do
+ # toProject is /path/to/projects/foo
+ # project become foo (:t for tail)
+ project=${toProject:t}
+ for toResource in $toProject/resources/*.gif(.N); do
+ convert $toResource ${toResource:r}.png
+ \rm -f $toResource
+ done
+done
+
+
+fr: Après
+
+
+gif_to_png() { convert $1 ${1:r}.png && \rm -f $1 }
+handle_resources() { map gif_to_png $1/resources/*.gif(.N) }
+map handle_resources /path/to/projects/*(/N)
+
+
+fr: Plus de bloc !
+fr: Oui, c'est un poil plus difficile à lire pour les non initiés.
+fr: Mais c'est à la fois plus concis et plus robuste.
+
+fr: Et encore ce code ne possède pas de test.
+fr: Recommençons sur le même principe.
+
+fr: Trouver les fichiers des projets qui ne contiennent pas de s dans leur nom qui ont le même nom que leur projet.
+
+
+
+for toProject in Projects/*; do
+ project=$toProject:t
+ if print -- project | grep -v s >/dev/null
+ then
+ print $project
+ for toResource in $toProject/*(.N); do
+ if print -- ${toResource:t} | grep $project >/dev/null; then
+ print -- "X $toResource"
+ fi
+ done
+ fi
+done
+
+
+After =>
+
+
+contain_no_s() { print $1 | grep -v s }
+function verify_file_name {
+ local project=$1:t
+ contains_project_name() { print $1:t | grep $project }
+ map "print -- X" $(filter contains_project_name $1/*(.N))
+}
+map show_project_matchin_file $( filter contain_no_s Projects/* )
+
+
+Also, the first verstion is a bit easier to read.
+But the second one is clearly far superior in architecture.
+Why?
diff --git a/multi/blog/Learn-Vim-Progressively.md b/multi/blog/Learn-Vim-Progressively.md
index e15d8d76f..7eafb4a35 100644
--- a/multi/blog/Learn-Vim-Progressively.md
+++ b/multi/blog/Learn-Vim-Progressively.md
@@ -362,19 +362,21 @@ fr: Jusqu'ici vous avez appris les commandes les plus courantes.
fr: Mais voici les killer features de vim.
fr: Celles que je n'ai retrouvé que dans vim (ou presque).
-en: ### Move on current line: `0` `^` `$` `f` `F` `t` `T` `,` `;`
-fr: ### Déplacement sur la ligne : `0` `^` `$` `f` `F` `t` `T` `,` `;`
+en: ### Move on current line: `0` `^` `$` `g_` `f` `F` `t` `T` `,` `;`
+fr: ### Déplacement sur la ligne : `0` `^` `$` `g_` `f` `F` `t` `T` `,` `;`
en: > - `0` → go to column 0
en: > - `^` → go to first character on the line
-en: > - `$` → go to the last character on the line
+en: > - `$` → go to the last column
+en: > - `g_` → go to the last character on the line
en: > - `fa` → go to next occurrence of the letter `a` on the line. `,` (resp. `;`) will seek for the next (resp. previous) occurrence.
en: > - `t,` → go just before the character `,`.
en: > - `3fa` → search the 3rd occurrence of `a` on this line.
en: > - `F` and `T` → like `f` and `t` but backward.
fr: > - `0` → aller à la colonne 0,
fr: > - `^` → aller au premier caractère de la ligne
-fr: > - `$` → aller au dernier caractère de la ligne
+fr: > - `$` → aller à la dernière colonne de la ligne
+fr: > - `g_` → aller au dernier caractère de la ligne
fr: > - `fa` → vous amène à la prochaine occurrence de a sur la ligne courante. `,` (resp. `;`) recherche l'occurrence suivante (resp. précédente).
fr: > - `t,` → vous amène juste avant le `,`.
fr: > - `3fa` → recherche la 3ième occurrence de `a`.
@@ -439,7 +441,7 @@ fr: - `I-- [ESC]` → écrit `-- ` pour commenter le reste de la ligne.
<%= blogimage("rectangular-blocks.gif","Rectangular blocks") %>
-en: Not on windows you might have to use `` instead of `` if your clipboard is not empty.
+en: Note on windows you might have to use `` instead of `` if your clipboard is not empty.
fr: Remarquez que sous windows, vous devez utiliser `` plutôt que `` si votre "presse papier" n'est pas vide.
en: ### Completion: `` and ``.
diff --git a/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/code/gitmtime.rb b/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/code/gitmtime.rb
index 181b11b14..0617e0637 100644
--- a/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/code/gitmtime.rb
+++ b/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/code/gitmtime.rb
@@ -4,7 +4,7 @@ def gitmtime
ext=%{.#{@item[:extension]}}
filepath<<=ext
if not FileTest.exists?(filepath)
- filepath.sub!(ext,%{/index#{ext}})
+ filepath.sub!(ext,%{#{@item.raw_filename}#{ext}})
end
str=`git log -1 --format='%ci' -- #{filepath}`
if str.nil? or str.empty?
diff --git a/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/index.html b/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/index.html
index 1bda20e6d..6bbbb3dd8 100644
--- a/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/index.html
+++ b/output/Scratch/en/blog/2010-09-02-Use-git-to-calculate-trusted-mtimes/index.html
@@ -74,7 +74,7 @@ This is how I do this with nanoc:
ext=%{.#{@item[:extension]}}
filepath<<=ext
ifnotFileTest.exists?(filepath)
- filepath.sub!(ext,%{/index#{ext}})
+ filepath.sub!(ext,%{#{@item.raw_filename}#{ext}})
end
str=`git log -1 --format='%ci' -- #{filepath}`if str.nil?or str.empty?
@@ -90,7 +90,8 @@ This is how I do this with nanoc:
But it works as expected.
Now the date you see at the bottom is exactly the date I modified the content of the page.
-
Thanks to Eric Sunshine to provide me some hints at cleaning my code.
+
Edit:
+Thanks to Eric Sunshine and Kris to provide me some hints at cleaning my code.
@@ -188,7 +189,7 @@ Now the date you see at the bottom is exactly the date I modified the conten
Entirely done with
diff --git a/output/Scratch/en/blog/Learn-Vim-Progressively/index.html b/output/Scratch/en/blog/Learn-Vim-Progressively/index.html
index d6250201d..468927954 100644
--- a/output/Scratch/en/blog/Learn-Vim-Progressively/index.html
+++ b/output/Scratch/en/blog/Learn-Vim-Progressively/index.html
@@ -321,13 +321,14 @@ is also true for d (delete), v (visual select),
But now, here are the killer features.
Some of these features were the reason I started to use vim.
-
Move on current line: 0^$fFtT,;
+
Move on current line: 0^$g_fFtT,;
0 → go to column 0
^ → go to first character on the line
-
$ → go to the last character on the line
+
$ → go to the last column
+
g_ → go to the last character on the line
fa → go to next occurrence of the letter a on the line. , (resp. ;) will seek for the next (resp. previous) occurrence.
t, → go just before the character ,.
3fa → search the 3rd occurrence of a on this line.
@@ -188,7 +189,7 @@ Maintenant la date que vous voyez en bas de la page correspond exactement à la
Écrit le : 02/09/2010
- modifié le : 20/04/2011
+ modifié le : 14/09/2011
Site entièrement réalisé avec
diff --git a/output/Scratch/fr/blog/Learn-Vim-Progressively/index.html b/output/Scratch/fr/blog/Learn-Vim-Progressively/index.html
index 46fa8e13a..2e2120136 100644
--- a/output/Scratch/fr/blog/Learn-Vim-Progressively/index.html
+++ b/output/Scratch/fr/blog/Learn-Vim-Progressively/index.html
@@ -327,13 +327,14 @@ est aussi vrai pour d (delete → supprimer), v (séle
Mais voici les killer features de vim.
Celles que je n’ai retrouvé que dans vim (ou presque).
-
Déplacement sur la ligne : 0^$fFtT,;
+
Déplacement sur la ligne : 0^$g_fFtT,;
0 → aller à la colonne 0,
^ → aller au premier caractère de la ligne
-
$ → aller au dernier caractère de la ligne
+
$ → aller à la dernière colonne de la ligne
+
g_ → aller au dernier caractère de la ligne
fa → vous amène à la prochaine occurrence de a sur la ligne courante. , (resp. ;) recherche l’occurrence suivante (resp. précédente).
Entirely done with
diff --git a/resources/.vimrc b/resources/.vimrc
new file mode 100644
index 000000000..d4afa97b8
--- /dev/null
+++ b/resources/.vimrc
@@ -0,0 +1,12 @@
+" Add this to your vimrc file to use my two split view with multiple language
+
+autocmd BufRead *latest.md set foldenable
+autocmd BufRead *latest.md set foldlevel=0
+autocmd BufRead *latest.md set foldminlines=0
+autocmd BufRead *latest.md set foldmethod=expr
+autocmd BufRead *latest.md set foldtext=''
+autocmd BufRead *latest.md set scrollbind
+autocmd BufRead *latest.md set foldexpr=getline(v:lnum)=~'^en:\ .*$'
+autocmd BufRead *latest.md vsplit
+autocmd BufRead *latest.md set foldexpr=getline(v:lnum)=~'^fr:\ .*$'
+autocmd BufRead *latest.md set spell