francescomecca.eu/output/categories/static-blog.xml

39 lines
5.3 KiB
XML
Raw Normal View History

2018-11-10 18:19:00 +01:00
<?xml version="1.0" encoding="utf-8"?>
2019-03-06 10:42:59 +01:00
<?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 © 2019 &lt;a href="mailto:francescomecca.eu"&gt;Francesco Mecca&lt;/a&gt; </copyright><lastBuildDate>Wed, 06 Mar 2019 09:27:55 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;div&gt;&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.
2018-11-10 18:19:00 +01:00
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;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&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="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;p&gt;{% endraw %}
I noticed that in _includes/head.html there is this line:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&amp;lt;link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700,800,600' rel='stylesheet' type='text/css'
&lt;/pre&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;&lt;/div&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>