summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfetch-css.sh8
-rwxr-xr-xfetch-images.sh2
-rwxr-xr-xflow-part2.sh5
-rw-r--r--flow.md7
4 files changed, 17 insertions, 5 deletions
diff --git a/fetch-css.sh b/fetch-css.sh
index 28a6ac9..271a2b8 100755
--- a/fetch-css.sh
+++ b/fetch-css.sh
@@ -7,7 +7,7 @@ INGLOB=*.html
SEDSCRIPT=/mnt/public/work/devuan/fix-css-in-html.sed
# OUTDIR will be made in INDIR, because of the `cd` below.
-OUTDIR=css
+OUTDIR=.css
test ! -d "${OUTDIR}" && mkdir -p "${OUTDIR}"
INSERVER=https://git.devuan.org
@@ -20,10 +20,12 @@ orig_css="$( sed -n -r -e 's/^.*<link.*(href="[^"]+\.css").*/\1/p' ${INGLOB} | a
cat /dev/null > "${SEDSCRIPT}"
echo "${orig_css}" | while read line ; do
- getpath="${INSERVER}${line}"
+ getpath="${INSERVER}/${line}"
targetfile="${OUTDIR}/$( basename "${line}" )"
+ targetfile="${targetfile##/}"
+ targetfile=".$( echo "${targetfile}" | sed -r -e 's/^\.+//g;' )"
test -n "${DEBUG}" && echo "process ${getpath} and save to ${targetfile}" 1>&2
test -z "${DRYRUN}" && wget --quiet --content-disposition -O "${targetfile}" "${getpath}"
# dynamically build a sed script
- echo "s:${line}:${targetfile##/}:g;" | tee -a "${SEDSCRIPT}"
+ echo "s:${line}:${targetfile}:g;" | tee -a "${SEDSCRIPT}"
done
diff --git a/fetch-images.sh b/fetch-images.sh
index bec3a6f..604b8ef 100755
--- a/fetch-images.sh
+++ b/fetch-images.sh
@@ -26,6 +26,8 @@ echo "${orig_src}" | while read line ; do
getpath="${line}"
echo "${getpath}" | grep -q -E "https?:\/\/" || getpath="${INSERVER}${getpath}"
temp="$( echo "${line}" | sed -r -e "s@${INSERVERREGEX}@@g" -e 's@/-/@/@g' )"
+ temp="${temp##/}"
+ temp=".$( echo "${temp}" | sed -r -e 's/^\.+//g;' )"
outdir="$( dirname "${temp}" | sed -r -e 's@^/@@' )"
test ! -d "${outdir}" && mkdir -p "${outdir}"
targetfile="${temp%%\?*}" # for output file itself remove the question mark which is normally width attribute
diff --git a/flow-part2.sh b/flow-part2.sh
index e56bdf2..041b3f6 100755
--- a/flow-part2.sh
+++ b/flow-part2.sh
@@ -15,7 +15,7 @@ ls -1 "${OUTDIR}"/*.html > output/files-for-timestamps.txt
DEBUG=1 ./fetch-images.sh 2>~/log/flow-part2.$( date "+%FT%H%M%S" ).log
sed -i -f fix-images-in-html.sed "${OUTDIR}"/*.html
-mkdir -p "${OUTDIR}/css"
+mkdir -p "${OUTDIR}/.css"
./fetch-css.sh
sed -i -f fix-css-in-html.sed "${OUTDIR}"/*.html
@@ -28,3 +28,6 @@ sed -i -r -f fix-without-systemd-links.sed "${OUTDIR}"/*.html
./conversion.sh "${OUTDIR}"/*.html
./use-datasrc-instead-src.py
+
+./fix-issue-links.sh
+sed -i -f fix-issue-links.sed "${OUTDIR}"/*.html
diff --git a/flow.md b/flow.md
index ca81d52..e6074e6 100644
--- a/flow.md
+++ b/flow.md
@@ -38,7 +38,7 @@ Everything on this page, for jq filtering. https://stedolan.github.io/jq/manual/
* download all stylesheets and then fix them.
- mkdir -p /mnt/public/www/gitlab-issues/css
+ mkdir -p /mnt/public/www/gitlab-issues/.css
./fetch-css.sh
sed -i -f fix-css-in-html.sed /mnt/public/www/gitlab-issues/*.html
@@ -62,4 +62,9 @@ Everything on this page, for jq filtering. https://stedolan.github.io/jq/manual/
./use-datasrc-instead-src.py
+ * Fix links to other git issues.
+
+ ./fix-issue-links.sh
+ sed -i -f fix-issue-links.sed /mnt/public/www/gitlab-issues/*.html
+
* build some sort of index?
bgstack15