home · contact · privacy
Re-write date handling, remove dependency on filesystem lastmod dates.
[redo-blog] / README.md
1 redo-blog
2 =========
3
4 small blog system using the redo build system, with blog article files written
5 in (pandoc) Markdown or ReStructured Text.
6
7 dependencies
8 ------------
9
10 - redo
11 - python3
12 - uuidgen (Debian package: uuid-runtime)
13 - html2text
14 - pandoc
15
16 testing
17 -------
18
19 Run ./test.sh.
20
21 setup
22 -----
23
24 To set up a directory with symbolic links to the relevant files in ./processor/,
25 run ./add_dir.sh DIRECTORY.
26
27 You can then enter the directory and run redo there. This will generate article
28 .html files from all .md and .rst files, plus a ./index.html, and a ./feed.xml.
29 These files will be linked to symbolically in a directory ./public/.
30
31 Some metadata files will also be generated below ./metadata/: For each article,
32 there will be generated a .automatic_metadata (to contain an article's UUID,
33 checksum, and creation/modification dates) and a .intermediate file (to contain
34 pandoc-formatted article content like title and body); furthermore, files for
35 data used in ./feed.xml and ./index.html will, if non-existant, be built there
36 and can be edited to customize the blog – namely the files url, author, title,
37 index.tmpl, index_snippet.tmpl, article.tmpl. A blog-specific UUID and creation
38 date is stored in ./metadata/automatic_metadata
39
40 recipe to remotely manage a redo blog with git
41 ----------------------------------------------
42
43 On your server, install the dependencies listed above. Then set up a repository
44 for your blog files. Let's assume we want it to sit in our home directory and be
45 called `blog`:
46
47     cd ~
48     mkdir blog
49     git init --bare blog.git
50     cat << EOF > blog.git/hooks/post-update
51     #!/bin/sh
52     BLOGDIR=~/blog
53     GIT_WORK_TREE=\$BLOGDIR git checkout -f
54     cd \$BLOGDIR
55     redo
56     EOF
57     chmod a+x blog.git/hooks/post-update
58
59 Enable management of `~/blog` via redo-blog:
60
61     git clone https://github.com/plomlompom/redo-blog/
62     cd redo-blog/
63     ./add_dir.sh ~/blog
64     mkdir ~/blog/public
65
66 Link to the `public` subdirectory from wherever your web server expects your
67 public web content to sit:
68
69     ln -s ~/blog/public /var/www/html/blog
70
71 Client-side, do this (you obviously need to customize this code; at least
72 replace the username `user` and the server name `example.org`):
73
74     cd ~
75     git init blog
76     cd blog
77     git remote add origin ssh://user@example.org:/home/user/blog.git
78     mkdir metadata
79     echo 'https://example.org/blog/' > metadata/url
80     git add metadata/url
81     git commit -m 'set up blog metadata'
82     git push origin master
83
84 bugs and peculiarities
85 ----------------------
86
87 Don't create a index.rst or index.md in the redo-managed directory, that will
88 break things.
89
90 The article title is derived in .md files from a first line prefixed with `%`,
91 while all other headings are treated as sub-headings. In .rst files, the title
92 is derived from a heading that must be at the top of the document, and be of an
93 adornment style (such as underlining with `=`) that must be used only once in
94 it.