X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=README.md;h=aa70d01cccd47bad4d3934a4ada8bd2378da9803;hb=a5038d1a208239f63666e6ae40073fe250a4046d;hp=a0071b3473e19ed7f2b6dd54fac3971a7074f7ca;hpb=13dfbc049a5d1a6a4f5b6f2453b39542779300b0;p=redo-blog
diff --git a/README.md b/README.md
index a0071b3..aa70d01 100644
--- a/README.md
+++ b/README.md
@@ -29,10 +29,13 @@ You can then enter the directory and run redo there. This will generate article
These files will be linked to symbolically in a directory ./public/.
Some metadata files will also be generated below ./metadata/: For each article,
-there will be generated a .uuid and a .intermediate file; furthermore, files for
+there will be generated a .automatic_metadata (to contain an article's UUID,
+checksum, and creation/modification dates) and a .intermediate file (to contain
+pandoc-formatted article content like title and body); furthermore, files for
data used in ./feed.xml and ./index.html will, if non-existant, be built there
-and can be edited to customize the blog â namely the files url, author, uuid,
-title, index.tmpl, index_snippet.tmpl, article.tmpl.
+and can be edited to customize the blog â namely the files url, author, title,
+index.tmpl, index_snippet.tmpl, article.tmpl. A blog-specific UUID and creation
+date is stored in ./metadata/automatic_metadata
recipe to remotely manage a redo blog with git
----------------------------------------------
@@ -46,10 +49,22 @@ called `blog`:
git init --bare blog.git
cat << EOF > blog.git/hooks/post-update
#!/bin/sh
- BLOGDIR=~/blog
- GIT_WORK_TREE=\$BLOGDIR git checkout -f
- cd \$BLOGDIR
+ blog_dir=~/blog
+ export GIT_DIR=\$(pwd)
+ export GIT_WORK_TREE="\$blog_dir"
+ git checkout -f
+ cd "\$GIT_WORK_TREE"
redo
+ git add metadata/author metadata/url metadata/title metadata/*.tmpl metadata/automatic_metadata
+ count=\$(ls -1 metadata/*.automatic_metadata 2>/dev/null | wc -l)
+ if [ "\$count" != 0 ]; then
+ git add metadata/*.automatic_metadata
+ fi
+ status=\$(git status -s)
+ n_updates=\$(printf "\$status" | grep -vE '^\?\?' | wc -l)
+ if [ "\$n_updates" -gt 0 ]; then
+ git commit -a -m 'Update metadata'
+ fi
EOF
chmod a+x blog.git/hooks/post-update
@@ -65,7 +80,8 @@ public web content to sit:
ln -s ~/blog/public /var/www/html/blog
-Client-side, do this (obviously, replace server and username):
+Client-side, do this (you obviously need to customize this code; at least
+replace the username `user` and the server name `example.org`):
cd ~
git init blog
@@ -77,14 +93,20 @@ Client-side, do this (obviously, replace server and username):
git commit -m 'set up blog metadata'
git push origin master
+If successful, the git hook will furthermore commit some ~/blog/metadata/ files
+generated by redo, that can be pulled into the client-side local repository:
+
+ git pull origin master
+
bugs and peculiarities
----------------------
Don't create a index.rst or index.md in the redo-managed directory, that will
break things.
-The article title is derived in .md files from a first line prefixed with "% ",
+The article title is derived in .md files from a first line prefixed with `%`,
while all other headings are treated as sub-headings. In .rst files, the title
is derived from a heading that must be at the top of the document, and be of an
-adornment style (such as underlining with "=") that must be used only once in
-it.
+adornment style (such as underlining with `=`) used only once in it.
+
+Symbolic links in public/ to removed article pages are currently not removed.