Skip to content

Commit 28b6785

Browse files
Merge branch 'master' into claude/clever-keller-k6q29l
2 parents c9431a9 + 5b271d5 commit 28b6785

10 files changed

Lines changed: 219 additions & 193 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ on:
1515
academy-name:
1616
description: 'Name of the Academy represented by this repo'
1717
required: false
18-
default: 'Academy'
18+
default: 'Academy'
19+
type: string
1920
version:
2021
description: 'Module version'
2122
required: false
@@ -28,27 +29,37 @@ jobs:
2829
steps:
2930
- name: Checkout site
3031
uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
34+
35+
# Required: academy-theme is a Hugo module, so the build needs Go.
36+
# 'make build-production' runs check-go and fails fast without it.
37+
- name: Setup Go
38+
uses: actions/setup-go@v5
39+
with:
40+
go-version-file: go.mod
41+
cache: true
3142

32-
- name: Setup Hugo Extended
33-
uses: peaceiris/actions-hugo@v3
43+
- name: Setup Node
44+
uses: actions/setup-node@v4
3445
with:
35-
hugo-version: '0.158.0'
36-
extended: true
46+
node-version: '20'
47+
cache: 'npm'
3748

3849
- name: Install dependencies
3950
run: make setup
4051

4152
- name: Run production build test
42-
run: make build
53+
run: make build-production
4354

4455
- name: Publish to layer5 academy
4556
id: academy
4657
uses: layer5io/academy-build@v0.1.6
4758
with:
4859
orgId: ${{ github.event.inputs.orgId || secrets.ACADEMY_ORG_ID }}
4960
token: ${{ github.event.inputs.token || secrets.ACADEMY_TOKEN }}
50-
academy-name: 'Academy'
61+
academy-name: ${{ github.event.inputs.academy-name || 'Academy' }}
5162
version: ${{ github.event.inputs.version != '' && github.event.inputs.version || github.ref_name }}
5263

5364
- name: Show response
54-
run: echo "${{ steps.academy.outputs.response }}"
65+
run: echo "${{ steps.academy.outputs.response }}"

.htmltest.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# htmltest configuration.
2+
# Checks the built HTML in public/ for broken links, images, and scripts.
3+
# External links are skipped at runtime via the -s flag in the check:links script.
4+
5+
DirectoryPath: "public"
6+
7+
CheckInternal: true
8+
CheckExternal: true # skipped at runtime by -s; left true for when you drop -s
9+
EnforceHTTPS: true # still flags real http:// links (e.g. exoscale.com) to fix
10+
11+
# --- Silence intentional or non-blocking findings ---
12+
13+
# Hugo serves pages as directories, so a link to "./foo" (no trailing slash)
14+
# only causes a redirect, not a break. Don't treat these as errors.
15+
IgnoreDirectoryMissingTrailingSlash: true
16+
17+
# Alt-text issues are an accessibility backlog, not broken links. Empty alt is
18+
# valid for decorative images. Re-enable (set these false) when you work the
19+
# accessibility pass.
20+
IgnoreAltEmpty: true
21+
IgnoreAltMissing: true
22+
23+
# Deliberate example URLs in workshop content (intentionally http, not real
24+
# reachable hosts). These skip HTTPS enforcement; genuine http links elsewhere
25+
# (exoscale.com, etc.) are NOT listed here, so they still surface for fixing.
26+
IgnoreHTTPS:
27+
- '^http://localhost'
28+
- 'votingapp\.(com|cc)'
29+
- 'nip\.io'
30+
- 'thesecretlivesofdata\.com'
31+
32+
# Directories in public/ to skip entirely (adjust per repo as needed).
33+
# Theme/shortcode demonstration pages full of intentional example links and
34+
# placeholder image paths. Not real content; skip the whole section.
35+
IgnoreDirs:
36+
- 'content-formatting-examples'
37+
38+
# Cache external-link results for fast repeat runs (stored under tmp/.htmltest;
39+
# add tmp/ to .gitignore). Harmless under -s.
40+
CacheExpires: "336h"
41+
42+
43+
# Known-noisy or intentionally-unreachable URLs to ignore (regex).
44+
# IgnoreURLs:
45+
# - "^https://linkedin\\.com/"

CONTRIBUTING.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,10 @@ Please contribute! Layer5 documentation uses Jekyll and GitHub Pages to host doc
8080
1. Open a pull request (in your web browser) against the repo.
8181

8282

83-
#### Tests
84-
Users can now test their code on their local machine against the CI checks implemented using `make run-tests`.
85-
86-
To test code changes on your local machine, run the following command:
87-
```
88-
make run-tests
83+
#### Build Verification
84+
To verify the site builds correctly on your local machine, run:
8985
```
90-
91-
#### Building Docker image
92-
To build a Docker image of the project, please ensure you have `Docker` installed to be able to build the image. Now, run the following command to build the Docker image:
93-
```sh
94-
make docker
86+
make build
9587
```
9688

9789
### UI Lint Rules

Makefile

Lines changed: 86 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,101 @@
1515
include .github/build/Makefile.core.mk
1616
include .github/build/Makefile.show-help.mk
1717

18-
#----------------------------------------------------------------------------
18+
# Changes to any main recipe in this Makefile, require a corresponding change in all other repositories subscribed to the 'meshery-academy' topic.
19+
20+
# htmltest is fetched and run on demand via 'go run' (no install step). Pin it for
21+
# reproducible link checks; leave as 'latest' to always use the newest release.
22+
HTMLTEST_VERSION ?= latest
23+
export HTMLTEST_VERSION
24+
25+
# ---------------------------------------------------------------------------
1926
# Academy
2027
# ---------------------------------------------------------------------------
21-
## ------------------------------------------------------------
22-
----LOCAL_BUILDS: Show help for available targets
23-
24-
## Local: Install site dependencies
28+
29+
# ---------------------------------------------------------------------------
30+
# MAINTENANCE: Show help for available targets
31+
# ---------------------------------------------------------------------------
32+
33+
## Verify required commands and local dependencies are present.
34+
check-deps:
35+
@echo "Checking if 'npm' and local 'hugo' binary are present..."
36+
@command -v npm > /dev/null || { echo "Error: 'npm' not found. Please install Node.js and npm."; exit 1; }
37+
@test -x node_modules/.bin/hugo || { echo "Error: Hugo binary not found in node_modules. Please run 'make setup' first."; exit 1; }
38+
@echo "Dependencies check passed."
39+
40+
## Validate Go is installed
41+
check-go:
42+
@echo "Checking if Go is installed..."
43+
@command -v go > /dev/null || { echo "Go is not installed. Please install it before proceeding."; exit 1; }
44+
@echo "Go is installed."
45+
46+
## Update the academy-theme package to latest version
47+
theme-update: check-go check-deps
48+
@echo "Updating to latest academy-theme..."
49+
npm run update:theme
50+
51+
# ---------------------------------------------------------------------------
52+
# LOCAL BUILDS: Show help for available targets
53+
# ---------------------------------------------------------------------------
54+
55+
## Install site dependencies
2556
setup:
2657
npm install
2758

28-
## Local: Build and run site locally with draft and future content enabled.
29-
site: check-go
30-
hugo server -D -F
59+
## Build the site locally with draft and future content enabled.
60+
build: check-go check-deps
61+
npm run build
3162

32-
## Local: Build site for local consumption
33-
build:
34-
hugo build
63+
## Build the site for a deploy preview.
64+
build-preview: check-go check-deps
65+
npm run build:preview
3566

36-
## Build site for local consumption
37-
build-preview:
38-
hugo --baseURL=$(BASEURL)
67+
## Build the site for production.
68+
build-production: check-go check-deps
69+
npm run build:production
3970

40-
## Empty build cache and run on your local machine.
41-
clean:
42-
hugo --cleanDestinationDir
43-
make setup
44-
make site
71+
## Build and run the site locally with live reload (draft and future content enabled).
72+
site: check-go check-deps
73+
npm run site
4574

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-
57-
## ------------------------------------------------------------
58-
----MAINTENANCE: Show help for available targets
75+
## Build and serve the site once with the file-watcher off (no live reload).
76+
site-no-watch: check-go check-deps
77+
npm run site:no-watch
5978

60-
check-go:
61-
@echo "Checking if Go is installed..."
62-
@command -v go > /dev/null || (echo "Go is not installed. Please install it before proceeding."; exit 1)
63-
@echo "Go is installed."
79+
## Empty the build cache, reinstall dependencies, and run the site locally.
80+
clean:
81+
npm run clean
82+
$(MAKE) setup
83+
$(MAKE) site
6484

65-
## Update the academy-theme package to latest version
66-
theme-update:
67-
echo "Updating to latest academy-theme..." && \
68-
hugo mod get github.com/layer5io/academy-theme
85+
## Check internal links in the built site (htmltest is fetched on demand via 'go run').
86+
check-links: check-go check-deps
87+
npm run check:links
88+
89+
## Format code using Prettier
90+
format:
91+
npm run format
92+
93+
## Check formatting without writing changes.
94+
format-check:
95+
npm run format:check
96+
97+
## Fix Markdown linting issues
98+
lint-fix:
99+
npx --yes markdownlint-cli2 --fix "content/**/*.md"
69100

70-
.PHONY: setup build build-preview site clean lint-fix check-go theme-update
101+
.PHONY: \
102+
setup \
103+
build \
104+
build-preview \
105+
build-production \
106+
site \
107+
site-no-watch \
108+
clean \
109+
check-links \
110+
format \
111+
format-check \
112+
lint-fix \
113+
check-deps \
114+
check-go \
115+
theme-update

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ Before you begin, ensure you have the following installed:
5656

5757
| Tool | Version | Link |
5858
|------|---------|------|
59-
| **Hugo** (extended) | see go.mod | [Install Hugo](https://gohugo.io/getting-started/installing/) |
6059
| **Go** | see go.mod| [Install Go](https://go.dev/doc/install) |
6160
| **Node.js / npm** | see package.json | [Install Node.js](https://nodejs.org/) |
6261
| **Git** | Latest | [Install Git](https://git-scm.com/) |
6362

63+
*(Note: Hugo Extended is managed locally via npm and does not need to be installed globally).*
64+
6465
---
6566

6667
## 🚀 Getting Started
@@ -88,11 +89,7 @@ make site
8889
```
8990

9091

91-
_Alternative: _ Or use the hugo CLI directly (at your own risk):
9292

93-
```bash
94-
hugo server -D
95-
```
9693

9794
The site will be available at `http://localhost:1313/academy/` (or the port shown in your terminal).
9895

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Instructor Toolkit"
3+
draft: false
4+
---
5+
6+
{{< instructor-toolkit >}}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ replace github.com/FortAwesome/Font-Awesome v4.7.0+incompatible => github.com/Fo
99

1010
require (
1111
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible // indirect
12-
github.com/layer5io/academy-theme v0.4.15 // indirect
12+
github.com/layer5io/academy-theme v0.4.17 // indirect
1313
github.com/twbs/bootstrap v5.3.7+incompatible // indirect
1414
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ github.com/layer5io/academy-theme v0.4.14 h1:vOUi3r7eOExs6uD6d+OYO4dfrmfrxASYrZj
3434
github.com/layer5io/academy-theme v0.4.14/go.mod h1:Dv72UWsREOvX4Zg4mJjrpoyDxdgxxpiDotxqYBXMjXo=
3535
github.com/layer5io/academy-theme v0.4.15 h1:4dGcps3/Z2mSsNGbzsCOikc8URQy4geNZpCiH0vXmxw=
3636
github.com/layer5io/academy-theme v0.4.15/go.mod h1:Dv72UWsREOvX4Zg4mJjrpoyDxdgxxpiDotxqYBXMjXo=
37+
github.com/layer5io/academy-theme v0.4.16 h1:nrwEIv8mji6sfq7cazyJVhGEoeisqu5RdQ0m5pnoUsk=
38+
github.com/layer5io/academy-theme v0.4.16/go.mod h1:Dv72UWsREOvX4Zg4mJjrpoyDxdgxxpiDotxqYBXMjXo=
39+
github.com/layer5io/academy-theme v0.4.17 h1:rnTuWwEIyYqtFyqiDz+GZOSTz/Wpud8256+QtH0HYXM=
40+
github.com/layer5io/academy-theme v0.4.17/go.mod h1:Dv72UWsREOvX4Zg4mJjrpoyDxdgxxpiDotxqYBXMjXo=
3741
github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
3842
github.com/twbs/bootstrap v5.3.7+incompatible h1:ea1W8TOWZFkqSK2M0McpgzLiUQVru3bz8aHb0j/XtuM=
3943
github.com/twbs/bootstrap v5.3.7+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

0 commit comments

Comments
 (0)