lentejanumerica/generasitio.sh

30 lines
926 B
Bash
Raw Normal View History

2021-05-20 00:06:21 +00:00
#!/bin/sh
echo "revisando y copiando imágenes..."
for f in $(find src/ -regextype awk -regex ".*(jpg|png|gif)")
do
path="web/${f#src/}" # quita el prefijo de src/ y agrega web/
mkdir -p $(dirname $path) # crea directorio si no existe
cp -vu $f $path
done
echo "revisando y convirtiendo archivimos gmi a html..."
# convierte y actualiza archivos gmi a html
for f in $(find src/ -iname *.gmi)
do
path=${f#src/} # quita el prefijo de "src/"
htmlpath="web/${path%gmi}html" # agrega "web/" y cambia el sufijo
2021-05-20 01:36:07 +00:00
gempath="gem/${path}" # agrega "gem/"
# if [ $f -nt $htmlpath ] # si archivo gmi es "newer than" el html
# then
2021-05-20 00:06:21 +00:00
echo "${f} -> ${htmlpath}"
2021-05-20 01:36:07 +00:00
echo "${f} -> ${gempath}"
# mkdir -p $(dirname $htmlpath) # crea el directorio si no existe
# mkdir -p $(dirname $htmlpath) # crea el directorio si no existe
2021-05-20 00:06:21 +00:00
# haz la conversión
awk -f gemtext2html.awk $f > $htmlpath
2021-05-20 01:36:07 +00:00
awk -f gem2gem.awk $f > $gempath
# fi
2021-05-20 00:06:21 +00:00
done