Skip to content
Merged
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
18 changes: 18 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ on: # yamllint disable-line rule:truthy
- main

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build site
run: |
docker run --rm \
-v "$PWD":/src \
-w /src \
hugomods/hugo:reg-0.147.9 hugo
- name: Validate pages
run: |
find content -name '*.md' \
-exec printf 'Checking %s\n' {} \; \
-exec ./validate-page.sh {} \;
deploy:
runs-on: ubuntu-latest
needs: validate
steps:
# Run Hugo on the server to build the site
- name: Build Site with Hugo
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Validate Site

on:
pull_request:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build site
run: |
docker run --rm \
-v "$PWD":/src \
-w /src \
hugomods/hugo:reg-0.147.9 hugo
- name: Validate pages
run: |
find content -name '*.md' \
-exec printf 'Checking %s\n' {} \; \
-exec ./validate-page.sh {} \;
1 change: 1 addition & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ignore: |

rules:
line-length: disable
truthy: disable
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<meta name="description" content="{{ . }}">
{{- end }}
{{- with .Site.Params.author.name }}
<meta name="author" content="{{ . }}"/>
<meta name="author" content="{{ . }}">
{{- end }}
{{- partial "seo/main.html" . }}
{{- with .Site.Params.favicon }}
Expand Down
5 changes: 4 additions & 1 deletion validate-page.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ path=$1
# Collapse multiple slashes to 1
path=$(echo "$path" | sed -E 's#/+#/#g')

# Remove replace _index.md paths with the path that will lead to the index.
if [[ $path == */_index.md ]]; then
path=${path%/_index.md}
# Remove .md from paths.
if [[ $path == *.md ]]; then
elif [[ $path == *.md ]]; then
path=${path%.md}
fi

Expand Down