From 82b994447214af187f05083f1fff33a78f92b1a8 Mon Sep 17 00:00:00 2001 From: sejo Date: Wed, 19 May 2021 19:06:21 -0500 Subject: archivos iniciales --- generasitio.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 generasitio.sh (limited to 'generasitio.sh') 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 -- cgit v1.2.3