From 9cceff5fa6669b66e03aac131430bed2d8054b7c Mon Sep 17 00:00:00 2001 From: Guy Godfroy Date: Thu, 7 May 2020 08:01:36 +0200 Subject: [PATCH] add test page --- content/posts/test.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 content/posts/test.md diff --git a/content/posts/test.md b/content/posts/test.md new file mode 100644 index 0000000..2127945 --- /dev/null +++ b/content/posts/test.md @@ -0,0 +1,42 @@ +--- +title: Page de test +date: 2020-05-07 +author: raspbeguy +template: post +--- + +```bash +#!/bin/bash + +cat redmine.meta | while read line +do + path=$(echo "$line" | cut -f1) + title=$(echo "$line" | cut -f2) + author=$(echo "$line" | cut -f3) + + if [ -f "textile/$path.md" ] + then + file="textile/$path.md" + echo "$path has been resolved to $file" + elif [ -f "textile/$path/index.md" ] + then + file="textile/$path/index.md" + echo "$path has been resolved to $file" + else + echo "Couldn't resolve $path" + break + fi + + tmpfile=$(mktemp "${TMPDIR:-/tmp/}$(basename $0).XXXX") + echo "---" >> $tmpfile + echo "Title: $title" >> $tmpfile + if [ ! -z "$author" ] + then + echo "Author: $author" >> $tmpfile + fi + echo "---" >> $tmpfile + echo "" >> $tmpfile + cat $file >> $tmpfile + mv -f $tmpfile $file +done +```