Skip to content

Commit de4650c

Browse files
committed
add video hosting doc
Signed-off-by: Wyllie Fang <wylliefang@gmail.com>
1 parent cf0abf9 commit de4650c

File tree

1 file changed

+85
-8
lines changed
  • content/en/cloud/academy/creating-your-learning-path

1 file changed

+85
-8
lines changed

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

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,16 @@ Enhance your course with images and other visual aids. The recommended and stand
161161
For all assets, please use the Page Bundling method. It simplifies asset management by co-locating images with the Markdown files that use them.
162162
{{< /alert >}}
163163
164-
**How to Add an Image**
164+
### Size Limits for Embedded Media
165+
While there's no hard-coded size limit, we enforce these practical constraints:
166+
| Media Type | Recommended Max Size | Impact Beyond Limit |
167+
|------------|----------------------|-------------------------------|
168+
| Video | 50 MB | Slow builds, CI failures |
169+
| Image | 5 MB | Hugo memory overflow. |
170+
| PDF | 20 MB | Browser loading delays. |
171+
172+
173+
### How to Add an Image
165174

166175
1. Place your image file (e.g., `hugo-logo.png`) in the **same directory** as your Markdown file (e.g., `Chapter-1.md`).
167176

@@ -175,18 +184,71 @@ For all assets, please use the Page Bundling method. It simplifies asset managem
175184
The `usestatic` shortcode is **deprecated** and should not be used!
176185
{{< /alert >}}
177186

178-
**How to Add a Video**
187+
### How to Add a Video
188+
```mermaid
189+
graph LR
190+
A[Add Video] --> B{Size >50MB?}
191+
B -->|Yes| C[External Platform]
192+
B -->|No| D[Page Bundling]
193+
C --> E[Embed with URL]
194+
D --> F[Local Reference]
195+
```
196+
197+
#### Best Practices for Video Storage
198+
**Recommended Approach (Page Bundling):**
199+
```markdown
200+
// Directory structure
201+
content/
202+
└── learning-paths/
203+
└── org-uuid/
204+
└── course-name/
205+
├── chapter.md
206+
└── video-demo.mp4 // Same directory as Markdown
207+
208+
// In chapter.md
209+
<video controls width="100%">
210+
<source src="video-demo.mp4" type="video/mp4">
211+
</video>
212+
```
179213

180-
```text
181-
{{</* card
182-
title="Video: Example" */>}}
183-
<video width="100%" height="100%" controls>
184-
<source src="https://exmaple.mp4" type="video/mp4">
185-
Your browser does not support the video tag.
214+
**External Hosting (Large Files)**
215+
```markdown
216+
{{</* card title="Video Tutorial" */>}}
217+
<video controls preload="metadata">
218+
<source src="https://cdn.yourcompany.com/video.mp4" type="video/mp4">
219+
Your browser doesn't support HTML5 video.
186220
</video>
187221
{{</* /card */>}}
188222
```
189223

224+
#### External Hosting Recommendations
225+
For optimal performance, we recommend hosting large videos on dedicated platforms:
226+
- **YouTube** (Free, public/private options)
227+
- **AWS S3** (Requires bucket & CORS configuration)
228+
- **Cloudflare Stream** (Paid, enterprise-grade)
229+
- **Vimeo** (Paid, professional features)
230+
231+
#### Migration Guide
232+
```mermaid
233+
flowchart LR
234+
A[Identify Videos] --> B{Current Location}
235+
B -->|static/ folder| C[Move to Page Bundle]
236+
B -->|External URL| D[Verify accessibility]
237+
C --> E[Update references]
238+
D --> E
239+
E --> F[Test locally]
240+
F --> G[Publish via Release]
241+
```
242+
243+
#### Critical Considerations
244+
- Accessibility: Always include subtitle tracks (VTT format)
245+
246+
- Thumbnails: Set custom posters with ```poster="image.jpg"```
247+
248+
- Bandwidth: Self-hosted videos may incur significant costs
249+
250+
- Authentication: For private videos, use signed URLs (S3) or unlisted (YouTube)
251+
190252
## 4. Build and Preview Locally
191253

192254
Before publishing, it is crucial to preview your content locally to check for formatting errors, broken links, and overall structure.
@@ -334,4 +396,19 @@ make clean
334396

335397
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.
336398

399+
6. **Why does my local build fail when adding large videos?**
400+
401+
Hugo's default memory limit is 512MB. For videos >50MB:
402+
```bash
403+
hugo server --memlimit 2GB
404+
```
405+
406+
7. **How to securely host private training videos?**
407+
408+
Use AWS S3 with signed URLs:
409+
```html
410+
<video src="{{</* s3_signed_url path="training/private.mp4" */>}}">
411+
```
412+
413+
337414
[^1]: The auto-generated learning path ID feature will be launched soon.

0 commit comments

Comments
 (0)