Skip to content

Commit

Permalink
Narrow url-ignore for lightbox links (#147)
Browse files Browse the repository at this point in the history
After #132 @angelplasma
proposed setting the lightbox links to href="#_" which they now all are.

In order to not ignore all links containing "#", this commit now regex
matches the complete string by using begin-of-string and end-of-string
anchors.

Additionally, this uses the comma separated list of regular expressions,
as recommended in html-proofer's README.
  • Loading branch information
ericherman authored Feb 10, 2021
1 parent dbf5558 commit 9b8f149
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions script/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ set -e # halt script on error
# Build the site
bundle exec jekyll build

# Check for broken links and missing alt tags, ignore edit links to GitHub as they might not exist yet
# Check for broken links and missing alt tags, ignoring all links matching
# the regular expression patterns:
# containing "github.com" as they might not exist yet
# containing "twitter.com" because twitter is broken
# exactly "#_" (anchored by begin of line and end of line)
# See also:
# https://ruby-doc.org/core-2.7.1/Regexp.html
# https://github.com/gjtorikian/html-proofer/blob/main/README.md

bundle exec htmlproofer \
--url-ignore "/github.com/(.*)/edit/" \
--url-ignore "/github.com/,/twitter.com/" \
--url-ignore "/#/" \
--url-ignore '/github\.com/,/twitter\.com/,/^#_$/' \
./_site

0 comments on commit 9b8f149

Please sign in to comment.