Skip to content

Commit 1ddfb14

Browse files
committed
ci: ensure that there are only relative URLs
To make it work both in the primary repository's GitHub Pages as well as in the forks' GitHub Pages, we really need the URLs to be specified as relative ones. Make sure that this is the case in the CI builds. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a0ad261 commit 1ddfb14

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ jobs:
2222
- name: run Hugo to build the pages
2323
run: hugo
2424

25+
- name: ensure that there are no absolute URLs
26+
run: |
27+
set -x
28+
if git grep --untracked --no-exclude-standard "\\(href\|src\) *= *[\"']/" \
29+
-- public/ ':^public/js/jquery*' >/tmp/abs-urls.txt
30+
then
31+
cat /tmp/abs-urls.txt
32+
exit 1
33+
fi
34+
2535
- name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index
2636
run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public
2737

0 commit comments

Comments
 (0)