Skip to content

Commit

Permalink
Remove make targets using non npx-hugo, adjust Netlify config (#701)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrice Chalin <[email protected]>
  • Loading branch information
chalin authored Mar 7, 2022
1 parent 37e739b commit 79bfa60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
1 change: 1 addition & 0 deletions .htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ IgnoreAltMissing: true
IgnoreEmptyHref: true
IgnoreInternalURLs:
- /docs/2.6/scalers/solace-pub-sub/ # Due to https://github.com/kedacore/keda-docs/issues/693
- /docs/latest/scalers/solace-pub-sub/ # Due to https://github.com/kedacore/keda-docs/issues/693
35 changes: 8 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ 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 '\d\.\d' | head -1)
LATEST_VERSION2=`grep -e '^docs' config.toml | grep -oe '\d\.\d' | head -1`
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)))
Expand All @@ -14,40 +13,22 @@ GET_LINK_CHECKER_IF_NEEDED=get-link-checker
endif
endif

build: clean
hugo -e development -DFE

clean:
rm -rf $(HTMLTEST_DIR) public/* resources

serve:
hugo server \
--buildDrafts \
--buildFuture

production-build: clean
hugo \
--minify

preview-build: clean
hugo -e development \
--baseURL "$(DEPLOY_PRIME_URL)" \
--buildDrafts \
--buildFuture \
--minify

open:
open https://keda.sh

check-links: $(GET_LINK_CHECKER_IF_NEEDED) make-redirects-for-checking
$(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)

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
9 changes: 3 additions & 6 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[build]
publish = "public"
command = "make production-build"
command = "npm run build:preview"

[context.deploy-preview]
command = "make preview-build"

[context.branch-deploy]
command = "make preview-build"
[context.production]
command = "npm run build:production"

0 comments on commit 79bfa60

Please sign in to comment.