blob: 4ffcaf371d7f18faf3831579d609b1083c4c9c48 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/sh
# creates a $1_xhtml dir and that's your root
rsync -r "./${1}/" "./${1}_xhtml/"
cd "./${1}_xhtml" || exit
printf "Converting gmi->html..."
for file in $(find ./* | grep ".gmi" | sed 's/.gmi//'); do
g2x < "./${file}.gmi" > "./${file}.html"
rm "./${file}.gmi"
done
printf "done\n"
# this down removes duplicate files
# symlink them to the capsule root folder files
printf "Fixing duplicates..."
for file in $(find ./* -type f | grep -v ".html"); do
ln -sf ../../"${1}"/${file} "./${file}"
done
printf "done\n"
|