Skip to content

Commit cb342fa

Browse files
authored
Merge pull request #724 from Vincamine/w--video-hosting
[Docs] Add Guidelines for External Media and Video Hosting
2 parents 7bb9af4 + 0493a85 commit cb342fa

File tree

1 file changed

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

1 file changed

+58
-8
lines changed

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

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,16 @@ Enhance your course with images and other visual aids. The recommended and stand
170170
For all assets, please use the Page Bundling method. It simplifies asset management by co-locating images with the Markdown files that use them.
171171
{{< /alert >}}
172172
173-
**How to Add an Image**
173+
### Size Limits for Embedded Media
174+
While there's no hard-coded size limit, we enforce these practical constraints:
175+
| Media Type | Recommended Max Size | Impact Beyond Limit |
176+
|------------|----------------------|------------------------------|
177+
| Video | 50 MB | Slow builds, CI failures |
178+
| Image | 5 MB | Hugo memory overflow |
179+
| PDF | 20 MB | Browser loading delays |
180+
181+
182+
### How to Add an Image
174183

175184
1. Place your image file (e.g., `hugo-logo.png`) in the **same directory** as your Markdown file (e.g., `01-pods.md`).
176185

@@ -184,18 +193,44 @@ For all assets, please use the Page Bundling method. It simplifies asset managem
184193
The `usestatic` shortcode is **deprecated** and should not be used!
185194
{{< /alert >}}
186195

187-
**How to Add a Video**
196+
### How to Add a Video
197+
198+
**Page Bundling (Recommended)**
199+
```markdown
200+
<video controls width="100%">
201+
<source src="video-demo.mp4" type="video/mp4">
202+
</video>
203+
```
188204

189-
```text
190-
{{</* card
191-
title="Video: Example" */>}}
192-
<video width="100%" height="100%" controls>
193-
<source src="https://exmaple.mp4" type="video/mp4">
194-
Your browser does not support the video tag.
205+
**External Hosting (Large Files)**
206+
```markdown
207+
{{</* card title="Video Tutorial" */>}}
208+
<video controls preload="metadata">
209+
<source src="https://cdn.yourcompany.com/video.mp4" type="video/mp4">
210+
Your browser doesn't support HTML5 video.
195211
</video>
196212
{{</* /card */>}}
197213
```
198214

215+
#### External Hosting Recommendations
216+
For optimal performance, we recommend hosting large videos on dedicated platforms:
217+
- **YouTube** (Free, public/private options)
218+
- **AWS S3** (Requires bucket & CORS configuration)
219+
- **Cloudflare Stream** (Paid, enterprise-grade)
220+
- **Vimeo** (Paid, professional features)
221+
222+
223+
#### Critical Considerations
224+
- Best practice: Page Bundling
225+
226+
- Accessibility: Always include subtitle tracks (VTT format)
227+
228+
- Thumbnails: Set custom posters with ```poster="image.jpg"```
229+
230+
- Bandwidth: Self-hosted videos may incur significant costs
231+
232+
- Authentication: For private videos, use signed URLs (S3) or unlisted (YouTube)
233+
199234
## 4. Build and Preview Locally
200235

201236
Before publishing, it is crucial to preview your content locally to check for formatting errors, broken links, and overall structure.
@@ -343,4 +378,19 @@ make clean
343378

344379
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.
345380

381+
6. **Why does my local build fail when adding large videos?**
382+
383+
Hugo's default memory limit is 512MB. For videos >50MB:
384+
```bash
385+
hugo server --memlimit 2GB
386+
```
387+
388+
7. **How to securely host private training videos?**
389+
390+
Use AWS S3 with signed URLs:
391+
```html
392+
<video src="{{</* s3_signed_url path="training/private.mp4" */>}}">
393+
```
394+
395+
346396
[^1]: The auto-generated learning path ID feature will be launched soon.

0 commit comments

Comments
 (0)