Skip to content

Commit 36e361e

Browse files
authored
Merge branch 'master' into add-home-page
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
2 parents cc92357 + 75bdc9f commit 36e361e

34 files changed

Lines changed: 1033 additions & 99 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ resources/
2626
.hugo_build.lock
2727
content/*
2828
!content/_index.md
29+
!content/instructor-toolkit.md
2930

3031
.DS_Store

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,111 @@ In addition to this core structure, the following content types are available:
2525
final-test)
2626
- **Certification** - Certification programs
2727

28+
### Where Content Should Live
29+
30+
Keep publishable Academy content and any org-specific supporting files inside
31+
the organization directory. Files outside the org directory are not part of
32+
the publishable Academy content tree. Validation catches these cases, and the
33+
files may be skipped during publication or change shared site behavior in
34+
unexpected ways.
35+
36+
Use this general layout:
37+
38+
```text
39+
content/
40+
learning-paths/
41+
<org-id>/
42+
_index.md
43+
course-1/
44+
_index.md
45+
module-1/
46+
_index.md
47+
certifications/
48+
<org-id>/
49+
_index.md
50+
challenges/
51+
<org-id>/
52+
_index.md
53+
layouts/
54+
shortcodes/
55+
<org-id>/
56+
*.html
57+
static/
58+
<org-id>/
59+
...
60+
data/
61+
<org-id>/
62+
...
63+
```
64+
65+
Put org-specific content, shortcodes, static files, and data under the org
66+
directory. If you place them elsewhere, the Academy may not publish them and
67+
the build can emit warnings or break shared assumptions for other content.
68+
69+
Shared theme assets, icons, and reusable partials should stay in
70+
academy-theme itself rather than in a consuming org repository.
71+
72+
## Quiz JSON contract
73+
74+
Quiz JSON emitted by the `test` layouts is normalized toward the
75+
`meshery/schemas` academy Quiz contract. The generated JSON now uses
76+
canonical quiz/question field names, numeric `timeLimit`, hyphenated question
77+
types, and UUIDs for page, parent, question, and option IDs.
78+
79+
Authors can still keep front matter ergonomic:
80+
81+
- page, question, and option `id` values may stay short slugs;
82+
- legacy snake_case quiz keys such as `pass_percentage`, `time_limit`,
83+
`max_attempts`, `correct_answer`, and `is_correct` are still accepted in
84+
front matter during the transition;
85+
- emitted UUIDs are derived deterministically from the content file path plus
86+
the authored ID, so repeated builds produce stable values.
87+
88+
## ID Validation
89+
90+
The theme checks publishable root Academy content during Hugo builds and emits
91+
warnings by default. This is intentionally warning-first so authors can keep
92+
working locally while still seeing what needs to be fixed before publication.
93+
94+
Configure the shared registry URL in the theme, and set the Instructor Console
95+
URL in each content repo:
96+
97+
```yaml
98+
params:
99+
academy:
100+
registryURL: "<shared-academy-registry-api-url>"
101+
consoleURL: "<per-repo-instructor-console-url>"
102+
validationMode: warn
103+
```
104+
105+
The registry URL is the same for all Academy sites. The console URL varies by
106+
domain, so each content repo should set its own value. For example, Exoscale
107+
uses `https://exoscale.layer5.io/academy/instructors-console`, while Meshery
108+
uses `https://cloud.meshery.io/academy/instructors-console`.
109+
110+
Supported `validationMode` values:
111+
112+
- `warn` keeps builds running and prints actionable warnings.
113+
- `error` fails only for broken publishable content, for stricter CI use.
114+
- `off` suppresses content health warnings and skips registry lookups.
115+
116+
Registry lookups are scoped to root learning paths, challenges, and
117+
certifications. Draft root content is not warning-producing and is hidden from
118+
the Instructor Toolkit report. Nested course/module/page/test IDs are not
119+
checked against the Cloud curriculum registry.
120+
121+
If `params.academy.registryURL` is not configured, the build prints one
122+
configuration warning and does not report existing IDs as invalid because they
123+
have not been checked against the registry.
124+
125+
The registry response is cached once per org and registry URL in Hugo's site
126+
store during a build. The remote response uses a cache key scoped to the current
127+
Hugo process, so incremental rebuilds reuse the same response. Rebuild the
128+
site completely to refresh the cached registry API response for fresh ID
129+
lookups.
130+
131+
The Instructor Toolkit surfaces the same build-generated report.
132+
28133
## Important Notes
29134

30135
⚠️ **Deprecated Features**

archetypes/final-test.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
11
---
22
title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
3-
pass_percentage: 70 # Minimum percentage required to pass the test
4-
time_limit: 15 # Duration of the test in minutes
3+
passPercentage: 70 # Minimum percentage required to pass the test
4+
timeLimit: 15 # Duration of the test in minutes
55
level: "beginner" # Difficulty level of the test
66
category: "Programming Languages" # Category of the test
77
tags: ["golang", "basics", "syntax", "fundamentals"] # Tags for the test, useful for search and categorization
88
type: "test" # Type of the content, in this case, a test ( required for the test to be recognized by the system )
99
final: true # Indicates that this test is the final exam and must be completed to complete the course , module or section
1010

1111
questions:
12+
# IDs can stay short slugs in front matter; academy-theme derives stable UUIDs in emitted quiz JSON.
1213
# Multiple Choice Question (Single Answer)
1314
# NOTE: The 'marks' field must be a positive number (greater than 0). Negative or zero values will cause a build error.
1415
- id: "q1"
1516
text: "What keyword is used to define a function in Go?"
16-
type: "multiple_answers"
17+
type: "single-answer"
1718
marks: 2
1819
explanation: "The 'func' keyword is used to declare functions in Go, similar to how 'function' is used in JavaScript."
1920
options:
2021
- id: "a"
2122
text: "function"
22-
is_correct: false
23+
isCorrect: false
2324
- id: "b"
2425
text: "def"
25-
is_correct: false
26+
isCorrect: false
2627
- id: "c"
2728
text: "func"
28-
is_correct: true
29+
isCorrect: true
2930
- id: "d"
3031
text: "fn"
31-
is_correct: false
32+
isCorrect: false
3233

3334
# Short Answer Question
3435
- id: "q2"
3536
text: "Go is a statically typed language. (true/false)"
36-
type: "short_answer"
37+
type: "short-answer"
3738
marks: 2
38-
correct_answer: "true"
39+
correctAnswer: "true"
3940
case_sensitive: false
4041
explanation: "Go is indeed a statically typed language, meaning variable types are determined at compile time."
4142

4243
# Short Answer Question (Numeric)
4344
- id: "q3"
4445
text: "What is the zero value of an uninitialized int in Go?"
45-
type: "short_answer"
46+
type: "short-answer"
4647
marks: 2
47-
correct_answer: "0"
48+
correctAnswer: "0"
4849
explanation: "In Go, the zero value for numeric types like int is 0."
4950

5051
# Multiple Choice Question (Multiple Answers)
5152
- id: "q4"
5253
text: "What are the purposes of the 'defer' keyword in Go? (Select all that apply)"
53-
type: "multiple_answers"
54+
type: "multiple-answers"
5455
marks: 2
5556
explanation: "The defer keyword is commonly used to delay function execution until the surrounding function returns, often used for cleanup tasks like closing files."
5657
options:
5758
- id: "a"
5859
text: "To delay the execution of a function until the surrounding function returns"
59-
is_correct: true
60+
isCorrect: true
6061
- id: "b"
6162
text: "To define a constant value"
62-
is_correct: false
63+
isCorrect: false
6364
- id: "c"
6465
text: "To close resources like files or network connections"
65-
is_correct: true
66+
isCorrect: true
6667
- id: "d"
6768
text: "To handle errors in a function"
68-
is_correct: false
69+
isCorrect: false
6970
---

archetypes/optional-test.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
11
---
22
title: '{{ replace .File.ContentBaseName `-` ` ` | title }}'
3-
pass_percentage: 70 # Minimum percentage required to pass the test
4-
time_limit: 15 # Duration of the test in minutes
3+
passPercentage: 70 # Minimum percentage required to pass the test
4+
timeLimit: 15 # Duration of the test in minutes
55
level: "beginner" # Difficulty level of the test
66
category: "Programming Languages" # Category of the test
77
tags: ["golang", "basics", "syntax", "fundamentals"] # Tags for the test, useful for search and categorization
88
type: "test" # Type of the content, in this case, a test ( required for the test to be recognized by the system )
99
is_optional: true # Indicates that this test is optional and does not need to be completed to take the final exam
1010

1111
questions:
12+
# IDs can stay short slugs in front matter; academy-theme derives stable UUIDs in emitted quiz JSON.
1213
# Multiple Choice Question (Single Answer)
1314
# NOTE: The 'marks' field must be a positive number (greater than 0). Negative or zero values will cause a build error.
1415
- id: "q1"
1516
text: "What keyword is used to define a function in Go?"
16-
type: "multiple_answers"
17+
type: "single-answer"
1718
marks: 2
1819
explanation: "The 'func' keyword is used to declare functions in Go, similar to how 'function' is used in JavaScript."
1920
options:
2021
- id: "a"
2122
text: "function"
22-
is_correct: false
23+
isCorrect: false
2324
- id: "b"
2425
text: "def"
25-
is_correct: false
26+
isCorrect: false
2627
- id: "c"
2728
text: "func"
28-
is_correct: true
29+
isCorrect: true
2930
- id: "d"
3031
text: "fn"
31-
is_correct: false
32+
isCorrect: false
3233

3334
# Short Answer Question
3435
- id: "q2"
3536
text: "Go is a statically typed language. (true/false)"
36-
type: "short_answer"
37+
type: "short-answer"
3738
marks: 2
38-
correct_answer: "true"
39+
correctAnswer: "true"
3940
case_sensitive: false
4041
explanation: "Go is indeed a statically typed language, meaning variable types are determined at compile time."
4142

4243
# Short Answer Question (Numeric)
4344
- id: "q3"
4445
text: "What is the zero value of an uninitialized int in Go?"
45-
type: "short_answer"
46+
type: "short-answer"
4647
marks: 2
47-
correct_answer: "0"
48+
correctAnswer: "0"
4849
explanation: "In Go, the zero value for numeric types like int is 0."
4950

5051
# Multiple Choice Question (Multiple Answers)
5152
- id: "q4"
5253
text: "What are the purposes of the 'defer' keyword in Go? (Select all that apply)"
53-
type: "multiple_answers"
54+
type: "multiple-answers"
5455
marks: 2
5556
explanation: "The defer keyword is commonly used to delay function execution until the surrounding function returns, often used for cleanup tasks like closing files."
5657
options:
5758
- id: "a"
5859
text: "To delay the execution of a function until the surrounding function returns"
59-
is_correct: true
60+
isCorrect: true
6061
- id: "b"
6162
text: "To define a constant value"
62-
is_correct: false
63+
isCorrect: false
6364
- id: "c"
6465
text: "To close resources like files or network connections"
65-
is_correct: true
66+
isCorrect: true
6667
- id: "d"
6768
text: "To handle errors in a function"
68-
is_correct: false
69+
isCorrect: false
6970
---

archetypes/test.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
---
22
title: 'test'
3-
pass_percentage: 70 # Minimum percentage required to pass the test
4-
time_limit: 15 # Duration of the test in minutes
5-
max_attempts: 3 # Maximum number of attempts allowed
3+
passPercentage: 70 # Minimum percentage required to pass the test
4+
timeLimit: 15 # Duration of the test in minutes
5+
maxAttempts: 3 # Maximum number of attempts allowed
66
level: "beginner" # Difficulty level of the test
77
category: "Programming Languages" # Category of the test
88
tags: ["golang", "basics", "syntax", "fundamentals"] # Tags for the test, useful for search and categorization
99
type: "test" # Type of the content, in this case, a test ( required for the test to be recognized by the system )
1010

1111
questions:
12+
# IDs can stay short slugs in front matter; academy-theme derives stable UUIDs in emitted quiz JSON.
1213
# Multiple Choice Question (Single Answer)
1314
- id: "q1"
1415
text: "What keyword is used to define a function in Go?"
15-
type: "multiple_answers"
16+
type: "single-answer"
1617
marks: 2
1718
explanation: "The 'func' keyword is used to declare functions in Go, similar to how 'function' is used in JavaScript."
1819
options:
1920
- id: "a"
2021
text: "function"
21-
is_correct: false
22+
isCorrect: false
2223
- id: "b"
2324
text: "def"
24-
is_correct: false
25+
isCorrect: false
2526
- id: "c"
2627
text: "func"
27-
is_correct: true
28+
isCorrect: true
2829
- id: "d"
2930
text: "fn"
30-
is_correct: false
31+
isCorrect: false
3132

3233
# Short Answer Question
3334
- id: "q2"
3435
text: "Go is a statically typed language. (true/false)"
35-
type: "short_answer"
36+
type: "short-answer"
3637
marks: 2
37-
correct_answer: "true"
38+
correctAnswer: "true"
3839
case_sensitive: false
3940
explanation: "Go is indeed a statically typed language, meaning variable types are determined at compile time."
4041

4142
# Short Answer Question (Numeric)
4243
- id: "q3"
4344
text: "What is the zero value of an uninitialized int in Go?"
44-
type: "short_answer"
45+
type: "short-answer"
4546
marks: 2
46-
correct_answer: "0"
47+
correctAnswer: "0"
4748
explanation: "In Go, the zero value for numeric types like int is 0."
4849

4950
# Multiple Choice Question (Multiple Answers)
@@ -55,14 +56,14 @@ questions:
5556
options:
5657
- id: "a"
5758
text: "To delay the execution of a function until the surrounding function returns"
58-
is_correct: true
59+
isCorrect: true
5960
- id: "b"
6061
text: "To define a constant value"
61-
is_correct: false
62+
isCorrect: false
6263
- id: "c"
6364
text: "To close resources like files or network connections"
64-
is_correct: true
65+
isCorrect: true
6566
- id: "d"
6667
text: "To handle errors in a function"
67-
is_correct: false
68+
isCorrect: false
6869
---

assets/scss/_styles_project.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,19 @@ a:not([href]):not([class]):hover {
290290
background-color: rgba($primary, 0.1);
291291
color: dark;
292292
}
293+
294+
&.academy-sidebar-toolkit {
295+
color: $dark;
296+
font-weight: $font-weight-bold;
297+
}
298+
299+
&.active.academy-sidebar-toolkit {
300+
border: 2px solid $lightslategray !important;
301+
padding: 0.25rem;
302+
padding-left: 0.5rem !important;
303+
background-color: rgba($primary, 0.1);
304+
color: $dark;
305+
}
293306
}
294307
}
295308

0 commit comments

Comments
 (0)