Add link checker

Signed-off-by: lucperkins <lucperkins@gmail.com>
This commit is contained in:
lucperkins 2020-03-06 13:05:46 -08:00
parent f3397321d9
commit 2f0d53de24
5 changed files with 32 additions and 4 deletions

4
.gitignore vendored
View File

@ -12,3 +12,7 @@ $RECYCLE.BIN/
# OSX # OSX
.DS_Store .DS_Store
*~ *~
# Link checker
bin/
tmp/

3
.htmltest.external.yml Normal file
View File

@ -0,0 +1,3 @@
DirectoryPath: public
IgnoreDirectoryMissingTrailingSlash: true
IgnoreAltMissing: true

4
.htmltest.yml Normal file
View File

@ -0,0 +1,4 @@
DirectoryPath: public
IgnoreDirectoryMissingTrailingSlash: true
CheckExternal: false
IgnoreAltMissing: true

View File

@ -2,6 +2,9 @@ HUGO_VERSION = 0.66.0
DOCKER_IMG := klakegg/hugo:$(HUGO_VERSION) DOCKER_IMG := klakegg/hugo:$(HUGO_VERSION)
SERVE_CMD = server --buildDrafts --buildFuture --disableFastRender --ignoreCache SERVE_CMD = server --buildDrafts --buildFuture --disableFastRender --ignoreCache
clean:
rm -rf public resources
serve: serve:
hugo server \ hugo server \
--buildDrafts \ --buildDrafts \
@ -11,13 +14,28 @@ serve:
docker-serve: docker-serve:
docker run --rm -it -v $(CURDIR):/src -p 1313:1313 $(DOCKER_IMG) $(SERVE_CMD) docker run --rm -it -v $(CURDIR):/src -p 1313:1313 $(DOCKER_IMG) $(SERVE_CMD)
production-build: production-build: clean
hugo \ hugo \
--minify --minify
preview-build: make check-internal-links
preview-build: clean
hugo \ hugo \
--baseURL $(DEPLOY_PRIME_URL) \ --baseURL $(DEPLOY_PRIME_URL) \
--buildDrafts \ --buildDrafts \
--buildFuture \ --buildFuture \
--minify --minify
make check-internal-links
link-checker-setup:
curl https://raw.githubusercontent.com/wjdp/htmltest/master/godownloader.sh | bash
run-link-checker:
bin/htmltest
check-internal-links: link-checker-setup run-link-checker
check-all-links: link-checker-setup
bin/htmltest --conf .htmltest.external.yml

View File

@ -729,8 +729,7 @@ response to the client.
### 2.4.4: The GreeterTimer Client ### 2.4.4: The GreeterTimer Client
The The [Go client](go/main.go)
[go client](go/main.go)
prepares a `TimerRequest` and gets back a stream interface from the prepares a `TimerRequest` and gets back a stream interface from the
`client.TimeHello` method. We call its `Recv()` method until EOF, at `client.TimeHello` method. We call its `Recv()` method until EOF, at
which point the call is complete. A summary of each BatchResponse is which point the call is complete. A summary of each BatchResponse is