Allow to generate a file at a specified path, used for index and current pages
This commit is contained in:
parent
42e82603b9
commit
cc93c0e8ae
|
@ -11,6 +11,7 @@ die() {
|
||||||
}
|
}
|
||||||
|
|
||||||
DIR=$(basename $1)
|
DIR=$(basename $1)
|
||||||
|
DESTFILENAME=$2
|
||||||
CURINODE=$(stat -f "%i" current/)
|
CURINODE=$(stat -f "%i" current/)
|
||||||
|
|
||||||
test -d "$DIR" || usage
|
test -d "$DIR" || usage
|
||||||
|
@ -24,11 +25,16 @@ else
|
||||||
DEST=public
|
DEST=public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat _common/header $DIR/*html _common/footer > ../${DEST}/${DIR}.html
|
if test -z "$DESTFILENAME"
|
||||||
|
then
|
||||||
|
DESTFILENAME="../${DEST}/${DIR}.html"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat _common/header $DIR/*html _common/footer > $DESTFILENAME
|
||||||
|
|
||||||
# replace with issue number
|
# replace with issue number
|
||||||
issue=$(echo -n "$1" | egrep -o "[0-9]+")
|
issue=$(echo -n "$1" | egrep -o "[0-9]+")
|
||||||
sed -i "s/__ISSUE__/${issue}/g" ../${DEST}/${DIR}.html
|
sed -i "s/__ISSUE__/${issue}/g" $DESTFILENAME
|
||||||
|
|
||||||
# replace date
|
# replace date
|
||||||
sed -i "s/__DATE__/$(date -u)/" ../${DEST}/${DIR}.html
|
sed -i "s/__DATE__/$(date -u)/" $DESTFILENAME
|
||||||
|
|
Loading…
Reference in New Issue