francescomecca.eu/output/categories/static-blog.xml
Francesco Mecca 6acba75cd5 wine article
2024-02-28 14:38:55 +01:00

37 lines
No EOL
5.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about static blog)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/static-blog.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 &lt;a href="mailto:francescomecca.eu"&gt;Francesco Mecca&lt;/a&gt; </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>How I migrated to a static blog</title><link>francescomecca.eu/blog/2016/4/2/blog-migrated/</link><dc:creator>Francesco Mecca</dc:creator><description>&lt;p&gt;Until one week ago my blog was hosted at my house, on a raspberrypi with debian + wordpress. I was not satisfied by my setup because given the minimal size of my blog and the really scarce content I post every now and then, a full LLMP stack was overblown.
I decided to change distribution (my server now runs &lt;a href="http://www.voidlinux.eu/"&gt;Void&lt;/a&gt;) and to migrate to a static blog without CMS nor PHP.&lt;/p&gt;
&lt;h2&gt;Welcome to Jekyll and Hyde&lt;/h2&gt;
&lt;p&gt;The process of migration was rather painless.
First of all I installed ruby on my desktop computer, then via ruby gems I installed jekyll:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gem install jekyll&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gem install jekyll-gist&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gem install jekyll-paginate&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I used a &lt;a href="https://wordpress.org/plugins/jekyll-exporter/"&gt;wordpress plugin&lt;/a&gt; to copy all my old posts.
Then I cloned from &lt;a href="https://github.com/poole/hyde"&gt;git&lt;/a&gt; the Hyde theme which you can see a demo &lt;a href="http://hyde.getpoole.com/"&gt;here&lt;/a&gt; and corrected a pair of warning that jekyll printed on my terminal. Actually the &lt;a href="http://jekyllrb.com/docs"&gt;jekyll docs&lt;/a&gt; are quite complete and covered all the errors that I encountered.&lt;/p&gt;
&lt;p&gt;Jekyll structure is quite simple to understand: in the folder _post/ there are your post in markdown format (remember to delete the examples in that folder);
in the root the are some files that should be modified: the about.md file, the 404 page and index.html that is the frontpage of the blog;
finally _config.yml contains the general configuration for the website and should be adjusted to your own likings.
When Jekyll builds a website it parses all the markdown files and stores them in _site folder. Jekyll uses the html files in _layouts and _includes to render the markdown files.A&lt;/p&gt;
&lt;p&gt;I added a simple &lt;a href="http://francescomecca.eu/archive/"&gt;archive page&lt;/a&gt; following the little piece of code in &lt;a href="http://joshualande.com/jekyll-github-pages-poole/"&gt;this page&lt;/a&gt;
{% raw %}
---
layout: page
title: Archive
---&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="x"&gt;## Blog Posts&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;post&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;site.posts&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="x"&gt; * &lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;post.date&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nf"&gt;date_to_string&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="x"&gt; &amp;amp;raquo; [ &lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;post.title&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="x"&gt; ](&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;post.url&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="x"&gt;)&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endfor&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;&lt;span class="x"&gt;:wq&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;{% endraw %}
I noticed that in _includes/head.html there is this line:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;link&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//fonts.googleapis.com/css?family=Open+Sans:400,300,700,800,600' rel='stylesheet' type='text/css'&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;so I proceed to remove it because is not needed for my blog.
Finally I put a link to the archive, my github page and the atom feed on the sidebar by simple adding a href on _includes/sidebar.html.&lt;/p&gt;
&lt;p&gt;I did not proceed with further modifications but there are tons of possibilities with jekyll. I think that the main advantages are the fact that you don't have to manage html code when writing a new post and that everything can be done via cli.&lt;/p&gt;
&lt;p&gt;Francesco Mecca&lt;/p&gt;</description><category>jekyll</category><category>PesceWanda</category><category>static blog</category><guid>francescomecca.eu/blog/2016/4/2/blog-migrated/</guid><pubDate>Sat, 02 Apr 2016 00:00:00 GMT</pubDate></item></channel></rss>