diff options
author | sejo <sejo@texto-plano.xyz> | 2021-05-19 19:06:21 -0500 |
---|---|---|
committer | sejo <sejo@texto-plano.xyz> | 2021-05-19 19:06:21 -0500 |
commit | 82b994447214af187f05083f1fff33a78f92b1a8 (patch) | |
tree | 20b9ae4b554b83cd43a4e9b1f567d8b39e19c5cc /generasitio.sh | |
download | sitio-82b994447214af187f05083f1fff33a78f92b1a8.tar.gz |
archivos iniciales
Diffstat (limited to 'generasitio.sh')
-rwxr-xr-x | generasitio.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/generasitio.sh b/generasitio.sh new file mode 100755 index 0000000..2adab59 --- /dev/null +++ b/generasitio.sh @@ -0,0 +1,25 @@ +#!/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 + if [ $f -nt $htmlpath ] # si archivo gmi es "newer than" el html + then + echo "${f} -> ${htmlpath}" + mkdir -p $(dirname $htmlpath) # crea el directorio si no existe + # haz la conversión + awk -f gemtext2html.awk $f > $htmlpath + fi +done |