summaryrefslogtreecommitdiffstats
path: root/content/posts/revive-euer-blog.rst
blob: a6470ced3c16933339f649fd99069d38e1662627 (plain)
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
Revive this Blog
##################################
:date: 2013-02-17 14:26
:tags: openssh, dropbear

2 years ago i lost this blog in an unexpected VPS shutdown and of course i had
no backups (duh!) and had not used any kind of version management.  
Thanks to archive.org at least the content of the blog left intact. I guess
that's why it is sometimes called **'The WaybackUp Machine'**.

My old blog can be found at
https://web.archive.org/web/20121213091551/http://euer.krebsco.de/ and  
even the rss feed is intact. 


The old blog was created using **octopress**, a static site generator written in
ruby. Because the markdown files were essentially lost i thought it is time to
try out something new.  
I chose **pelican**, a static site generator written in python because in a
worst-case scenario i could fix the python code. I will also test out
reStructured Text instead of Markdown.

Installation of pelican
-----------------------

.. code-block:: bash

    #?/bin/sh
    virtualenv my-blog
    cd my-blog
    . bin/activate
    pip install pelican
    pelican-quickstart
      ...

Importing RSS
-------------
Pelican supports importing old rss feeds.
I tried importing the archive.org rss feed but besides the date and title of
the post and the date the markup was pretty much broken, the code with line
numbering resulted in a broken <pre>-table. This happens for rst and markdown
output.

In addition the importer uses pandoc, a haskell markup transformer which is
with all dependencies like 100mb in size.

For the records here is what was needed:

.. code-block:: bash

    #? /bin/sh
    . bin/activate
    yaourt -Sy aur/pandoc-static
    pelican-import --feed https://web.archive.org/web/20120709004415/http://euer.krebsco.de/atom.xml -o content/posts
    # cleanup all the posts in content/posts

Configure pelican 
-----------------
Pelican needs to be configured in ``pelicanconf.py``:

.. code-block:: python
    
    AUTHOR = 'makefu'
    SITENAME = 'only code is pure'
    # rss feed to be built
    FEED_ALL_ATOM = 'feeds/all.atom.xml'
    # for RSS in the headline
    MENUITEMS = (( 'RSS', '/feeds/all.atom.xml'),)

    # add robots.txt
    STATIC_PATHS = [ 'extra/robots.txt', ]
    EXTRA_PATH_METADATA = { 'extra/robots.txt': {'path': 'robots.txt'}, }
    
    # twitter link
    SOCIAL = (('@makefoo', 'http://twitter.com/makefoo') ,)
    # add disqus comments
    DISQUS_SITENAME = 'euer'
    # all the other lines of config


Configure themes
----------------
Themes need to be retrieved separately.

.. code-block:: bash
   
    #? /bin/sh
    # omit --recursive for a subset, gum is in the core
    git clone --recursive https://github.com/getpelican/pelican-themes themes

    # add the theme line to pelicanconf
    echo 'THEME="themes/gum"' >> pelicanconf.py