◊(Local Yarn Code "Check-in [9dbdbe97]")

Overview
Comment:Exempt /code links from relativize script effects
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9dbdbe97f1f33428b1683f2b0e9532ee369617035beeb7816c4607cc2087f94b
User & Date: joel on 2020-03-15 00:53:59
Other Links: manifest | tags
Context
2020-03-15
03:07
Import more articles check-in: 305293b3 user: joel tags: trunk, content
00:53
Exempt /code links from relativize script effects check-in: 9dbdbe97 user: joel tags: trunk
2020-03-14
22:46
Add a bunch of articles check-in: 2fefe8bc user: joel tags: trunk, content
Changes

Modified util/relativize from [720591c3] to [fca41d4e].

20
21
22
23
24
25
26
27
28


29
30
31
32
33
34




20
21
22
23
24
25
26


27
28
29
30




31
32
33
34







-
-
+
+


-
-
-
-
+
+
+
+
if [[ ! -d "${base_dir}" ]]; then
    echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: ${base_dir} not a directory!" >&2
    exit 1
fi

# Root folder: remove leading / from href and src attributes
# Works across (and preserves) line breaks introduced by the `tidy` command
perl -0777 -i -pe 's/ href=(\s*)"\// href=$1"/ig' "${base_dir}"*.html
perl -0777 -i -pe 's/ src=(\s*)"\// src=$1"/ig' "${base_dir}"*.html
perl -0777 -i -pe 's/ href=(\s*)"\/(?!code)/ href=$1"/ig' "${base_dir}"*.html
perl -0777 -i -pe 's/ src=(\s*)"\/(?!code)/ src=$1"/ig' "${base_dir}"*.html

# subfolders: replace leading / with ../ in href and src attributes
perl -0777 -i -pe 's/ href=(\s*)"\// href=$1"..\//ig' "${base_dir}"articles/*.html
perl -0777 -i -pe 's/ src=(\s*)"\// src=$1"..\//ig' "${base_dir}"articles/*.html
perl -0777 -i -pe 's/ href=(\s*)"\// href=$1"..\//ig' "${base_dir}"series/*.html
perl -0777 -i -pe 's/ src=(\s*)"\// src=$1"..\//ig' "${base_dir}"series/*.html
perl -0777 -i -pe 's/ href=(\s*)"\/(?!code)/ href=$1"..\//ig' "${base_dir}"articles/*.html
perl -0777 -i -pe 's/ src=(\s*)"\/(?!code)/ src=$1"..\//ig' "${base_dir}"articles/*.html
perl -0777 -i -pe 's/ href=(\s*)"\/(?!code)/ href=$1"..\//ig' "${base_dir}"series/*.html
perl -0777 -i -pe 's/ src=(\s*)"\/(?!code)/ src=$1"..\//ig' "${base_dir}"series/*.html