File tree Expand file tree Collapse file tree
tests/check-for-internal-absolute-links Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 - name : Run tests
2121 run : ./run-tests.sh || exit 1
2222
23- internal-links :
24- name : " Absolute Internal Links"
25- needs : build
26- runs-on : ubuntu-latest
27- steps :
28- - name : Checkout
29- uses : actions/checkout@v4
30-
31- - uses : ./.github/workflows/site-workflow
32-
33- - name : Check for internal absolute links
34- run : bash -c "! grep -REi 'https?://(www.)?opentabletdriver.net' site/_site || exit 1"
35-
3623 html-validation :
3724 name : " Validate HTML"
3825 needs : build
Original file line number Diff line number Diff line change 99 < title > {{ site.title }}</ title >
1010 {%- endif -%}
1111 {% include styles.html %}
12+ < link rel ="canonical " href ="{{ site.url }}{{ page.url | replace:'index.html',''}} ">
1213 </ head >
1314 < body >
1415 < header class ="mb-4 ">
Original file line number Diff line number Diff line change 1+ ---
2+ layout:
3+ ---
4+
5+ <?xml version =" 1.0" encoding =" UTF-8" ?>
6+ <urlset xmlns =" http://www.sitemaps.org/schemas/sitemap/0.9" >
7+ {%- for page in site.pages -%}
8+ {%- if page.url contains '.xml' or page.url contains 'assets' %}{%- else %}
9+ <url >
10+ <loc >{{ site.url }}{{ page.url }}</loc >
11+ </url >
12+ {%- endif -%}
13+ {% endfor %}
14+ {%- for page in site.sections -%}
15+ {%- if page.layout == "redirect" -%}{%- continue -%}{%- endif %}
16+ <url >
17+ <loc >{{ site.url }}{{ page.url | replace: 'index.html', '' }}</loc >
18+ </url >
19+ {%- endfor -%}
20+ {%- for page in site.wiki %}
21+ <url >
22+ <loc >{{ site.url }}{{ page.url | replace: 'index.html', '' }}</loc >
23+ </url >
24+ {%- endfor %}
25+ </urlset >
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # usage:
4+ # ./$0 "jekyll root" "html root"
5+ #
6+ # for use in CI to ensure absolute links aren't being written to html files
7+ #
8+ set -e # exit on any error
9+
10+ if [[ -z " $1 " ]]; then
11+ echo " Usage: $0 HTML_ROOT"
12+ exit 127
13+ fi
14+
15+ HTML_ROOT=" $1 "
16+
17+ ! grep -REi ' https?://(www.)?opentabletdriver.net' \
18+ --exclude=sitemap.xml \
19+ " ${HTML_ROOT} " \
20+ | grep -vE ' canonical'
21+
22+ rv=" $? "
23+
24+ if [ " $rv " -eq 0 ]; then
25+ echo " OK"
26+ else
27+ echo " FAIL"
28+ fi
You can’t perform that action at this time.
0 commit comments