Skip to content

Commit

Permalink
Merge pull request #26 from ScilifelabDataCentre/fix-link
Browse files Browse the repository at this point in the history
Add external link checker
  • Loading branch information
LianeHughes authored Oct 13, 2023
2 parents cd82d51 + 9c70146 commit c66c589
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/htmltest-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CheckDoctype: false
CheckLinks: false
CheckMeta: false
CheckGeneric: false
CheckInternal: false
CheckInternalHash: false
CheckMailto: false
CheckTel: false
CheckMetaRefresh: false
IgnoreInternalEmptyHash: true
IgnoreEmptyHref: true
IgnoreAltMissing: true
IgnoreAltEmpty: true
IgnoreDirectoryMissingTrailingSlash: true
39 changes: 39 additions & 0 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Run htmltest to check for broken external links
# Scheduled for every first wednesday of the month

name: Check broken links (htmltest)
on:
workflow_dispatch:
branches:
- develop
schedule:
- cron: '20 8 1-7 * 3'

jobs:
htmltest:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"

- name: Run Hugo
run: hugo -d dist

- name: Test HTML
continue-on-error: true
uses: wjdp/htmltest-action@master
with:
path: dist
config: .github/htmltest-config.yml

- name: Archive htmltest results
uses: actions/upload-artifact@v3
with:
name: htmltest-report
path: tmp/.htmltest/htmltest.log
retention-days: 7
4 changes: 2 additions & 2 deletions layouts/collections/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h4>Sample information</h4>
<div class="row ml-0">
<div class="col-md-auto pl-0 font-weight-bold">Materials:</div>
<div class="col-md pl-0">{{ range (.GetTerms "materials") }}
<span class="m-1 badge badge-blue taxonomy-term"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></span>
<span class="m-1 badge badge-blue taxonomy-term"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></span>
{{ end }}
</div>
</div>
Expand Down Expand Up @@ -236,4 +236,4 @@ <h5>Biobank contact information</h5>
</div>
</div>

{{ end }}
{{ end }}

0 comments on commit c66c589

Please sign in to comment.