From 624cdfcad301f7ff8e65044d1927eaecd6a28933 Mon Sep 17 00:00:00 2001 From: Nate W Date: Wed, 11 Sep 2024 15:56:01 -0700 Subject: [PATCH] updating Makefile, adding _check-links--warn Signed-off-by: Nate W --- Makefile | 18 +++--------------- package.json | 1 - 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 7c64ddc8e..96b9e5430 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/package.json b/package.json index 3086978a7..a80f4ccf0 100644 --- a/package.json +++ b/package.json @@ -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:-/}\"",