|
1 | 1 |
|
| 2 | +# Layer5 Academy - Content Starter Template |
| 3 | + |
| 4 | +This repository is a starter template for creating custom learning paths and courses on the [Layer5 Academy](https://cloud.layer5.io/academy/overview). It provides the necessary file structure and a working example to help you get started quickly. |
| 5 | + |
| 6 | +This guide will walk you through setting up your own content repository, creating courses, and previewing them locally. |
| 7 | + |
| 8 | +> For more in-depth documentation, see the official [Layer5 Academy docs](https://docs.layer5.io/cloud/academy/). |
| 9 | +
|
| 10 | +## Prerequisites |
| 11 | + |
| 12 | +Before you begin, ensure you have the following installed on your system: |
| 13 | + |
| 14 | + * [**Hugo**](https://gohugo.io/getting-started/installing/) (extended version) (version 0.147.9) |
| 15 | + * [**Go**](https://go.dev/doc/install) (version 1.12) |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +Follow these steps to create your own learning path using this template. |
| 20 | + |
| 21 | +### 1. Fork & Clone the Repository |
| 22 | + |
| 23 | +First, create a copy of this repository under your own GitHub account. |
| 24 | + |
| 25 | + - **Fork** this [academy-example](https://github.com/layer5io/academy-example) repository. |
| 26 | + - Clone your forked repository: |
| 27 | + ```bash |
| 28 | + # Replace <your-username> with your GitHub username |
| 29 | + git clone https://github.com/<your-username>/academy-example.git |
| 30 | + cd academy-example |
| 31 | + ``` |
| 32 | + |
| 33 | +### 2. Update the Go Module Path |
| 34 | + |
| 35 | + - Open the `go.mod` file at the root of the project. |
| 36 | + - Change the first line from: |
| 37 | + ```go |
| 38 | + module github.com/layer5io/academy-example |
| 39 | + ``` |
| 40 | + - To match your repository's path: |
| 41 | + ```go |
| 42 | + module github.com/<your-username>/academy-example |
| 43 | + ``` |
| 44 | + - Save the file, then commit and push the change. |
| 45 | +
|
| 46 | +### 3. Configure Your Organization Directories |
| 47 | +
|
| 48 | +The Academy platform uses an **Organization UID** to keep content separate and secure. You must get this ID from the Layer5 CLoud before proceeding. |
| 49 | +
|
| 50 | +Once you have your UID, rename the placeholder directories: |
| 51 | +
|
| 52 | + - Rename `content/learning-paths/your-org-uid` to `content/learning-paths/<your-organization-uid>` |
| 53 | + - Rename `static/your-org-uuid` to `static/<your-organization-uid>` |
| 54 | + - Rename `layouts/shortcodes/your-org-uuid` to `layouts/shortcodes/<your-organization-uid>` |
| 55 | +
|
| 56 | +### 4. Add Your Content |
| 57 | +
|
| 58 | +Now you're ready to create your learning path. The structure is: **Learning Path → Course → Chapter → Lesson**. |
| 59 | + |
| 60 | +A high-level view of the structure looks like this: |
| 61 | + ```text |
| 62 | + content/ |
| 63 | + └── learning-paths/ |
| 64 | + ├── _index.md |
| 65 | + └── <your-organization-uid>/ |
| 66 | + └── <your-learning-path>/ |
| 67 | + ├── _index.md |
| 68 | + └── <your-course-1>/ |
| 69 | + └── <your-course-2>/ |
| 70 | + ├── _index.md |
| 71 | + └── content/ |
| 72 | + └── your-lesson-1.md |
| 73 | + └── your-lesson-2.md |
| 74 | + ``` |
| 75 | + |
| 76 | + - **Delete the example content** inside `content/learning-paths/<your-organization-uid>/`. |
| 77 | + - **Create your folder structure** following the example's hierarchy. |
| 78 | + - **Add your lessons** as Markdown (`.md`) files inside the `content` directory of a course. |
| 79 | + - **Use frontmatter** at the top of your `_index.md` and lesson files to define titles, descriptions, and weights. |
| 80 | +
|
| 81 | +### 5. Add Assets (Images & Videos) |
| 82 | +
|
| 83 | +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. |
| 84 | +
|
| 85 | +**How to Add an Image** |
| 86 | +
|
| 87 | +1. Place your image file (e.g., `hugo-logo.png`) in your scoped static directory: |
| 88 | +
|
| 89 | + ```text |
| 90 | + static/<your-organization-uid>/images/hugo-logo.png |
| 91 | + ``` |
| 92 | +2. In your `lesson-1.md` file, embed the image using the `usestatic` shortcode. The `path` is relative to your scoped static folder: |
| 93 | +
|
| 94 | + ```text |
| 95 | +  |
| 96 | + ``` |
| 97 | +
|
| 98 | +Then the system will automatically convert this into the correct URL when building the site. |
| 99 | +
|
| 100 | +**How to Add a Video** |
| 101 | +
|
| 102 | +```text |
| 103 | +{{</* card |
| 104 | +title="Video: Example" */>}} |
| 105 | +<video width="100%" height="100%" controls> |
| 106 | + <source src="https://exmaple.mp4" type="video/mp4"> |
| 107 | + Your browser does not support the video tag. |
| 108 | +</video> |
| 109 | +{{</* /card */>}} |
| 110 | +``` |
| 111 | +
|
| 112 | +### 6. Local Development |
| 113 | +
|
| 114 | +To preview your content locally, run the Hugo server from the project root: |
| 115 | +
|
| 116 | +```bash |
| 117 | +hugo server |
| 118 | +``` |
| 119 | +
|
| 120 | +This will start a local server. You can view your content and check for formatting issues before publishing. |
| 121 | +
|
| 122 | +> The local preview uses basic styling. Full Academy branding and styles will be applied after your content is integrated into the cloud platform. |
| 123 | +
|
| 124 | +### 7. Going Live |
| 125 | +
|
| 126 | +Once your content is complete and tested locally: |
| 127 | +
|
| 128 | +1. Push all your changes to your forked repository on GitHub. |
| 129 | +2. **[Connect](https://layer5.io/company/contact) the Layer5 Team** via Slack, email, or by opening a GitHub issue. |
| 130 | +3. Provide the URL to your content repository. |
| 131 | +
|
| 132 | +A Layer5 administrator will then integrate your repository into the main Academy platform. After integration, your learning paths will be visible on the official [Layer5 Cloud site](https://cloud.layer5.io/academy/overview). |
0 commit comments