Skip to content

Commit

Permalink
Makefile.am, README.asciidoc: introduce default and customizable HTML…
Browse files Browse the repository at this point in the history
…PROOFER_OPTIONS [networkupstools#52]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed May 7, 2024
1 parent 474e807 commit 56f7060
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
29 changes: 26 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,29 @@ if WITH_HTMLPROOFER
# rebuilds of the site we have possibly just made. Instead, these rules
# just check whatever exists in the filesystem.

# * --disable_external
# By default, we avoid looking at remote website availability.
# This is something we may want to do occasionally (replace dead links
# by references to new incarnations or archive.org) but not take the
# performance hit (and annoy others) for every CI run - in that case
# consider a run with --external_only option to explicitly test that.
# * --allow_hash_href
# We also allow <a href="#" ...> commonly used in javascript etc.
# * --assume_extension
# allow extensionles urls (Jekyll3)
HTMLPROOFER_OPTIONS_DEFAULT = \
--disable_external \
--allow_hash_href \
--assume_extension

# CONSIDER:
# * --empty_alt_ignore
# Temporarily allow empty alt tags on images
# HTMLPROOFER_OPTIONS_DEFAULT += --empty_alt_ignore

# Allow the caller an easy override:
HTMLPROOFER_OPTIONS = $(HTMLPROOFER_OPTIONS_DEFAULT)

check-htmlproofer:
+@case "$(OUTDIR)" in \
"$(OUTDIR_BASE)"|"$(OUTDIR_BASE)/"*) $(MAKE) $(AM_MAKEFLAGS) check-htmlproofer-OUTDIR_BASE ;; \
Expand All @@ -187,17 +210,17 @@ check-htmlproofer:

check-htmlproofer-OUTDIR:
test -d $(OUTDIR)
$(HTMLPROOFER) $(OUTDIR)
$(HTMLPROOFER) $(HTMLPROOFER_OPTIONS) $(OUTDIR)

check-htmlproofer-OUTDIR_BASE:
test -d $(OUTDIR_BASE)
$(HTMLPROOFER) $(OUTDIR_BASE)
$(HTMLPROOFER) $(HTMLPROOFER_OPTIONS) $(OUTDIR_BASE)

# Fetched/updated via git checkout, e.g. by ci_build.sh
OUTDIR_PUBLISHED = networkupstools.github.io
check-htmlproofer-OUTDIR_PUBLISHED:
test -d $(OUTDIR_PUBLISHED)
$(HTMLPROOFER) $(OUTDIR_PUBLISHED)
$(HTMLPROOFER) $(HTMLPROOFER_OPTIONS) $(OUTDIR_PUBLISHED)

else !WITH_HTMLPROOFER

Expand Down
1 change: 1 addition & 0 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ location for that repository, if not using the scripted default).

Note that this check can take about 10 minutes (especially if not disabling
the referenced external site availability), so it is not done by default.
You can pass custom `HTMLPROOFER_OPTIONS` to the `make` operation, if desired.

Publishing
----------
Expand Down

0 comments on commit 56f7060

Please sign in to comment.