Skip to content

Commit 04a3926

Browse files
Merge pull request #130 from Sbragul26/standardize-academy-makefiles
chore(make): standardize Makefile structure across academies
2 parents d0165ed + 51889ba commit 04a3926

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

Makefile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,42 @@ include .github/build/Makefile.show-help.mk
1818
#----------------------------------------------------------------------------
1919
# Academy
2020
# ---------------------------------------------------------------------------
21-
.PHONY: setup build site clean check-go theme-update
22-
2321
## ------------------------------------------------------------
2422
----LOCAL_BUILDS: Show help for available targets
2523

2624
## Local: Install site dependencies
2725
setup:
28-
npm i
26+
npm install
27+
28+
## Local: Build and run site locally with draft and future content enabled.
29+
site: check-go
30+
hugo server -D -F
2931

3032
## Local: Build site for local consumption
3133
build:
3234
hugo build
3335

34-
## Local: Build and run site locally with draft and future content enabled.
35-
site: check-go
36-
hugo server -D -F
37-
36+
## Build site for local consumption
37+
build-preview:
38+
hugo --baseURL=$(BASEURL)
39+
3840
## Empty build cache and run on your local machine.
3941
clean:
4042
hugo --cleanDestinationDir
4143
make setup
4244
make site
4345

46+
## Fix Markdown linting issues
47+
lint-fix:
48+
@echo "Checking for markdownlint-cli2..."
49+
@command -v markdownlint-cli2 > /dev/null || { \
50+
echo "markdownlint-cli2 not found. Attempting to install globally..."; \
51+
command -v npm > /dev/null || { echo "npm is not installed. Please install Node.js/npm and re-run 'make lint-fix'."; exit 1; }; \
52+
npm install -g markdownlint-cli2; \
53+
}
54+
@echo "Running markdownlint-cli2 --fix..."
55+
@markdownlint-cli2 --fix "**/*.md" "#node_modules" "#public" "#resources"
56+
4457
## ------------------------------------------------------------
4558
----MAINTENANCE: Show help for available targets
4659

@@ -53,3 +66,5 @@ check-go:
5366
theme-update:
5467
echo "Updating to latest academy-theme..." && \
5568
hugo mod get github.com/layer5io/academy-theme
69+
70+
.PHONY: setup build build-preview site clean lint-fix check-go theme-update

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ The site will be available at `http://localhost:1313/academy/` (or the port show
103103
| Command | Description |
104104
|---------|-------------|
105105
| `make setup` | Install npm dependencies |
106-
| `make build` | Build the site for production |
107106
| `make site` | Build and run site locally with draft and future content enabled |
107+
| `make build` | Build the site for production |
108+
| `make build-preview` | Build site for preview draft and future content enabled (honors `BASEURL`) |
108109
| `make clean` | Clear build cache and restart the dev server |
110+
| `make lint-fix` | Fix Markdown linting issues with `markdownlint-cli2` |
111+
| `make check-go` | Verify Go is installed locally |
109112
| `make theme-update` | Update the `academy-theme` Hugo module to the latest version |
110113

111114
---

0 commit comments

Comments
 (0)