From 5fe6ed4acd4f0db93bea572d6bbd271b212d0c4b Mon Sep 17 00:00:00 2001 From: Sebastian 'gonX' Jensen Date: Sun, 14 Dec 2025 17:58:37 +0100 Subject: [PATCH 1/3] Add sitemap --- site/sitemap.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 site/sitemap.xml diff --git a/site/sitemap.xml b/site/sitemap.xml new file mode 100644 index 0000000..f555811 --- /dev/null +++ b/site/sitemap.xml @@ -0,0 +1,25 @@ +--- +layout: +--- + + + + {%- for page in site.pages -%} + {%- if page.url contains '.xml' or page.url contains 'assets' %}{%- else %} + + {{ site.url }}{{ page.url }} + + {%- endif -%} + {% endfor %} + {%- for page in site.sections -%} + {%- if page.layout == "redirect" -%}{%- continue -%}{%- endif %} + + {{ site.url }}{{ page.url | replace: 'index.html', '' }} + + {%- endfor -%} + {%- for page in site.wiki %} + + {{ site.url }}{{ page.url | replace: 'index.html', '' }} + + {%- endfor %} + From 389a4d2557dd3584812a475a68d701c3c992ff20 Mon Sep 17 00:00:00 2001 From: Sebastian 'gonX' Jensen Date: Sun, 14 Dec 2025 18:26:24 +0100 Subject: [PATCH 2/3] Add Canonical link to --- site/_layouts/default.html | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_layouts/default.html b/site/_layouts/default.html index 4c8aaf0..1372f68 100644 --- a/site/_layouts/default.html +++ b/site/_layouts/default.html @@ -9,6 +9,7 @@ {{ site.title }} {%- endif -%} {% include styles.html %} +
From 4882a15a83a637cbdf4f75d60ed63059db07d02d Mon Sep 17 00:00:00 2001 From: Sebastian 'gonX' Jensen Date: Mon, 15 Dec 2025 01:53:03 +0100 Subject: [PATCH 3/3] test/absolute-links: Move from GH action to shell script Reduces the column count in the GitHub script --- .github/workflows/jekyll.yml | 13 --------- .../check-for-internal-absolute-links.sh | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) create mode 100755 tests/check-for-internal-absolute-links/check-for-internal-absolute-links.sh diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index ce5ce2c..3ebb155 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -20,19 +20,6 @@ jobs: - name: Run tests run: ./run-tests.sh || exit 1 - internal-links: - name: "Absolute Internal Links" - needs: build - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - uses: ./.github/workflows/site-workflow - - - name: Check for internal absolute links - run: bash -c "! grep -REi 'https?://(www.)?opentabletdriver.net' site/_site || exit 1" - html-validation: name: "Validate HTML" needs: build diff --git a/tests/check-for-internal-absolute-links/check-for-internal-absolute-links.sh b/tests/check-for-internal-absolute-links/check-for-internal-absolute-links.sh new file mode 100755 index 0000000..ec15088 --- /dev/null +++ b/tests/check-for-internal-absolute-links/check-for-internal-absolute-links.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# usage: +# ./$0 "jekyll root" "html root" +# +# for use in CI to ensure absolute links aren't being written to html files +# +set -e # exit on any error + +if [[ -z "$1" ]]; then + echo "Usage: $0 HTML_ROOT" + exit 127 +fi + +HTML_ROOT="$1" + +! grep -REi 'https?://(www.)?opentabletdriver.net' \ + --exclude=sitemap.xml \ + "${HTML_ROOT}" \ + | grep -vE 'canonical' + +rv="$?" + +if [ "$rv" -eq 0 ]; then + echo "OK" +else + echo "FAIL" +fi