aboutsummaryrefslogtreecommitdiffstats
path: root/generasitio.sh
blob: 2adab594a02165cdb1901a7cb314b95e5ec6f83b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
Un proyecto texto-plano.xyz