Skip to content

Commit 70a084c

Browse files
authored
Merge pull request #697 from zihanKuang/improve-academy-docs
Docs: Refine Academy Publishing and Setup Guides
2 parents 9d616aa + b66ded0 commit 70a084c

File tree

4 files changed

+136
-57
lines changed

4 files changed

+136
-57
lines changed
Loading
Loading

content/en/cloud/academy/creating-your-learning-path/index.md

Lines changed: 126 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ tags: [Designer]
99

1010
This guide provides a step-by-step walkthrough for creating and organizing a new learning path in the [Layer5 Academy](https://cloud.layer5.io/academy/overview). You'll learn how to set up your content repository, structure your courses, add assets, preview your work, and publish it for your organization.
1111

12-
### 1. Set Up Your Content Repository
12+
### Prerequisites
13+
14+
Before you dive into creating your first learning path, it's helpful to be familiar with the core technologies and concepts used by the Academy platform.
15+
16+
- **Git and GitHub**: All learning content is managed in a Git repository.
17+
- **Markdown**: All course and chapter content is written in standard Markdown.
18+
- **Hugo**: The entire Academy platform is built on the [Hugo](https://gohugo.io/) static site generator.
19+
- **Academy Template & Theme**: We provide an `academy-example` repository that serves as a pre-configured template. [Layer5 Academy theme](https://github.com/layer5io/academy-theme) to ensure your content is styled correctly right out of the box.
20+
- **A Layer5 Cloud Account**: Required to obtain your Organization ID and Personal Access Token for publishing.
21+
22+
## 1. Set Up Your Content Repository
1323

1424
Start by preparing a dedicated Git repository for your learning content. Using our official Layer5 template to help you get started quickly.
1525

@@ -43,19 +53,19 @@ Start by preparing a dedicated Git repository for your learning content. Using o
4353
4. Save the file, then commit and push this change to your repository.
4454
4555
{{< alert type="info" title="Critical Step" >}}
46-
This step is essential. It updates your repository's "identity card" (`go.mod`) to match its new "address" (your GitHub URL). Without this change, the layer5 cloud build process will fail.
56+
This step is essential. It updates your repository's "identity card" (`go.mod`) to match its new "address" (your GitHub URL). Without this change, the Academy publishing process will fail.
4757
{{< /alert >}}
4858

49-
### 2. Structure Your Learning Path
59+
## 2. Structure Your Learning Path
5060

5161
The Academy uses a specific directory layout to keep each organization's content separate and secure.
5262
53-
1. **Get Your Organization ID**
63+
1. **Find Your Organization UUID**
5464
55-
Each learning path is tied to a specific organization. Before creating content, you must get your organization's unique identifier (UID). This is a system-generated ID, not a name you create.
65+
Each learning path is tied to a specific organization and secured by a unique identifier (UUID). This is a system-generated ID that ensures your content is scoped only to your organization.
5666
57-
{{< alert type="info" title="What is the UID?" >}}
58-
The Organization UID ensures that your learning content is securely associated with your organization and displayed only to its members. You will use this exact UID to name your core content folders.
67+
{{< alert type="info" title="How to Find Your Organization UUID?" >}}
68+
You can find and copy your Organization UUID from your organization page on [Layer5 Cloud](https://cloud.layer5.io/identity/organizations).
5969
{{< /alert >}}
6070
6171
2. **Create the Core Directories**
@@ -67,47 +77,31 @@ The Organization UID ensures that your learning content is securely associated w
6777
2. `static/<your-organization-uid>/`
6878
This `static` directory is for all your assets, such as images, diagrams, and so on.
6979
3. `layouts/shortcodes/<your-organization-uid>/`
70-
This `layouts` directory is for advanced use. You can place custom **Hugo Shortcodes** here if you need special reusable components in your lessons.
80+
This `layouts` directory is for advanced use. You can place custom **Hugo Shortcodes** here if you need special reusable components in your Chapters.
7181
7282
3. **Build the Content Hierarchy**
7383
74-
With the main folders in place, you can now structure your first course inside the `content` directory. The content is organized in a clear hierarchy: **Learning PathCourseChapterLesson**.
84+
With the main folders in place, you can now structure your first course inside the `content` directory. The content is organized in a clear hierarchy: **Learning Path → Course → Chapter**.
7585
7686
A high-level view of the structure looks like this:
7787
7888
```text
7989
content/
8090
└── learning-paths/
8191
├── _index.md
82-
└── <your-organization-uid>/
83-
└── <your-learning-path>/
92+
└── ea124d12-234a-6f78-9df0-1fa2b3e4d567/ // <-- Organization UID
93+
└── mastering-kubernetes/ // <-- Learning Path
8494
├── _index.md
85-
└── <your-course-1>/
86-
└── <your-course-2>/
95+
└── advanced-networking/ // <-- Course 1
96+
└── core-concepts/ // <-- Course 2
8797
├── _index.md
88-
└── content/
89-
└── your-lesson-1.md
90-
└── your-lesson-2.md
98+
├── 01-pods.md // <-- Chapter 1
99+
└── 02-services.md // <-- Chapter 2
91100
```
92101
93-
Each folder represents a level in the hierarchy, and the `_index.md` file within a folder defines the metadata (like title and description) for that level. The final `.md` files are your individual lessons.
94-
95-
Let's look at the role of each level:
96-
97-
- **The Section (`learning-paths`)**
98-
This is the top-level category for your content. The `_index.md` file at this level defines the main landing page for all learning paths.
99-
100-
- **Your Organization Folder (`<your-organization-uid>`)**
101-
This is the most important folder for ensuring your content is properly scoped. All of your learning paths must reside inside a single folder named with your organization uid.
102+
Each folder represents a level in the hierarchy, and the `_index.md` file within a folder defines the metadata (like title and description) for that level. The final `.md` files are your individual Chapter.
102103
103-
- **The Learning Path (`<your-learning-path>`)**
104-
This folder represents a complete learning path. The `_index.md` file inside it contains the title, description, and other metadata that will be displayed on the learning path's summary card.
105-
106-
- **The Course or Chapter (`<your-course>`)**
107-
Within a learning path, each course or chapter gets its own folder. The `_index.md` file here defines the course's metadata and, most importantly, the `toc` (Table of Contents) that sets the order of your lessons.
108-
109-
- **The Lessons (`content/`)**
110-
Finally, inside each course folder, a `content` directory holds all your individual lesson files, written in standard Markdown.
104+
> For a deeper understanding of how Hugo uses `_index.md` to create content sections, you can refer to the official [Hugo Page Bundles documentation](https://gohugo.io/content-management/page-bundles/).
111105
112106
4. **Front matter**
113107
@@ -142,18 +136,23 @@ The Organization UID ensures that your learning content is securely associated w
142136
| ------------- | ------------- | -------- | --------------------------- |
143137
| Learning Path | `title` | ✅ | |
144138
| | `description` | ✅ | |
145-
| | `weight` | ✅ | Defines order in the path |
139+
| | `weight` | ✅ | Defines order in the path, Lower numbers appear first |
146140
| | `banner` | ❌ | Optional image URI |
147141
| Course | `title` | ✅ | |
148142
| | `description` | ✅ | |
149143
| | `weight` | ✅ | Defines order in the path |
150144
| | `banner` | ❌ | Optional image URI |
151145
| | `prerequisites` | ❌ | Optional List of prerequisites for the course |
152146
147+
> For a complete list of all predefined variables and advanced usage, please refer to the official [Hugo Front Matter documentation](https://gohugo.io/content-management/front-matter/).
153148
154-
### 3. Add Assets and Interactive Content
149+
## 3. Add Assets and Interactive Content
155150
156-
Enhance your course with images and other visual aids. To ensure compatibility with the multi-tenant Academy platform, **do not use standard Markdown image links**. Instead, use the `usestatic` shortcode, which generates the correct, tenant-aware path for your assets.
151+
Enhance your course with images and other visual aids. To ensure compatibility with the multi-tenant Academy platform, do not use standard Markdown image links. Instead, use the `usestatic` shortcode, which generates the correct, tenant-aware path for your assets.
152+
153+
{{< alert type="warning" title="Do Not Use Standard Markdown Image Links" >}}
154+
Do not use standard Markdown image links. Always use the `usestatic` shortcode for images to ensure compatibility with the platform.
155+
{{< /alert >}}
157156
158157
**How to Add an Image**
159158
@@ -162,7 +161,7 @@ Enhance your course with images and other visual aids. To ensure compatibility w
162161
```text
163162
static/<your-organization-uid>/images/hugo-logo.png
164163
```
165-
2. In your `lesson-1.md` file, embed the image using the `usestatic` shortcode. The `path` is relative to your scoped static folder:
164+
2. In your `Chapter-1.md` file, embed the image using the `usestatic` shortcode. The `path` is relative to your scoped static folder:
166165
167166
```text
168167
![The Hugo Logo]({{</* usestatic path="images/hugo-logo.png" */>}})
@@ -182,35 +181,111 @@ title="Video: Example" */>}}
182181
{{</* /card */>}}
183182
```
184183
185-
### 4. Build and Preview Locally
184+
{{< alert type="info" title="Best Practice" >}}
185+
If your images are only needed for a specific chapter or section (not globally), it is recommended to place them next to the relevant content folder. This keeps your project organized and makes asset management easier.
186+
{{< /alert >}}
187+
188+
## 4. Build and Preview Locally
186189
187-
Before publishing, preview your content locally to check formatting and structure. Run the following command in your project directory:
190+
Before publishing, it is crucial to preview your content locally to check for formatting errors, broken links, and overall structure.
188191
189192
```bash
190-
hugo server
193+
make site
191194
```
192195
193-
This will start a local server where you can view your content.
194-
196+
This will start a local development server, where you can view your learning path as you build it.
195197
![Preview site](./images/preview-site.png)
196198
197-
> The local preview shows basic styles; the full Academy styling will appear after your content is uploaded to the cloud platform.
199+
{{< alert type="info" title="Local Previews" >}}
200+
The local preview uses a generic theme to show the structure and content of your learning path. It **will not** display your organization's specific branding, such as custom logos or color schemes. The full, branded experience will only be visible after your content is published to the Layer5 Academy platform.
201+
202+
You can configure your organization's branding in the [Layer5 Cloud Organization Settings](https://cloud.layer5.io/identity/organizations).
203+
{{< /alert >}}
204+
205+
## 5. Publishing Your Learning Path
206+
207+
Once you have tested your content locally, you can publish it to the [Layer5 Academy](https://cloud.layer5.io/academy/overview) through our automated workflow. The process involves a one-time setup of secrets and then creating a GitHub Release to publish each new version.
208+
209+
### Stage 1: Configure the Publishing Workflow (One-Time Setup)
210+
211+
To allow your repository to securely communicate with the Academy's build system, you must configure GitHub Secrets. This one-time setup ensures your publishing workflow can authenticate automatically.
212+
213+
#### 1. Verify Required Secret Names
214+
215+
First, confirm the **exact secret names** required by the workflow.
216+
217+
In your repository, open the workflow file at `.github/workflows/build-and-release.yml`. This confirms the workflow expects secrets named exactly `ACADEMY_ORG_ID` and `ACADEMY_TOKEN`.
218+
```yaml
219+
with:
220+
orgId: ${{ secrets.ACADEMY_ORG_ID }}
221+
token: ${{ secrets.ACADEMY_TOKEN }}
222+
# ... and other parameters
223+
```
224+
225+
#### 2. Set Up Repository Secrets
226+
227+
Now, create the two required secrets in your repository.
228+
229+
1. Navigate to your GitHub repository and go to `Settings` > `Secrets and variables` > `Actions`.
230+
2. Ensure you are on the **Secrets** tab.
231+
3. Click `New repository secret` to add the following two secrets:
232+
1. **Name:** `ACADEMY_ORG_ID`
233+
234+
**Value:** Paste your unique Organization ID string.
235+
236+
2. **Name:** `ACADEMY_TOKEN`
237+
238+
**Value:** Paste the personal access token generated from Layer5 Cloud by following the instructions below.
239+
240+
{{< alert type="info" title="How to Correctly Copy Your Token" >}}
241+
When you generate a token from the [Layer5 Cloud Tokens page](https://cloud.layer5.io/security/tokens), you will get a JSON object like this:
242+
`{"meshery-provider":"Meshery","token":"eyj...your-long-token-string..."}` You must copy only the token string itself—the value inside the quotes for the `"token"` key.
243+
244+
Do NOT include the curly braces `{}`, the `"token":` key, or the surrounding quotes. The value you paste into the secret should begin with `eyj...`.
245+
{{< /alert >}}
246+
247+
Once configured correctly, your secrets page should look like this:
248+
![Secrets page showing correct configuration](./images/setting.png)
249+
250+
{{< alert type="info" title="Alternative Method (Not Recommended)" >}}
251+
While you can hardcode your `ACADEMY_ORG_ID` directly in the workflow file, we strongly recommend using secrets for better security and flexibility.
252+
{{< /alert >}}
253+
254+
### Stage 2: Publish by Creating a GitHub Release
255+
256+
With the setup complete, you can publish your content anytime by creating a new release.
257+
258+
1. Ensure all your latest changes are committed and pushed to your repository's `master` branch.
259+
2. On your GitHub repository page, navigate to the **"Releases"** section.
260+
3. Click **"Draft a new release"**.
261+
4. Create a new version tag for your release (e.g., `v1.0.1`).
262+
5. Provide a title and description for your release.
263+
6. Click **"Publish release"**.
264+
265+
This action will automatically trigger the workflow, and your content will be deployed to the [Layer5 Academy](https://cloud.layer5.io/identity/overview).
266+
267+
> **For Urgent Updates:** If you have a time-sensitive publishing request or encounter any issues with the automated process, please [contact the Layer5 team](https://layer5.io/company/contact) for expedited assistance.
268+
269+
![Release Example](./images/release-publish.gif)
198270
199-
### 5. Going Live
271+
## Frequently Asked Questions
200272
201-
After you have completed and tested your content locally, reach out to the Layer5 team to request integration of your learning path. You can [connect](https://layer5.io/company/contact) with us via Slack, email, or by opening a GitHub issue. Be sure to provide the URL of your course repository when making your request.
273+
1. **Why is my workflow failing with a `401 Unauthorized` or `user must be logged in` error?**
202274
203-
A Layer5 administrator will then integrate your repository into the main Academy platform by updating the central configuration to mount your repository as a Hugo Module. Once this process is complete, your learning paths will be visible on the official Layer5 Cloud site.
275+
This error indicates an issue with your **`ACADEMY_TOKEN`**. Please ensure you have correctly copied **only the token string** and not the entire JSON object from the downloaded file.
204276
205-
### Frequently Asked Questions
277+
2. **Why is my workflow failing with a URL containing a double slash (`//`)?**
206278
207-
- **How do I handle updates or corrections after my content is live?**
279+
A double slash in the URL (e.g., `.../api/academy//update/...`) means your **`ACADEMY_ORG_ID`** was not found. This typically happens when the secret name in your repository does not **exactly match** the name expected by the workflow file (e.g., `ORG_ID`).
208280
209-
All content updates and corrections are managed through your own Git repository. Simply commit and push your changes, and they will be automatically synchronized and published with the next Layer5 Cloud release.
281+
3. **How do I handle updates or corrections after my content is live?**
210282
211-
- **How do I structure multiple courses under one learning path?**
283+
All content updates are managed through your Git repository. Simply commit and push your changes, then **create a new GitHub Release** with a new version number (e.g., `v1.0.2`). This automatically triggers the publishing workflow and updates your content on the Academy platform.
212284
213-
The structure is defined by your folder hierarchy. A learning path is a directory, and each course is simply a sub-directory within that path. This folder structure in your `content` directory directly maps to the learning path structure presented to users.
285+
4. **What happens if my new content has an error?**
214286
287+
The publishing process is designed to be safe. If your new content causes a build error, the workflow will fail, and the previously working version of the Academy will remain unchanged. Your broken update will not be published.
215288
289+
5. **How do I structure multiple courses under one learning path?**
216290
291+
The structure is defined by your folder hierarchy. A learning path is a directory, and each course is a sub-directory within that path. This folder structure in your `content` directory directly maps to the learning path structure presented to users.

0 commit comments

Comments
 (0)