|
| 1 | +--- |
| 2 | +title: Creating Your First Learning Path |
| 3 | +weight: 3 |
| 4 | +description: > |
| 5 | + A hands-on tutorial that walks you through creating, structuring, and testing a custom learning path for the Layer5 Academy. |
| 6 | +categories: [Academy] |
| 7 | +tags: [Designer] |
| 8 | +--- |
| 9 | + |
| 10 | +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. |
| 11 | + |
| 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 |
| 23 | + |
| 24 | +Start by preparing a dedicated Git repository for your learning content. Using our official Layer5 template to help you get started quickly. |
| 25 | + |
| 26 | +1. **Fork the academy-example Repository** |
| 27 | + |
| 28 | +- Go to the [academy-example repository](https://github.com/layer5io/academy-example) on GitHub. |
| 29 | +- Click **Fork** to create a copy under your own GitHub account. |
| 30 | + |
| 31 | +2. **Clone Your Fork Locally** |
| 32 | + |
| 33 | +- Use the `git clone` command to download your forked repository. |
| 34 | +- Example: |
| 35 | + ```bash |
| 36 | + # Replace `<your-username>` with your actual GitHub username |
| 37 | + git clone https://github.com/<your-username>/academy-example.git |
| 38 | + cd academy-example |
| 39 | + git checkout -b <your-feature-branch> |
| 40 | + ``` |
| 41 | + |
| 42 | +3. **Update the Go Module Path** |
| 43 | + |
| 44 | + 1. Open the `go.mod` file located at the root of your `academy-example` project. |
| 45 | + 2. The first line will be: |
| 46 | + ```go |
| 47 | + module github.com/layer5io/academy-example |
| 48 | + ``` |
| 49 | + 3. Change this line to match your fork's path: |
| 50 | + ```go |
| 51 | + module github.com/<your-username>/academy-example |
| 52 | + ``` |
| 53 | + 4. Save the file, then commit and push this change to your repository. |
| 54 | +
|
| 55 | +{{< alert type="info" title="Critical Step" >}} |
| 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. |
| 57 | +{{< /alert >}} |
| 58 | + |
| 59 | +## 2. Structure Your Learning Path |
| 60 | + |
| 61 | +The Academy uses a specific directory layout to keep each organization's content separate and secure. |
| 62 | +
|
| 63 | +1. **Find Your Organization UUID** |
| 64 | +
|
| 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. |
| 66 | +
|
| 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). |
| 69 | +{{< /alert >}} |
| 70 | +
|
| 71 | +2. **Create the Core Directories** |
| 72 | +
|
| 73 | + Now, inside your `academy-example` project, you should see the following top-level folders. |
| 74 | +
|
| 75 | + 1. `content/learning-paths/<your-organization-uid>/` |
| 76 | + This `content` directory is where all your written material lives. The folder hierarchy you create here directly defines the navigation and organization of your learning paths. |
| 77 | + 2. `static/<your-organization-uid>/` |
| 78 | + This `static` directory is for all your assets, such as images, diagrams, and so on. |
| 79 | + 3. `layouts/shortcodes/<your-organization-uid>/` |
| 80 | + This `layouts` directory is for advanced use. You can place custom **Hugo Shortcodes** here if you need special reusable components in your Chapters. |
| 81 | +
|
| 82 | +3. **Build the Content Hierarchy** |
| 83 | +
|
| 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**. |
| 85 | +
|
| 86 | + A high-level view of the structure looks like this: |
| 87 | +
|
| 88 | + ```text |
| 89 | + content/ |
| 90 | + └── learning-paths/ |
| 91 | + ├── _index.md |
| 92 | + └── ea124d12-234a-6f78-9df0-1fa2b3e4d567/ // <-- Organization UID |
| 93 | + └── mastering-kubernetes/ // <-- Learning Path |
| 94 | + ├── _index.md |
| 95 | + └── advanced-networking/ // <-- Course 1 |
| 96 | + └── core-concepts/ // <-- Course 2 |
| 97 | + ├── _index.md |
| 98 | + ├── 01-pods.md // <-- Chapter 1 |
| 99 | + └── 02-services.md // <-- Chapter 2 |
| 100 | + ``` |
| 101 | +
|
| 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. |
| 103 | +
|
| 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/). |
| 105 | +
|
| 106 | +4. **Front matter** |
| 107 | +
|
| 108 | + Use this at the top of each **Learning Path** page (`learning-paths/<orgId>/<slug>/_index.md` or similar): |
| 109 | +
|
| 110 | + ```yaml |
| 111 | + --- |
| 112 | + title: "Mastering Kubernetes for Engineers" |
| 113 | + description: "Learn how to configure your Kubernetes clusters and manage the lifecycle of your workloads" |
| 114 | + banner: null # Optional, URL to banner image |
| 115 | + --- |
| 116 | + ``` |
| 117 | +
|
| 118 | + > Place this frontmatter in the Markdown file that represents the learning path index page. |
| 119 | +
|
| 120 | + **Course Frontmatter (Optional Individual Course Pages)** |
| 121 | +
|
| 122 | + If each course has its own markdown page, you can use this frontmatter: |
| 123 | +
|
| 124 | + ```yaml |
| 125 | + --- |
| 126 | + title: "Kubernetes Basics" |
| 127 | + description: "Learn the basics of Kubernetes" |
| 128 | + weight: 1 |
| 129 | + banner: null # Optional |
| 130 | + --- |
| 131 | + ``` |
| 132 | +
|
| 133 | + **Summary of Required Fields** |
| 134 | +
|
| 135 | + | Type | Field | Required | Notes | |
| 136 | + | ------------- | ------------- | -------- | --------------------------- | |
| 137 | + | Learning Path | `title` | ✅ | | |
| 138 | + | | `description` | ✅ | | |
| 139 | + | | `weight` | ✅ | Order in path, lower first | |
| 140 | + | | `banner` | ❌ | Optional image URI | |
| 141 | + | Course | `title` | ✅ | | |
| 142 | + | | `description` | ✅ | | |
| 143 | + | | `weight` | ✅ | Order in path | |
| 144 | + | | `banner` | ❌ | Optional image URI | |
| 145 | + | | `prerequisites` | ❌ | Optional List of prerequisites for the course | |
| 146 | + | | `draft` | ❌ | Skips build, won't appear| |
| 147 | + | | `tags` | ❌ | Keywords for content | |
| 148 | + | | `categories` | ❌ | Main content categories | |
| 149 | + |
| 150 | + |
| 151 | +{{< alert type="warning" title="Banner Image Paths" >}} |
| 152 | +When using the `banner` field in your frontmatter, always provide the full, static path to your image. This path must start with your Organization UUID; for example: `/org_id/images/kubernetes-icon.svg`. |
| 153 | +{{< /alert >}} |
| 154 | + |
| 155 | +> 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/). |
| 156 | + |
| 157 | +## 3. Add Assets and Interactive Content |
| 158 | + |
| 159 | +Enhance your course with images and other visual aids. The recommended and standard method for adding images is Page Bundling. This approach involves placing your image files directly alongside the Markdown content they belong to, which is simpler and keeps content organized. |
| 160 | + |
| 161 | +{{< alert type="success" title="Recommended Method: Page Bundling" >}} |
| 162 | +For all assets, please use the Page Bundling method. It simplifies asset management by co-locating images with the Markdown files that use them. |
| 163 | +{{< /alert >}} |
| 164 | + |
| 165 | +**How to Add an Image** |
| 166 | + |
| 167 | +1. Place your image file (e.g., `hugo-logo.png`) in the **same directory** as your Markdown file (e.g., `Chapter-1.md`). |
| 168 | + |
| 169 | +2. In your `Chapter-1.md` file, embed the image using a **standard Markdown link**. The path should just be the filename. |
| 170 | + |
| 171 | + ```markdown |
| 172 | +  |
| 173 | + ``` |
| 174 | + |
| 175 | +{{< alert type="warning" title="Legacy Method: Do Not Use" >}} |
| 176 | +The `usestatic` shortcode is **deprecated** and should not be used for new courses. |
| 177 | +{{< /alert >}} |
| 178 | + |
| 179 | +**How to Add a Video** |
| 180 | + |
| 181 | +```text |
| 182 | +{{</* card |
| 183 | +title="Video: Example" */>}} |
| 184 | +<video width="100%" height="100%" controls> |
| 185 | + <source src="https://exmaple.mp4" type="video/mp4"> |
| 186 | + Your browser does not support the video tag. |
| 187 | +</video> |
| 188 | +{{</* /card */>}} |
| 189 | +``` |
| 190 | + |
| 191 | +## 4. Build and Preview Locally |
| 192 | + |
| 193 | +Before publishing, it is crucial to preview your content locally to check for formatting errors, broken links, and overall structure. |
| 194 | + |
| 195 | +```bash |
| 196 | +make site |
| 197 | +``` |
| 198 | + |
| 199 | +This will start a local development server, where you can view your learning path as you build it. |
| 200 | + |
| 201 | + |
| 202 | +{{< alert type="info" title="Local Previews" >}} |
| 203 | +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. |
| 204 | +
|
| 205 | +You can configure your organization's branding in the [Layer5 Cloud Organization Settings](https://cloud.layer5.io/identity/organizations). |
| 206 | +{{< /alert >}} |
| 207 | + |
| 208 | +## 5. Publishing Your Learning Path |
| 209 | + |
| 210 | +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. |
| 211 | + |
| 212 | +### Stage 1: Configure the Publishing Workflow (One-Time Setup) |
| 213 | + |
| 214 | +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. |
| 215 | +
|
| 216 | +#### 1. Verify Required Secret Names |
| 217 | +
|
| 218 | +First, confirm the **exact secret names** required by the workflow. |
| 219 | +
|
| 220 | +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`. |
| 221 | + ```yaml |
| 222 | + with: |
| 223 | + orgId: ${{ secrets.ACADEMY_ORG_ID }} |
| 224 | + token: ${{ secrets.ACADEMY_TOKEN }} |
| 225 | + # ... and other parameters |
| 226 | + ``` |
| 227 | +
|
| 228 | +#### 2. Set Up Repository Secrets |
| 229 | +
|
| 230 | +Now, create the two required secrets in your repository. |
| 231 | +
|
| 232 | +1. Navigate to your GitHub repository and go to `Settings` > `Secrets and variables` > `Actions`. |
| 233 | +2. Ensure you are on the **Secrets** tab. |
| 234 | +3. Click `New repository secret` to add the following two secrets: |
| 235 | + 1. **Name:** `ACADEMY_ORG_ID` |
| 236 | +
|
| 237 | + **Value:** Paste your unique Organization ID string. |
| 238 | +
|
| 239 | + 2. **Name:** `ACADEMY_TOKEN` |
| 240 | +
|
| 241 | + **Value:** Paste the personal access token generated from Layer5 Cloud by following the instructions below. |
| 242 | +
|
| 243 | +{{< alert type="info" title="How to Correctly Copy Your Token" >}} |
| 244 | +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: |
| 245 | +`{"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. |
| 246 | +
|
| 247 | +Do NOT include the curly braces `{}`, the `"token":` key, or the surrounding quotes. The value you paste into the secret should begin with `eyj...`. |
| 248 | +{{< /alert >}} |
| 249 | +
|
| 250 | +Once configured correctly, your secrets page should look like this: |
| 251 | + |
| 252 | +
|
| 253 | +{{< alert type="info" title="Alternative Method (Not Recommended)" >}} |
| 254 | +While you can hardcode your `ACADEMY_ORG_ID` directly in the workflow file, we strongly recommend using secrets for better security and flexibility. |
| 255 | +{{< /alert >}} |
| 256 | +
|
| 257 | +### Stage 2: Publish by Creating a GitHub Release |
| 258 | +
|
| 259 | +With the setup complete, you can publish your content anytime by creating a new release. |
| 260 | +
|
| 261 | +1. Ensure all your latest changes are committed and pushed to your repository's `master` branch. |
| 262 | +2. On your GitHub repository page, navigate to the **"Releases"** section. |
| 263 | +3. Click **"Draft a new release"**. |
| 264 | +4. Create a new version tag for your release (e.g., `v1.0.1`). |
| 265 | +5. Provide a title and description for your release. |
| 266 | +6. Click **"Publish release"**. |
| 267 | + |
| 268 | +This action will automatically trigger the workflow, and your content will be deployed to the [Layer5 Academy](https://cloud.layer5.io/identity/overview). |
| 269 | + |
| 270 | +- Your content will be available in the [staging environment](https://staging-cloud.layer5.io/) within approximately 10 minutes. |
| 271 | +- Your content will go fully live to the production Academy platform during the next scheduled cloud release. |
| 272 | + |
| 273 | +> **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. |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | +## Frequently Asked Questions |
| 278 | + |
| 279 | +<details> |
| 280 | + <summary>1. Why is my workflow failing with a <code>401 Unauthorized</code> or <code>User must be logged in</code> error?</summary> |
| 281 | + |
| 282 | +This error indicates an issue with your <code>ACADEMY_TOKEN</code>. Please ensure you have correctly copied only the token string and not the entire JSON object from the downloaded file. |
| 283 | +</details> |
| 284 | + |
| 285 | +<details> |
| 286 | + <summary>2. Why is my workflow failing with a URL containing a double slash </code>( // )</code>?</summary> |
| 287 | + |
| 288 | +A double slash in the URL (e.g., <code>.../api/academy//update/...</code>) means your <strong>ACADEMY_ORG_ID</strong> was not found. This typically happens when the secret name in your repository does not <strong>exactly match</strong> the name expected by the workflow file (e.g., <code>ORG_ID</code>). |
| 289 | +</details> |
| 290 | + |
| 291 | +<details> |
| 292 | + <summary>3. How do I handle updates or corrections after my content is live?</summary> |
| 293 | + |
| 294 | +All content updates are managed through your Git repository. Simply commit and push your changes, then <strong>create a new GitHub Release</strong> with a new version number (e.g., <code>v1.0.2</code>). This automatically triggers the publishing workflow and updates your content on the Academy platform. |
| 295 | +</details> |
| 296 | + |
| 297 | +<details> |
| 298 | + <summary>4. What happens if my new content has an error?</summary> |
| 299 | + |
| 300 | +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. |
| 301 | +</details> |
| 302 | + |
| 303 | +<details> |
| 304 | + <summary>5. How do I structure multiple courses under one learning path?</summary> |
| 305 | + |
| 306 | +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 <code>content</code> directory directly maps to the learning path structure presented to users. |
| 307 | +</details> |
| 308 | + |
| 309 | +<details> |
| 310 | + <summary>6. Why does my local build fail when adding large videos?</summary> |
| 311 | + |
| 312 | +The ideal size should be less than 10MB for our service performance and sustainability, and server resource management. If your asset size is larger than 10MB, we recommend using external hosting as listed. |
| 313 | +</details> |
| 314 | + |
| 315 | +<details> |
| 316 | + <summary>7. How to securely host private training videos?</summary> |
| 317 | + |
| 318 | +Use AWS S3 with signed URLs: |
| 319 | +```html |
| 320 | +<video src="{{</* s3_signed_url path="training/private.mp4" */>}}"> |
| 321 | +``` |
| 322 | +</details> |
| 323 | + |
| 324 | +<details> |
| 325 | + <summary>8. How do I debug using Layer5 Cloud Events?</summary> |
| 326 | + |
| 327 | +If your content is not appearing in the Academy after a GitHub release, it may have failed to publish. You can troubleshoot these issues using the **Events** section in [Layer5 Cloud](https://cloud.layer5.io). |
| 328 | + |
| 329 | +To view publishing logs: |
| 330 | +1. Navigate to **Settings > Events** |
| 331 | +2. Switch to the **Audit** tab |
| 332 | +3. Apply a filter using the action type: |
| 333 | + `AcademyUpserted` |
| 334 | +This will show all attempts to upload content, including which ones failed and why. |
| 335 | + |
| 336 | +**Common Errors You Might See** |
| 337 | +- **Duplicate IDs** |
| 338 | + Two lessons or paths using the same identifier. You can fix this by renaming or regenerating unique IDs. |
| 339 | + |
| 340 | +- **Invalid Content Type** |
| 341 | + For example, |
| 342 | + Instead of |
| 343 | + ```yaml |
| 344 | + type: "learning-paths" |
| 345 | + ``` |
| 346 | + it should be: |
| 347 | + ```yaml |
| 348 | + type: "learning-path" |
| 349 | + ``` |
| 350 | +- **Missing Required Fields** |
| 351 | + Ensure that title, description, and type are included in the content’s frontmatter. |
| 352 | + |
| 353 | + {{< alert type="info" title="Tip" >}} |
| 354 | + Use the event filter `AcademyRegisteredToContent` to track user activity, like who enrolled in which learning path. |
| 355 | + {{< /alert >}} |
| 356 | +</details> |
0 commit comments