1
0
mirror of https://github.com/ru-de/faq.git synced 2024-11-10 04:31:01 +00:00
faq-de/update.sh

26 lines
583 B
Bash
Raw Normal View History

2018-02-13 22:46:34 +00:00
#!/bin/bash
2018-01-02 18:12:55 +00:00
DE_FAQ_DIR=/tmp/de_faq
rm -rf $DE_FAQ_DIR
git clone https://github.com/ru-de/faq.git $DE_FAQ_DIR --depth=1
rm $DE_FAQ_DIR/CONTRIBUTING.md
2018-01-02 18:35:29 +00:00
2018-02-13 23:36:34 +00:00
(echo -e "---\nlayout: default\n---\n"; cat "$DE_FAQ_DIR/README.md") > index.md
2018-01-02 18:12:55 +00:00
rm $DE_FAQ_DIR/README.md
mkdir $DE_FAQ_DIR/tmp_pages
for file in $DE_FAQ_DIR/*.md; do
bname=$(basename "$file")
title=$(basename "$file" .md)
2018-02-13 22:46:34 +00:00
(echo -e "---\ntitle: $title\nlayout: default\n---\n"; cat "$file") > "$DE_FAQ_DIR/tmp_pages/$bname"
2018-01-02 18:12:55 +00:00
done
rm -rf pages
mkdir pages
cp -R $DE_FAQ_DIR/files pages
cp $DE_FAQ_DIR/tmp_pages/*.md pages