Skip to content

Commit

Permalink
updating Makefile, adding _check-links--warn
Browse files Browse the repository at this point in the history
Signed-off-by: Nate W <[email protected]>
  • Loading branch information
nate-double-u committed Sep 11, 2024
1 parent 7e994f6 commit 624cdfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
18 changes: 3 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ HTMLTEST_DIR=tmp
HTMLTEST?=htmltest # Specify as make arg if different
HTMLTEST_ARGS?=--skip-external

DOCS=public/docs
LATEST_VERSION=$(shell grep -e '^docs' config.toml | grep -oe '[0-9][0-9]*.[0-9]' | head -1)

# Use $(HTMLTEST) in PATH, if available; otherwise, we'll get a copy
ifeq (, $(shell which $(HTMLTEST)))
override HTMLTEST=$(HTMLTEST_DIR)/bin/htmltest
Expand All @@ -13,22 +10,13 @@ GET_LINK_CHECKER_IF_NEEDED=get-link-checker
endif
endif

check-links: $(GET_LINK_CHECKER_IF_NEEDED) make-redirects-for-checking
check-links: $(GET_LINK_CHECKER_IF_NEEDED)
$(HTMLTEST) $(HTMLTEST_ARGS)
find public/* -type l -ls -exec rm -f {} \;

make-redirects-for-checking:
@if [ -z $(LATEST_VERSION) ]; then \
echo "Failed to extract LATEST_VERSION. Cannot setup symlinks for checking"; \
exit 1; \
fi
@echo "Creating symlinks of 'latest' to $(LATEST_VERSION) for the purpose of link checking"
(cd public && rm -f scalers && ln -s docs/$(LATEST_VERSION)/scalers scalers)
(cd public/docs && rm -f latest && ln -s $(LATEST_VERSION) latest)
clean:
rm -rf $(HTMLTEST_DIR) public/* resources

get-link-checker:
rm -Rf $(HTMLTEST_DIR)/bin
curl https://htmltest.wjdp.uk | bash -s -- -b $(HTMLTEST_DIR)/bin

clean:
rm -rf $(HTMLTEST_DIR) public/* resources
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"_build": "hugo --cleanDestinationDir -e dev -DFE",
"_check-links": "make check-links",
"_diff:check": "git diff --name-only --exit-code",
"_diff:fail": "git diff --name-only --exit-code || exit 1",
"_serve:hugo": "hugo serve -DFE --minify",
"_serve": "netlify dev -c \"npm run _serve:hugo\" --framework hugo",
"build:preview": "set -x && npm run _build -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
Expand Down

0 comments on commit 624cdfc

Please sign in to comment.