-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
25 lines (23 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#----------------------------------------------------------------------------
# Build a preview of the docs published at https://enterprisecontract.dev/docs/
# including the current changes in this local repo.
#
# Fixme maybe: Unfortunately the docs built using this method have broken
# stylesheet links when viewed with a local file:// url.
#
# Usage:
# make ec-docs-preview
#
# See also the Makefile in the enterprise-contract.github.io repo which has
# similar scripts for doing local docs preview builds.
#
HACBS_DOCS_DIR=../enterprise-contract.github.io/antora
[email protected]:enterprise-contract/enterprise-contract.github.io.git
$(HACBS_DOCS_DIR):
mkdir $(HACBS_DOCS_DIR) && cd $(HACBS_DOCS_DIR) && git clone $(HACBS_DOCS_REPO) .
CURRENT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
ec-docs-preview: $(HACBS_DOCS_DIR) ## Build a preview of the documentation
cd $(HACBS_DOCS_DIR) && \
yq e -i '.content.sources[] |= select(.url == "*user-guide*").url |= "../../user-guide"' antora-playbook.yml && \
yq e -i '.content.sources[] |= select(.url == "*user-guide*").branches |= "$(CURRENT_BRANCH)"' antora-playbook.yml && \
npm ci && npm run build