<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Markdown on Jean-Christophe Gay</title><link>https://jeanchristophegay.com/tags/markdown/</link><description>Recent content in Markdown on Jean-Christophe Gay</description><generator>Hugo -- gohugo.io</generator><language>fr-FR</language><copyright>© 2026 Jean-Christophe Gay</copyright><lastBuildDate>Sun, 29 Sep 2019 19:31:44 +0200</lastBuildDate><atom:link href="https://jeanchristophegay.com/tags/markdown/index.xml" rel="self" type="application/rss+xml"/><item><title>Migration de Pelican vers Hugo</title><link>https://jeanchristophegay.com/posts/migration-pelican-hugo/</link><pubDate>Sun, 20 Oct 2019 11:35:00 +0200</pubDate><guid>https://jeanchristophegay.com/posts/migration-pelican-hugo/</guid><description>&lt;p&gt;Retour sur la migration d&amp;rsquo;un blog construit avec &lt;a href="http://getpelican.com/" target="_blank" rel="noreferrer"&gt;Pelican&lt;/a&gt; pour un site statique généré avec &lt;a href="https://gohugo.io" target="_blank" rel="noreferrer"&gt;Hugo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Ça fait un moment que je n&amp;rsquo;ai pas posté ici. Pour le dépoussierage je reviens sur la migration du générateur de ce site.&lt;/p&gt;
&lt;p&gt;J&amp;rsquo;utilisais &lt;a href="https://jeanchristophegay.com/posts/migration-wordpress-pelican/" &gt;Pelican&lt;/a&gt; depuis plusieurs années. Récemment j&amp;rsquo;ai réinstallé ma machine, j&amp;rsquo;avais bien entendu sauvegardé l&amp;rsquo;&lt;a href="https://virtualenv.pypa.io/en/latest/" target="_blank" rel="noreferrer"&gt;environnement virtuel&lt;/a&gt; qui me servait à générér mon site mais au moment de le restaurer je me suis dit que c&amp;rsquo;était le bon moment pour changer.&lt;/p&gt;
&lt;p&gt;J&amp;rsquo;ai souvent eu des problèmes avec la gestion de mon environnement &lt;code&gt;Python&lt;/code&gt; (pour tout dire ce n&amp;rsquo;est vraiment pas ma zone de confort, et je n&amp;rsquo;en touche que très rarement&amp;hellip;), que ce soit à cause des chemins vers &lt;a href="https://jeanchristophegay.com/posts/reparation-virtualenv-brew-cleanup/" &gt;mes installations de &lt;code&gt;Python&lt;/code&gt;&lt;/a&gt; ou bien à cause des mises à jour de &lt;code&gt;Pelican&lt;/code&gt; et de ses dépendances. Du coup je surveille ce qui se passe un peu dans l&amp;rsquo;univers des générateurs de site et je suis resté bloqué sur &lt;a href="https://gohugo.io" target="_blank" rel="noreferrer"&gt;Hugo&lt;/a&gt; et &lt;a href="https://www.gatsbyjs.org" target="_blank" rel="noreferrer"&gt;Gatsby&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Les deux semblent assez &lt;a href="https://www.staticgen.com" target="_blank" rel="noreferrer"&gt;populaires&lt;/a&gt; et assez similaires en terme de fonctionalités. Comme je suis bien plus à l&amp;rsquo;aise avec &lt;code&gt;Go&lt;/code&gt; qu&amp;rsquo;avec l&amp;rsquo;écosystème &lt;code&gt;React&lt;/code&gt; le choix a été assez facile 😇.&lt;/p&gt;
&lt;p&gt;Ce qui m&amp;rsquo;a encouragé à migrer est que pour utiliser &lt;code&gt;Hugo&lt;/code&gt; il suffit d&amp;rsquo;utiliser un binaire tout en un. Pas besoin de gérer x dépendances 🚀. C&amp;rsquo;est donc plus simple de reproduire la génération de son site dans le temps.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Installation
 &lt;div id="installation" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#installation" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Il a suffit de suivre le &lt;a href="https://gohugo.io/getting-started/installing/" target="_blank" rel="noreferrer"&gt;guide d&amp;rsquo;installation&lt;/a&gt; soit sur macOS un simple :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install hugo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Puis de générer la structure du site (dans le dossier existant) avec :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hugo new site jeanchristophegay.com
&lt;/code&gt;&lt;/pre&gt;

&lt;h1 class="relative group"&gt;Theme
 &lt;div id="theme" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#theme" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;J&amp;rsquo;ai choisi &lt;a href="https://github.com/halogenica/beautifulhugo" target="_blank" rel="noreferrer"&gt;Beautiful Hugo&lt;/a&gt; pour le moment.&lt;br&gt;
L&amp;rsquo;installation a été rapide en suivant les simples étapes de la &lt;a href="https://themes.gohugo.io/beautifulhugo/" target="_blank" rel="noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Migrer les articles
 &lt;div id="migrer-les-articles" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#migrer-les-articles" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Les articles sont déplacés dans le dossier &lt;code&gt;content/posts&lt;/code&gt; pour respecter la structure d&amp;rsquo;Hugo.&lt;br&gt;
Les images sont maintenant dans &lt;code&gt;static/images&lt;/code&gt; pour ne pas devoir réécrire les URL.&lt;/p&gt;
&lt;p&gt;Les articles sont déjà rédigés en Markdown, il faut donc s&amp;rsquo;occuper de convertir les métadonnés et les quelques balises spécifiques à Pelican.&lt;/p&gt;
&lt;p&gt;Les métadonnées de Pelican ressemblaient à :&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Title: De la couleur dans les logs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Date: 2013-05-04 18:22
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Category: java
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Tags: ansi console, grep console, jansi, log, log4j, log4j 2, logback
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Slug: de-la-couleur-dans-les-logs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Author: Jean-Christophe Gay
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-lang: fr
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;disqus_identifier: 213 http://jeanchristophegay.com/?p=213&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Pour Hugo, il faut les transformer en :&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;title: &amp;#34;De la couleur dans les logs&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;date: 2013-05-04T18:22:00+02:00
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aliases:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - /de-la-couleur-dans-les-logs/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;slug: de-la-couleur-dans-les-logs
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;categories:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - java
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tags:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - ansi console
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - grep console
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - jansi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - log
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - log4j
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - log4j 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - logback
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;disqus_identifier: &amp;#34;213 http://jeanchristophegay.com/?p=213&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;---&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Toutes les options possibles sont listées dans &lt;a href="https://gohugo.io/content-management/front-matter/" target="_blank" rel="noreferrer"&gt;la documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;L&amp;rsquo;attribut &lt;code&gt;aliases&lt;/code&gt; est bien pratique pour conserver les anciennes URL générées par Pelican.&lt;/p&gt;
&lt;p&gt;Pelican : &lt;a href="https://jeanchristophegay.com/de-la-couleur-dans-les-logs/" target="_blank" rel="noreferrer"&gt;https://jeanchristophegay.com/de-la-couleur-dans-les-logs/&lt;/a&gt;
Hugo : &lt;a href="https://jeanchristophegay.com/posts/de-la-couleur-dans-les-logs/" target="_blank" rel="noreferrer"&gt;https://jeanchristophegay.com/posts/de-la-couleur-dans-les-logs/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;La balises &lt;code&gt;&amp;lt;!-- PELICAN_END_SUMMARY --&amp;gt;&lt;/code&gt; qui permettait de délimiter le résumé d&amp;rsquo;un article est remplacé par &lt;code&gt;&amp;lt;!--more--&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Pour le moment j&amp;rsquo;ai perdu la table des matières, apparemment certains thèmes permettent d&amp;rsquo;en générer une mais je n&amp;rsquo;ai pas encore essayé.&lt;/p&gt;
&lt;p&gt;Pour les articles disponibles en plusieurs langues, pas besoin de metadonnées, le suffixe dans le nom de fichier est suffisant.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Configuration
 &lt;div id="configuration" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#configuration" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;

&lt;h2 class="relative group"&gt;Site
 &lt;div id="site" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#site" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;La configuration se déroule dans un fichier &lt;code&gt;config.toml&lt;/code&gt; à la place de &lt;code&gt;pelicanconf.py&lt;/code&gt; et &lt;code&gt;publishconf.py&lt;/code&gt;. On y retrouve un peu le même genre d&amp;rsquo;options que dans Pelican.&lt;/p&gt;
&lt;p&gt;Pour exemple voici à quoi ressemble le mien à ce jour :&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;baseURL&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://jeanchristophegay.com/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;languageCode&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fr-FR&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Jean-Christophe Gay&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;beautifulhugo&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;disqusShortname&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;googleAnalytics&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;enableEmoji&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;enableGitInfo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;enableRobotsTXT&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;DefaultContentLanguage&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;fr&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fr&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;weight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;languages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;en&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;weight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="nx"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Home&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;weight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="nx"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Tags&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;tags&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;weight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;Params&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;subtitle&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Développeur&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;mainSections&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;post&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;posts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;logo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://www.gravatar.com/avatar/5cee6a7b8d17e4a0f367a5f0e237c694?s=200&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;dateFormat&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2 Jan 2006&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;rss&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;readingTime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;wordCount&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;socialShare&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;delayDisqus&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;showRelatedPosts&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Jean-Christophe Gay&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;website&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;jeanchristophegay.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;contact@jeanchristophegay.com&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;github&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;jcgay&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;gitlab&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;jcgay&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;twitter&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;jchristophegay&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;linkedin&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;jcgay&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 class="relative group"&gt;Coloration syntaxique
 &lt;div id="coloration-syntaxique" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#coloration-syntaxique" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Elle s&amp;rsquo;active dans la configuration :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pygmentsCodeFences = true
pygmentsUseClasses = true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Et il faut ensuite générer le style avec la commande :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hugo gen chromastyles --style=trac &amp;gt; static/css/syntax.css
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;J&amp;rsquo;ai activé le rendu &lt;a href="https://github.com/halogenica/beautifulhugo#chroma---new-server-side-syntax-highlighting" target="_blank" rel="noreferrer"&gt;côté serveur&lt;/a&gt; mais on peut aussi utilisé une version déportée dans &lt;a href="https://github.com/halogenica/beautifulhugo#highlightjs---client-side-syntax-highlighting" target="_blank" rel="noreferrer"&gt;le navigateur&lt;/a&gt; avec ce thème.&lt;/p&gt;
&lt;p&gt;C&amp;rsquo;est un point qu&amp;rsquo;il faut que je creuse encore un peu parce qu&amp;rsquo;en l&amp;rsquo;état le rendu n&amp;rsquo;est pas optimal, quand un bloc de code est un peu trop large on ne peut pas scrollé horizontalement&amp;hellip; 😅&lt;/p&gt;

&lt;h2 class="relative group"&gt;Commentaires
 &lt;div id="commentaires" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#commentaires" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Les commentaires du blog étant hébergés sur &lt;a href="https://disqus.com" target="_blank" rel="noreferrer"&gt;Disqus&lt;/a&gt;, la migration s&amp;rsquo;est bien déroulée.&lt;br&gt;
Il a suffit d&amp;rsquo;utiliser les bons &lt;code&gt;disqus_identifier&lt;/code&gt; pour chaque article.
Par contre au départ j&amp;rsquo;avais utilisé l&amp;rsquo;option &lt;code&gt;delayDisqus = true&lt;/code&gt; pour ne pas charger les commentaires par défaut (ça alourdi pas mal les pages de charger Disqus) mais cette option ne respecte pas par la suite les &lt;code&gt;disqus_identifier&lt;/code&gt; définis&amp;hellip; Ce qui rendait la récupération des anciens commentaires impossibles.&lt;/p&gt;
&lt;p&gt;Un de ces jours je jetterai un oeil aux &lt;a href="https://gohugo.io/content-management/comments/#comments-alternatives" target="_blank" rel="noreferrer"&gt;alternatives disponibles&lt;/a&gt; 😇.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Redirections
 &lt;div id="redirections" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#redirections" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;La possibilité de définir des alias pour chaque article a été suffisant pour gérer la migration des URL des articles, les ressources statiques n&amp;rsquo;ont pas bougées.
J&amp;rsquo;ai ajouté de nouvelles règles uniquement pour les flux RSS :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;RewriteRule feed/?$ index.xml [R=301,L]
RewriteRule feeds/? index.xml [R=301,L]
&lt;/code&gt;&lt;/pre&gt;

&lt;h1 class="relative group"&gt;Prévisualisation
 &lt;div id="prévisualisation" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#pr%c3%a9visualisation" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Pour voir le rendu de ce qu&amp;rsquo;on est en train d&amp;rsquo;écrire :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hugo serve
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Le contenu se recharche bien entendu à chaud.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Génération du site final
 &lt;div id="génération-du-site-final" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#g%c3%a9n%c3%a9ration-du-site-final" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Le site prêt à déployer est disponible dans le dossier &lt;code&gt;public&lt;/code&gt; après avoir lancé :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;hugo
&lt;/code&gt;&lt;/pre&gt;

&lt;h1 class="relative group"&gt;Conclusion
 &lt;div id="conclusion" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#conclusion" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;En 3 ou 4 heures j&amp;rsquo;ai réussi à avoir un rendu de mon blog à peu près équivalent au précédent.&lt;br&gt;
Je ne pensais pas que la migration se passerait aussi facilement 😎.&lt;br&gt;
Il reste 2 ou 3 réglages à faire mais je suis bien content de ne plus avoir à me compliquer la vie pour avoir un environnement stable Python pour générer ce site 🎇.&lt;/p&gt;</description></item><item><title>Migration de WordPress vers Pelican</title><link>https://jeanchristophegay.com/posts/migration-wordpress-pelican/</link><pubDate>Mon, 17 Mar 2014 20:31:00 +0200</pubDate><guid>https://jeanchristophegay.com/posts/migration-wordpress-pelican/</guid><description>&lt;p&gt;Retour sur la migration d&amp;rsquo;un blog construit avec &lt;a href="http://fr.wordpress.org/" target="_blank" rel="noreferrer"&gt;WordPress&lt;/a&gt; pour un site statique généré avec &lt;a href="http://getpelican.com/" target="_blank" rel="noreferrer"&gt;Pelican&lt;/a&gt;.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Mais pourquoi ?
 &lt;div id="mais-pourquoi-" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#mais-pourquoi-" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Tout simplement pour avoir quelque chose de plus léger&amp;hellip; J&amp;rsquo;avais volontairement gardé mon installation de WordPress minimaliste mais l&amp;rsquo;outil prends du poids par nature (en tout cas pour des fonctionalités que je n&amp;rsquo;utilisais pas).
Peu de plugins étaient installés mais les temps de chargement ne me convenaient pas (hébergement mutualisé pour du PHP).&lt;/p&gt;
&lt;p&gt;Comme j&amp;rsquo;écrivais déjà mes textes en &lt;a href="http://fr.wikipedia.org/wiki/Markdown" target="_blank" rel="noreferrer"&gt;Markdown&lt;/a&gt; pour les convertir en HTML et les coller dans l&amp;rsquo;éditeur de WordPress, j&amp;rsquo;ai sauté le pas pour un générateur de contenu statique.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Pelican
 &lt;div id="pelican" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#pelican" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Pelican est un générateur de site statique écrit en Python. Il supporte &lt;a href="http://fr.wikipedia.org/wiki/Markdown" target="_blank" rel="noreferrer"&gt;Markdown&lt;/a&gt;, &lt;a href="http://www.methods.co.nz/asciidoc/" target="_blank" rel="noreferrer"&gt;AsciiDoc&lt;/a&gt; et &lt;a href="http://docutils.sourceforge.net/rst.html" target="_blank" rel="noreferrer"&gt;reStructuredText&lt;/a&gt;.&lt;br&gt;
Il en existe une &lt;a href="http://staticsitegenerators.net/" target="_blank" rel="noreferrer"&gt;pléthore&lt;/a&gt;, les plus connus étant certainement &lt;a href="http://jekyllrb.com/" target="_blank" rel="noreferrer"&gt;Jekyll&lt;/a&gt; et &lt;a href="http://octopress.org/" target="_blank" rel="noreferrer"&gt;Octopress&lt;/a&gt;.&lt;br&gt;
J&amp;rsquo;ai choisi Pelican car il propose une fonctionalité &lt;a href="http://docs.getpelican.com/en/3.3.0/getting_started.html#translations" target="_blank" rel="noreferrer"&gt;multilangue&lt;/a&gt;, ce qu&amp;rsquo;il est possible de faire avec les autres mais pas de manière native.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Installation
 &lt;div id="installation" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#installation" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Pour l&amp;rsquo;utiliser avec OS X :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install python
pip install virtualenv

## Install Pelican
mkdir -p ~/virtualenvs/pelican
virtualenv ~/virtualenvs/pelican
cd ~/virtualenvs/pelican
. bin/activate
pip install pelican
pip install Markdown
pip install beautifulsoup4
pip install typogrify
pip install webassets
pip install cssmin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Sinon l&amp;rsquo;installation est détaillée &lt;a href="http://docs.getpelican.com/en/3.3.0/getting_started.html#installing-pelican" target="_blank" rel="noreferrer"&gt;ici&lt;/a&gt;.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Activer l&amp;rsquo;environnement Pelican
 &lt;div id="activer-lenvironnement-pelican" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#activer-lenvironnement-pelican" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;. ~/virtualenvs/pelican/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 class="relative group"&gt;Quitter l&amp;rsquo;environnement Pelican
 &lt;div id="quitter-lenvironnement-pelican" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#quitter-lenvironnement-pelican" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 class="relative group"&gt;Créer un site
 &lt;div id="créer-un-site" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#cr%c3%a9er-un-site" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Il suffit de lancer &lt;code&gt;pelican-quickstart&lt;/code&gt; et de suivre les instructions.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Welcome to pelican-quickstart v3.3.0.

This script will help you create a new Pelican-based website.

Please answer the following questions so this script can generate the files
needed by Pelican.


&amp;gt; Where do you want to create your new web site? [.] blog
&amp;gt; What will be the title of this web site? Jean-Christophe Gay
&amp;gt; Who will be the author of this web site? Jean-Christophe Gay
&amp;gt; What will be the default language of this web site? [en] fr
&amp;gt; Do you want to specify a URL prefix? e.g., http://example.com (Y/n) Y
&amp;gt; What is your URL prefix? (see above example; no trailing slash) http://jeanchristophegay.com
&amp;gt; Do you want to enable article pagination? (Y/n) Y
&amp;gt; How many articles per page do you want? [10]
&amp;gt; Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) Y
&amp;gt; Do you want an auto-reload &amp;amp; simpleHTTP script to assist with theme and site development? (Y/n) Y
&amp;gt; Do you want to upload your website using FTP? (y/N) N
&amp;gt; Do you want to upload your website using SSH? (y/N) N
&amp;gt; Do you want to upload your website using Dropbox? (y/N) N
&amp;gt; Do you want to upload your website using S3? (y/N) N
&amp;gt; Do you want to upload your website using Rackspace Cloud Files? (y/N) N
Done. Your new project is available at /Users/jcgay/blog
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Les source générées:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;blog
├── Makefile
├── content
│   ├── (pages)
├── develop_server.sh
├── fabfile.py
├── output
├── pelicanconf.py
└── publishconf.py

2 directories, 5 files
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 class="relative group"&gt;Ajouter du contenu
 &lt;div id="ajouter-du-contenu" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#ajouter-du-contenu" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Les articles doivent être ajoutés dans le dosser &lt;code&gt;content&lt;/code&gt;.
Il est possible d&amp;rsquo;extraire le contenu de WordPress pour l&amp;rsquo;importer dans Pelican : &lt;a href="http://docs.getpelican.com/en/3.3.0/importer.html#import" target="_blank" rel="noreferrer"&gt;http://docs.getpelican.com/en/3.3.0/importer.html#import&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Je ne l&amp;rsquo;ai pas testé car j&amp;rsquo;avais déjà des versions Markdown de mes articles. Je me suis contenté d&amp;rsquo;ajouter les métadonnées nécessaires à Pelican dans mes fichiers &lt;code&gt;.md&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Pour qu&amp;rsquo;un article soit indexé comme tel par Pelican, il faut ajouter les métadonnées:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Title: git-p4 au secours de Perforce
Date: 2012-03-18 18:10
Category: Scm
Tags: git, git-p4, perforce, p4
Slug: git-p4-au-secours-de-perforce
Author: Jean-Christophe Gay
lang: fr
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;La propriété &lt;code&gt;slug&lt;/code&gt; permettra de conserver les mêmes URLs que celles utilisées par WordPress.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Choisir un thème
 &lt;div id="choisir-un-thème" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#choisir-un-th%c3%a8me" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Les thèmes sont disponibles dans le repository &lt;a href="https://github.com/getpelican/pelican-themes" target="_blank" rel="noreferrer"&gt;https://github.com/getpelican/pelican-themes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Pour le moment j&amp;rsquo;ai choisi le thème &lt;a href="https://github.com/talha131/pelican-elegant" target="_blank" rel="noreferrer"&gt;elegant&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Cloner le répository des thèmes Pelican pour pouvoir les utiliser par la suite.&lt;/p&gt;

&lt;h2 class="relative group"&gt;Les plugins
 &lt;div id="les-plugins" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#les-plugins" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Pelican est extensible par l&amp;rsquo;intermédiaire de plugins. Ils sont répertoriés dans le repository &lt;a href="https://github.com/getpelican/pelican-plugins" target="_blank" rel="noreferrer"&gt;https://github.com/getpelican/pelican-plugins&lt;/a&gt;.
Comme pour les thèmes il suffit de cloner le repository dans l&amp;rsquo;emplacement de son choix.&lt;/p&gt;
&lt;p&gt;La liste des plugins que j&amp;rsquo;ai activé:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/sitemap" target="_blank" rel="noreferrer"&gt;sitemap&lt;/a&gt; : génère un fichier sitemap.xml pour l&amp;rsquo;indexation.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/tipue_search" target="_blank" rel="noreferrer"&gt;tipue_search&lt;/a&gt; : moteur de recherche au sein du site sans utiliser un service tiers.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/extract_toc" target="_blank" rel="noreferrer"&gt;extract_toc&lt;/a&gt; : extait une table des matières du contenu d&amp;rsquo;un article.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/optimize_images" target="_blank" rel="noreferrer"&gt;optimize_images&lt;/a&gt; : compresse les images &lt;code&gt;jpeg&lt;/code&gt; et &lt;code&gt;png&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/related_posts" target="_blank" rel="noreferrer"&gt;related_posts&lt;/a&gt; : affiche une liste d&amp;rsquo;article en relation avec l&amp;rsquo;article lu.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/summary" target="_blank" rel="noreferrer"&gt;summary&lt;/a&gt; : défini un résumé de l&amp;rsquo;article en utilisant le tag &lt;code&gt;&amp;lt;!-- PELICAN_END_SUMMARY --&amp;gt;&lt;/code&gt; dans les articles.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-plugins/tree/master/assets" target="_blank" rel="noreferrer"&gt;assets&lt;/a&gt; : permet de minifier/compiler les resources statiques.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 class="relative group"&gt;Configuration
 &lt;div id="configuration" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#configuration" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;La configuration est séparée en deux fichiers: &lt;code&gt;pelicanconf.py&lt;/code&gt; et &lt;code&gt;publishconf.py&lt;/code&gt;. Le second surcharge le premier avec les paramètres utilisés lors de la génération du site de production.&lt;/p&gt;
&lt;p&gt;Tous les paramètres sont documentés &lt;a href="http://docs.getpelican.com/en/3.3.0/settings.html" target="_blank" rel="noreferrer"&gt;ici&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Je n&amp;rsquo;ai pas rencontré de difficultés particulières, deux petites astuces quand même.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Pour générer des URLs identiques à celles que j&amp;rsquo;avais avec WordPress :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ARTICLE_URL = '{slug}'
 ARTICLE_SAVE_AS = '{slug}/index.html'
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Pour chaque article, un dossier est créé avec la valeur de la métadonnée &lt;code&gt;slug&lt;/code&gt; contenant un fichier index.html.&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;
&lt;p&gt;Il est possible de copier des fichiers avec la propriété &lt;code&gt;EXTRA_PATH_METADATA&lt;/code&gt; :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; EXTRA_PATH_METADATA = {
 'extra/humans.txt': {'path': 'humans.txt'},
 'extra/robots.txt': {'path': 'robots.txt'},
 'extra/.htaccess': {'path': '.htaccess'},
 }
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 class="relative group"&gt;Les commentaires
 &lt;div id="les-commentaires" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#les-commentaires" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Si vous utilisez le système de commentaires de WordPress, il faut les migrer vers un service externe, par exemple &lt;a href="http://disqus.com/" target="_blank" rel="noreferrer"&gt;Disqus&lt;/a&gt;.
C&amp;rsquo;est déjà ce que j&amp;rsquo;utilisais mais sinon il suffit d&amp;rsquo;installer le &lt;a href="http://wordpress.org/plugins/disqus-comment-system/" target="_blank" rel="noreferrer"&gt;plugin&lt;/a&gt; WordPress.&lt;/p&gt;
&lt;p&gt;Pour chacun des articles, ajouter l&amp;rsquo;identifiant de chaque fil de discussion :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;disqus_identifier: 7 http://jeanchristophegay.com/?p=7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C&amp;rsquo;est supporté par le thème &lt;code&gt;elegant&lt;/code&gt;.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Règles de redirection
 &lt;div id="règles-de-redirection" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#r%c3%a8gles-de-redirection" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Il faut réécrire les URLs qui vont disparaitre pour ne pas perdre toutes vos URLs qui se baladent dans la nature.&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-apacheconf" data-lang="apacheconf"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;IfModule&lt;/span&gt; &lt;span class="s"&gt;mod_rewrite.c&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteEngine&lt;/span&gt; &lt;span class="k"&gt;On&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteBase&lt;/span&gt; /
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; feed/?$ feeds/rss.xml [R=301,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; wp-content/uploads/2013/03/Capture-d’écran-2013-03-09-à-11.24.20-300x182.png images/p4merge-mini.png [R=301,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; wp-content/uploads/2013/03/Capture-d’écran-2013-03-09-à-11.24.20.png images/p4merge.png [R=301,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Redirect wp-content/uploads/2012/03/git-p4.png to images/git-p4.png&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; wp-content/uploads/[0-2][0-9][0-9][0-9]/[0-1][0-9]/([^/]+) images/$1 [R=301,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Redirect 2012/04 to archives.html#2012&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; ([0-2][0-9][0-9][0-9])/[0-1][0-9]/? archives.html#$1 [R=301,NE,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Redirect category/slug/ to categories.html#slug-ref&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; category/([^/]+)/? categories.html#$1-ref [R=301,NE,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Redirect tag/slug/ to tags.html#slug-ref&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; tag/([^/]+)/? tags.html#$1-ref [R=301,NE,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Redirect author/jcgay/ to /&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;RewriteRule&lt;/span&gt; author/jcgay/? / [R=301,L]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/IfModule&amp;gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 class="relative group"&gt;Tester/Publier son site
 &lt;div id="testerpublier-son-site" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#testerpublier-son-site" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Pour générer le site, lancer &lt;code&gt;make html &amp;amp;&amp;amp; make serve&lt;/code&gt;.&lt;br&gt;
Le contenu est généré dans le dossier &lt;code&gt;output&lt;/code&gt; et accessible via &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Le contenu final est disponible en utilisant &lt;code&gt;make publish&lt;/code&gt;. Il ne reste qu&amp;rsquo;à uploader le contenu en ligne.&lt;/p&gt;

&lt;h1 class="relative group"&gt;Conclusion
 &lt;div id="conclusion" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#conclusion" aria-label="Ancre"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;Je suis plutôt satisfait du résultat, tout le site est généré à partir d&amp;rsquo;un simple repository git, celà permet de versionner correctement le contenu du site et j&amp;rsquo;ai les fonctionalités nécessaires à la publication de quelques articles de temps en temps. Mission Accomplie !&lt;/p&gt;</description></item></channel></rss>