-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline link-checking build config and commands (#456)
* Streamline link checking build config and commands * Specify GO_VERSION
- Loading branch information
Showing
5 changed files
with
33 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
DirectoryPath: tmp/public | ||
DirectoryPath: public | ||
IgnoreDirectoryMissingTrailingSlash: true | ||
IgnoreAltMissing: true | ||
CheckExternal: false | ||
IgnoreURLs: | ||
- "^http://play.etcd.io.*" | ||
IgnoreInternalURLs: | ||
- /docs/latest/ | ||
- /docs/latest/install/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
DOCKER_IMG = klakegg/hugo:ext-alpine | ||
DRAFT_ARGS = --buildDrafts --buildFuture --buildExpired | ||
|
||
# Keep these consistent with the values in config.yaml and layouts/index.redirects: | ||
NEXTv=v3.5 | ||
LATESTv=v3.5 | ||
|
||
HTMLTEST_DIR=tmp | ||
HTMLTEST?=htmltest # Specify as make arg if different | ||
HTMLTEST_ARGS?=--skip-external | ||
HTMLTEST_DIR=tmp | ||
|
||
# Use $(HTMLTEST) in PATH, if available; otherwise, we'll get a copy | ||
ifeq (, $(shell which $(HTMLTEST))) | ||
GET_LINK_CHECKER_IF_NEEDED=get-link-checker | ||
override HTMLTEST=$(HTMLTEST_DIR)/bin/htmltest | ||
ifeq (, $(shell which $(HTMLTEST))) | ||
GET_LINK_CHECKER_IF_NEEDED=get-link-checker | ||
endif | ||
endif | ||
|
||
check-internal-links: clean-htmltest-dir link-check-prep | ||
$(HTMLTEST) | ||
|
||
check-all-links: clean-htmltest-dir link-check-prep | ||
$(HTMLTEST) --conf .htmltest.external.yml | ||
check-links: $(GET_LINK_CHECKER_IF_NEEDED) | ||
$(HTMLTEST) $(HTMLTEST_ARGS) | ||
|
||
docker-serve: | ||
docker run --rm -it -v $(PWD):/src -p 1313:1313 $(DOCKER_IMG) server $(DRAFT_ARGS) | ||
|
||
clean-htmltest-dir: | ||
rm -Rf $(HTMLTEST_DIR) | ||
|
||
# Until htmltext >0.14.x is released, get and build our own from source: | ||
get-link-checker: | ||
curl https://htmltest.wjdp.uk | bash -s -- -b $(HTMLTEST_DIR)/bin | ||
|
||
link-check-prep: $(GET_LINK_CHECKER_IF_NEEDED) | ||
mkdir -p $(HTMLTEST_DIR) | ||
rm -Rf $(HTMLTEST_DIR)/public | ||
cp -R public/ $(HTMLTEST_DIR)/public && \ | ||
rm -Rf $(HTMLTEST_DIR) | ||
mkdir -p $(HTMLTEST_DIR)/bin && \ | ||
cd $(HTMLTEST_DIR) && \ | ||
git clone --depth=1 https://github.com/wjdp/htmltest.git && \ | ||
( \ | ||
cd $(HTMLTEST_DIR)/public/docs; \ | ||
ln -s $(NEXTv) next; \ | ||
ln -s $(LATESTv) latest; \ | ||
cd htmltest && \ | ||
./build.sh && \ | ||
cp bin/htmltest ../bin \ | ||
) | ||
|
||
# Once htmltext >0.14.x is released, replace the get-and-build code above with this: | ||
# get-link-checker: | ||
# rm -Rf $(HTMLTEST_DIR)/bin | ||
# curl https://htmltest.wjdp.uk | bash -s -- -b $(HTMLTEST_DIR)/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters