Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check links in the user guide #1172

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"build:production": "npm run cd:docs build:production",
"build": "npm run cd:docs build",
"cd:docs": "npm run _cd:docs -- npm run",
"check-links:all": "npm run cd:docs check-links:all",
"check-links": "npm run cd:docs check-links",
"docs-install": "npm run _cd:docs -- npm install",
"get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}",
"serve": "npm run cd:docs serve",
Expand Down
1 change: 1 addition & 0 deletions userguide/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.hugo_build.lock
/public
resources/
tmp
8 changes: 8 additions & 0 deletions userguide/.htmltest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DirectoryPath: public
CheckDoctype: false # Sadly, this is false only because of `static/google*.html`
IgnoreAltMissing: true # FIXME
IgnoreDirectoryMissingTrailingSlash: true # FIXME
IgnoreDirs: [_print] # FIXME
IgnoreEmptyHref: true # FIXME
IgnoreInternalEmptyHash: true # FIXME
Comment on lines +3 to +7
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The options with FIXME tags should eventually be addressed by performing the necessary cleanup in the repo.

IgnoreInternalURLs:
21 changes: 21 additions & 0 deletions userguide/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
HTMLTEST_DIR=tmp
HTMLTEST?=htmltest # Specify as make arg if different
HTMLTEST_ARGS?=--skip-external

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

check-links: $(GET_LINK_CHECKER_IF_NEEDED)
$(HTMLTEST) $(HTMLTEST_ARGS)

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
5 changes: 5 additions & 0 deletions userguide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
"name": "docsy-user-guide",
"scripts": {
"_build": "npm run _hugo-dev",
"_check-links": "make check-links",
"_hugo": "hugo --cleanDestinationDir --themesDir ../..",
"_hugo-dev": "npm run _hugo -- -e dev -DFE",
"_serve": "npm run _hugo-dev -- serve",
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
"build:production": "npm run _hugo -- --minify",
"build": "npm run _build",
"check-links:all": "HTMLTEST_ARGS= npm run _check-links",
"check-links": "npm run _check-links",
"clean": "rm -Rf public",
"make:public": "git init -b main public",
"postbuild:preview": "npm run _check-links",
"postbuild:production": "npm run _check-links",
"prepare": "cd .. && npm install",
"serve": "npm run _serve"
},
Expand Down