-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpelican.html
236 lines (208 loc) · 12.2 KB
/
pelican.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="https://ihommani.github.io/theme/stylesheet/style.min.css">
<link rel="stylesheet" type="text/css" href="https://ihommani.github.io/theme/pygments/github.min.css">
<link rel="stylesheet" type="text/css" href="https://ihommani.github.io/theme/font-awesome/css/font-awesome.min.css">
<link href="https://ihommani.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Thinking about... Atom">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="" />
<meta name="author" content="ihommmani" />
<meta name="description" content="How did I choose Pelican as my static blog generator" />
<meta name="keywords" content="generator">
<meta property="og:site_name" content="Thinking about..."/>
<meta property="og:title" content="Pelican"/>
<meta property="og:description" content="How did I choose Pelican as my static blog generator"/>
<meta property="og:locale" content="en_US"/>
<meta property="og:url" content="https://ihommani.github.io/pelican.html"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="2014-01-09 23:58:00+01:00"/>
<meta property="article:modified_time" content=""/>
<meta property="article:author" content="https://ihommani.github.io/author/ihommmani.html">
<meta property="article:section" content="technical"/>
<meta property="article:tag" content="generator"/>
<meta property="og:image" content="">
<title>Thinking about... – Pelican</title>
</head>
<body>
<aside>
<div>
<a href="https://ihommani.github.io">
<img src="https://www.gravatar.com/avatar/b61c1c8bd89ffd6a81e277b408290009?s=210" alt="Thinking about..." title="Thinking about...">
</a>
<h1><a href="https://ihommani.github.io">Thinking about...</a></h1>
<p>Yet another opiniated blog</p>
<nav>
<ul class="list">
<li><a href="https://ihommani.github.io/pages/about.html#about">about</a></li>
</ul>
</nav>
<ul class="tag-cloud">
</ul>
<ul class="social">
<li><a class="sc-twitter" href="http://twitter.com/ihommani" target="_blank"><i class="fa fa-twitter"></i></a></li>
<li><a class="sc-github" href="http://github.com/ihommani" target="_blank"><i class="fa fa-github"></i></a></li>
<li><a class="sc-flickr" href="http://www.flickr.com/photos/chaiyachaiya/" target="_blank"><i class="fa fa-flickr"></i></a></li>
</ul>
</div>
</aside>
<main>
<article class="single">
<header>
<h1 id="pelican">Pelican</h1>
<p>
Posted on jeu. 09 janvier 2014 in <a href="https://ihommani.github.io/category/technical.html">technical</a>
</p>
</header>
<div>
<h1>Presenting Pelican</h1>
<p>When I'm reading a blog, besides the article, i'm also interested about the technology behind it.
At first it was just good curiosity, to keep me up to date and see what reviews were made on it.
Then I started this blog. So I had to make my choice. And a clever one i.e adapted to my needs.
This choice was guided by these simple needs: </p>
<ul>
<li>My blog has to be simple to host</li>
<li>The tool generating it must be easy to handle</li>
<li>The communauty behind it active</li>
<li>Allow internationalisation i.e multi-languages articles</li>
</ul>
<p>When it comes to host a site, there is no simpler than pure Html. No database, no logic, only text.
For this, static site generators are great. You give markup language file in input and you get html in output.
There are a <a href="http://staticsitegenerators.net/" title="generators list">lot of them</a> out there. Each with a different technology, architecture... a different flavour. To give a try to each of them would take a long time so I mainly relied on my previous first searches to filter.
Github kindly provides free hosting through <a href="http://pages.github.com/, gh-pages">github-pages</a>. I took this oppurtunity and follow their tutorial taking advantage on the Jekyll generator.
But I encountered Pelican in my search and finally switched to it. </p>
<p>This article provides answers on why I chose Pelican and not other generator. <br />
<strong>This is not a tutorial. The official tutorial is enough <a href="http://docs.getpelican.com/en/latest/" title="pelican doc">documented</a> for this.</strong> </p>
<h2><a href="http://jekyllrb.com/" title="Jekyll">Jekyll</a></h2>
<h3>First encounter</h3>
<p>Like I said, I had my first static site generator experience with Jekyll. Unlike general first experiences, this, was not painful.
Thanks to a good <a href="http://jekyllrb.com/docs/home/" title="jekyll tuto">tutorial</a> I had a functional blog in less than an afternoon.
Jekyll engine is based on Ruby and take advantage of the liquid templating language.
Unfortunately after the basic HelloWorld, discord begun.<br />
Still, Jekyll is not a bad choice and provided me with a better understanding of static site generator workflow.</p>
<h3>The good</h3>
<ul>
<li>
<p>Fairly simple</p>
</li>
<li>
<p>Publishing is as easy as pushing a commit. </p>
</li>
<li>
<p>Using YAML for configuration</p>
</li>
</ul>
<h3>The bad</h3>
<ul>
<li><em>Theming system</em>:</li>
</ul>
<p>In Jekyll you have to specify on each post the layout to apply on it. When constructing a blog it's clearly the same layout we want for each post.
So it obviously left me a taste of duplication. If we want to change the theme, we have to change on each post the layout metadata which can be very tedious and error prone. (may you master awk...) .</p>
<ul>
<li><em>Internationalisation</em> </li>
</ul>
<p>Through this blog I want to write in several languages. It's not cocky at all it's just about reaching a wider audience.
English is good for this but in my opinion it's better to show we also care about other languages. We don't only code in Java, C# or C++. We do also code in Python, Ruby, Javascript...
So let's consider languages like code languages.
Jekyll, is good to distinct categories and tag, but languages, its none. We cannot simply say that: "Look, those two articles are in fact the same. They do not share the same language, that's all".
I don't say you can't reach this, I'm just saying that it is not native in Jekyll. Someone proposed to use <a href="http://www.garron.me/en/blog/jekyll-multi-language.html" title="blog">category</a> as a substitute to language. In my opinion it's not the good way to do it. Language is not a category. If I have category movie with a post in english and chinese I have to make my choice
between one category "Movie" and two categories "English" and "Chinese".
What I want is one category "Movie" and a link to switch from one language to another.</p>
<ul>
<li><em>Integration with other sites</em></li>
</ul>
<p>I put it in the drawbacks but it depends on your preference. You can say I want to choose my own analytic system or comment system. In that case Jekyll
is Ok for you. Or you can choose to prefer to only specify throuh configuration just one identifier you were provided with (disqus, ga...) and let the engine take care of the integration for you. No copy/paste needed in templates. </p>
<h2><a href="http://blog.getpelican.com/" title="pelican">Pelican</a></h2>
<p>I knew Pelican before Jekyll but never gave it a try.
Pelican engine is built on top of Python and for this reason use the Jinja2 templating language.
It's a young project with a wide community of users and commiters.</p>
<h3>The good: How does it fit to my needs</h3>
<ul>
<li>
<p><em>Plugins</em>
Pelican provides an easy way to add features through plugins.
There's github page
To add a plugin to your site, you just have to specify the name in the setting file through the SETTING variable.
<a href="https://github.com/getpelican/pelican-plugins ," title="pelican plugins">Here</a> is a list of plugins you can try.</p>
</li>
<li>
<p><em>Themes</em> </p>
</li>
</ul>
<p>Pelican had a theming system somehow different from Jekyll's one. With Pelican it's more like a Plug'n play system.
Instead of manually specifying the layout on each post, you only precise once in the config file the Theme name.
Moreover, there are plenty of <a href="http://pelicanthemes.com/" title="themes">them</a> hosted by gitHub. Pelican gives you a tool to manage themes installation and uninstall with pelican-theme CLI.
If you want to change your UI, you only have to change a metadata in the configfile and boom.
To bypass the theme, there is a possibility generate custom pages besides your blog entries. You can point any Jinja2 template file with a path pointing to the file and the destination path for the generated file.
Pelican also provide a usefull command <em>pelican-theme</em> to manage themes properly.</p>
<ul>
<li><em>Internationalisation</em> </li>
</ul>
<p>Pelican is "traduction ready". That is to say, you can bound N articles as being the same article but with a different language.
For this, you just have to add two metadatas in your post:</p>
<p><strong>The slug</strong><br />
<em>Slug</em> is the link between the articles. All articles with the same slug will be considered as being the same.</p>
<p><strong>The Language</strong><br />
It comes with <em>slug</em> and specify the link's name which will allow to switch beetween versions. An error will occur at the generation if you forget it. </p>
<ul>
<li><em>Integration with other sites</em></li>
</ul>
<p>Pelican's themes already embed some link to sites like Disqus or google-analitycs. You only have to specify in the config-file your identifiers.
I think it's good idea for it does all the work for you. You don't have to copy paste anything in the layout because it's already there.
If you're not fine with those sites you still can modify the templates. (to know the path: pelican-themes -lv)
And remember that most of metadatas you specify in the config file are variables used in the layout by Jinja.</p>
<h3>The bad</h3>
<ul>
<li><em>Github hosting</em></li>
</ul>
<p>Unfortunately Pelican directory structure can't be pushed directly to the gh-pages repository. <br />
But thanks to the tool <a href="https://github.com/davisp/ghp-import" title="ghp-import">ghp-import</a> it very easy.</p>
<h2>Conclusion</h2>
<p>What can be said from all of that ?
Jekyll and Pelican are very similar. I guess it's a constant when talking about static site generator. Differences lay in the details.
When it comes to construct a static site, Jekyll is a good to go. The liberty it provides is clearly an asset.
But when it comes to construct a blog, you should give a try to Pelican. From my point of view, Pelican is more adapted for this than Jekyll.
I see Pelican as an evolution of Jekyll specially adapted to my needs.
It provides me with a better experience and a smoother workflow.</p>
<p>Mentionable: I haven't tried yet at the time I'm writting this article but It seems that <a href="http://ruhoh.com/" title="ruho">Ruho</a> could also be a good choice. </p>
</div>
<div class="tag-cloud">
<p>
<a href="https://ihommani.github.io/tag/generator.html">generator</a>
</p>
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'ihommani';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>
Please enable JavaScript to view comments.
</noscript>
</article>
<footer>
<p>© ihommani </p>
<p> Powered by <a href="http://getpelican.com" target="_blank">Pelican</a> - <a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a> theme by <a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a>
</p> </footer>
</main>
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Blog",
"name": " Thinking about... ",
"url" : "https://ihommani.github.io",
"image": "",
"description": ""
}
</script>
</body>
</html>