Skip to content
Open
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
121 changes: 90 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,40 @@
include .github/build/Makefile.core.mk
include .github/build/Makefile.show-help.mk

## Install docs.layer5.io dependencies on your local machine.
## See https://gohugo.io/categories/installation
setup:
npm install
# ---------------------------------------------------------------------------
# SHARED TEMPLATE — PROPAGATE CHANGES
#
# This Makefile is a shared template. Any change to a main recipe below must be
# mirrored in the corresponding Makefile of each repository listed here:
#
# - https://github.com/layer5io/docs
# - https://github.com/meshery/meshery/tree/master/docs
# - https://github.com/topics/meshery-academy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the Academy repository URL.

Line 26 links a GitHub topic page. It does not identify the repository that must receive the synchronized Makefile change. Use the meshery-extensions/meshery-academy repository URL instead. GitHub identifies that repository as the Meshery Academy project and shows that it contains a Makefile. (github.com)

Proposed fix
-#   - https://github.com/topics/meshery-academy
+#   - https://github.com/meshery-extensions/meshery-academy
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# - https://github.com/topics/meshery-academy
# - https://github.com/meshery-extensions/meshery-academy
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` at line 26, Replace the GitHub topic URL in the Makefile comment
with the repository URL for meshery-extensions/meshery-academy, keeping the
surrounding comment unchanged.

#
# Target names, prerequisites, and the npm scripts they call form the shared
# contract; keep them identical across repositories. The Docker section,
# theme-update, the check-go implementation, and any extra check-deps guards are
# per-repository adaptations and are expected to differ.
#
# MAIN TARGETS
#
# setup Install site dependencies (npm install).
# build Build locally with draft, future, and expired content.
# build-preview Build for a deploy preview (uses BASE_URL or DEPLOY_PRIME_URL).
# build-production Build for production. Pass BASE_URL=... to set the base URL.
# site Serve locally with live reload.
# serve Serve locally once, file watcher off (no live reload).
# clean Empty the build cache, reinstall dependencies, run 'site'.
# lint / lint-fix Check or auto-fix Markdown linting issues.
# check-links Check internal links in the built site.
# check-deps Verify required commands and local dependencies.
# check-go Verify Go is installed (required by Hugo Modules).
#
# ---------------------------------------------------------------------------

# ---------------------------------------------------------------------------
# MAINTENANCE
# ---------------------------------------------------------------------------

## Verify required commands and local dependencies are present.
check-deps:
Expand All @@ -27,43 +57,69 @@ check-deps:
@test -x node_modules/.bin/hugo || { echo "Error: Hugo binary not found in node_modules. Please run 'make setup' first."; exit 1; }
@echo "Dependencies check passed."

## Run docs.layer5.io on your local machine with draft and future content enabled.
site: check-deps check-go
npm run dev:site
## Verify Go is installed locally.
check-go:
@echo "Checking if Go is installed..."
@command -v go > /dev/null || { echo "Go is not installed. Please install it before proceeding."; exit 1; }
@echo "Go is installed."

## Check internal links in the built site.
check-links: check-go check-deps
npm run check:links

## Check Markdown for linting issues.
lint: check-deps
npm run lint

## Run docs.layer5.io on your local machine in serve mode (without file watching).
serve: check-deps check-go
npm run dev:serve
## Fix Markdown linting issues.
lint-fix: check-deps
npm run lint:fix

## Build docs.layer5.io on your local machine.
build: check-deps check-go
npm run dev:build
# ---------------------------------------------------------------------------
# LOCAL BUILDS
# ---------------------------------------------------------------------------

## Install docs.layer5.io dependencies on your local machine.
## See https://gohugo.io/categories/installation
setup:
npm install

## Build the site locally with draft and future content enabled.
build: check-go check-deps
npm run build

## Build the site for a deploy preview.
build-preview: check-go check-deps
npm run build:preview

## Build docs.layer5.io for production with optional base URL.
build-production: check-deps
build-production: check-go check-deps
set -e; \
if [ -n "$(BASE_URL)" ]; then \
base_url="$(BASE_URL)"; \
base_url="$${base_url%/}/"; \
npm run build:production -- --gc --baseURL "$$base_url"; \
npm run build:production -- --baseURL "$$base_url"; \
else \
npm run build:production -- --gc; \
npm run build:production; \
fi

## Empty build cache and run docs.layer5.io on your local machine.
clean: check-deps
npm run dev:clean
$(MAKE) site
## Build and run the site locally with live reload (draft and future content enabled).
site: check-go check-deps
npm run site

## Verify Go is installed locally.
check-go:
@echo "Checking if Go is installed..."
@command -v go > /dev/null || (echo "Go is not installed. Please install it before proceeding."; exit 1)
@echo "Go is installed."
## Build and serve the site once with the file-watcher off (no live reload).
serve: check-go check-deps
npm run serve

## Format code using Prettier
format:
npm run format
## Empty the build cache, reinstall dependencies, and run the site locally.
clean:
npm run clean
$(MAKE) setup
$(MAKE) site

# ---------------------------------------------------------------------------
# DOCKER
# ---------------------------------------------------------------------------

## Install base OS dependencies needed in Docker-based docs builds.
docker-install-base-deps:
Expand Down Expand Up @@ -141,14 +197,17 @@ docker:

.PHONY: \
setup \
check-deps \
build \
build-preview \
build-production \
site \
serve \
clean \
check-links \
lint \
lint-fix \
check-deps \
check-go \
format \
docker \
docker-install-base-deps \
docker-deps \
Expand All @@ -159,4 +218,4 @@ docker:
docker-install-htmltest \
docker-htmltest \
docker-update-modules \
docker-build-upstream
docker-build-upstream
Loading
Loading