Skip to content

Commit

Permalink
Merge pull request #36 from OpenRailAssociation/broken-links
Browse files Browse the repository at this point in the history
Check for broken links
  • Loading branch information
mxmehl committed Sep 18, 2024
2 parents e532a50 + fdd6405 commit fcba327
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.6.0
uses: peaceiris/actions-hugo@v3.0.0
with:
hugo-version: "0.132.2"
extended: true
Expand All @@ -42,9 +42,32 @@ jobs:
run: hugo

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-artifact@v4
with:
name: public
path: ./public
include-hidden-files: true
retention-days: 1

# Checking links using lychee
linkchecker:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: public
path: .

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: '-r 5 -u "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple WebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" --exclude sncf.com --exclude nge.flatland.cloud --max-concurrency 1 .'
# Fail on errors
fail: false
# TODO: Implement https://github.com/lycheeverse/lychee/issues/989 once it's done. Will help with LinkedIn rate limits

# Deployment job
deploy:
Expand All @@ -56,6 +79,17 @@ jobs:
# Only deploy if on main branch
if: github.ref == 'refs/heads/main'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: public
path: ./public

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ hugo.linux
# Temporary lock file while building
/.hugo_build.lock

# lychee
.lycheecache

# End of https://www.toptal.com/developers/gitignore/api/hugo
2 changes: 1 addition & 1 deletion content/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ We thank the following persons and projects:
* The [port of the design to Hugo](https://github.com/caressofsteel/hugo-story) made by [@caressofsteel](https://github.com/caressofsteel).
* Photos by
* [Jakub Nawrot](https://unsplash.com/jacob_lens)
* [Alexander Popov](https://unsplash.com/5step5)
* [Alexander Popov](https://unsplash.com/5tep5)
* [cmophoto.net](https://unsplash.com/cmophoto)
2 changes: 1 addition & 1 deletion themes/openrail/layouts/shortcodes/relurl.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ relURL (.Get 0) }}
{{- relURL (.Get 0) -}}

0 comments on commit fcba327

Please sign in to comment.