1
0
mirror of https://github.com/ru-de/faq.git synced 2024-11-09 20:21:01 +00:00
faq-de/update.sh
Evgeniy Sokolov 5ef8f27e0f gh-pages
2018-01-02 19:12:55 +01:00

26 lines
622 B
Bash

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
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)
(echo "---\ntitle: $title\nlayout: default\n---\n"; cat "$file") > "$DE_FAQ_DIR/tmp_pages/$bname"
done
sed -i -- 's/ewgRa\/de_faq/ru-de\/faq/g' $DE_FAQ_DIR/tmp_pages/*.md
rm -rf pages
mkdir pages
cp -R $DE_FAQ_DIR/files pages
sed -i -- 's/ewgRa\/de_faq/ru-de\/faq/g' pages/files/known_url.csv
cp $DE_FAQ_DIR/tmp_pages/*.md pages