Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions site/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<title>{{ site.title }}</title>
{%- endif -%}
{% include styles.html %}
<link rel="canonical" href="{{ site.url }}{{ page.url | replace:'index.html',''}}">
</head>
<body>
<header class="mb-4">
Expand Down
25 changes: 25 additions & 0 deletions site/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout:
---

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for page in site.pages -%}
{%- if page.url contains '.xml' or page.url contains 'assets' %}{%- else %}
<url>
<loc>{{ site.url }}{{ page.url }}</loc>
</url>
{%- endif -%}
{% endfor %}
{%- for page in site.sections -%}
{%- if page.layout == "redirect" -%}{%- continue -%}{%- endif %}
<url>
<loc>{{ site.url }}{{ page.url | replace: 'index.html', '' }}</loc>
</url>
{%- endfor -%}
{%- for page in site.wiki %}
<url>
<loc>{{ site.url }}{{ page.url | replace: 'index.html', '' }}</loc>
</url>
{%- endfor %}
</urlset>
Original file line number Diff line number Diff line change
@@ -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
Loading