|
| 1 | +--- |
| 2 | +title: Contributing to Video Gallery |
| 3 | +weight: 1 |
| 4 | +description: A detailed contribution guide for adding videos to Layer5 Docs video gallary |
| 5 | +--- |
| 6 | + |
| 7 | +{{< alert title="Note" >}}In Hugo, a section is a directory containing an `_index.md` file.{{< /alert >}} |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +Contributing videos involves either: |
| 12 | +1. Creating a category → subcategory → adding video markdown files, or |
| 13 | +2. Adding video markdown files directly under a category (these will automatically be assigned to an "ALL" subcategory) |
| 14 | + |
| 15 | +## 1. Creating a Category |
| 16 | + |
| 17 | +To create a top-level category: |
| 18 | + |
| 19 | +1. Create a directory under `content/en/videos` (e.g., `getting-started`) |
| 20 | +2. Add an `_index.md` file inside this directory with the following frontmatter: |
| 21 | + |
| 22 | +```yaml |
| 23 | +title: Getting Started # Category text appearing in the /videos category tab and left sidebar |
| 24 | +description: > |
| 25 | + Getting started videos on Cloud and Kanvas |
| 26 | +weight: 2 # Order in which this category appears in the /videos page and left sidebar |
| 27 | +icon: bi-rocket-takeoff-fill # Icon for the category (supports Bootstrap icons and local/remote assets) |
| 28 | +videoGrid: true # When true, shows all child / nested videos as a grid of cards on this section's index page |
| 29 | + # When false, presents a hyperlinked list of videos/sub-sections instead |
| 30 | + |
| 31 | +draft: true # When true, previews this section on local dev server but hides from left sidebar and /videos landing page on published site |
| 32 | +``` |
| 33 | +
|
| 34 | +## 2. Adding Videos to Your Category |
| 35 | +
|
| 36 | +There are two approaches for adding videos: |
| 37 | +
|
| 38 | +### Approach A: Create a Subcategory with Videos |
| 39 | +
|
| 40 | +1. Create a subdirectory under your category (e.g., `getting-started/onboarding`) |
| 41 | +2. Add an `_index.md` file with the following frontmatter: |
| 42 | + |
| 43 | +```yaml |
| 44 | +title: Onboarding # Subcategory text in the /videos subcategory tab and left sidebar |
| 45 | +videoGrid: true # Same functionality as in the category _index.md |
| 46 | +weight: 2 # Order in which this subcategory appears |
| 47 | +``` |
| 48 | + |
| 49 | +3. Create video markdown files (e.g., `video1.md`, `video2.md`) in this subdirectory with the following frontmatter: |
| 50 | + |
| 51 | +```yaml |
| 52 | +--- |
| 53 | +title: "Design Reviews: Adding Comments" # Required: title of the video card/list |
| 54 | +description: > # Required: description of the video |
| 55 | + Add comments to your designs in Kanvas's Designer Mode to enhance collaboration and streamline design reviews. |
| 56 | +videoId: "" # Required: YouTube video ID, example: bb6J--aApk8 |
| 57 | +videoType: youtube # Required: currently supports "youtube" (support for "local" is present, though currently disabled) |
| 58 | +
|
| 59 | +# Categories and tags help match videos with documentation pages by scoring relevance, |
| 60 | +# see the guide at bottom to know how |
| 61 | +categories: [Designer] |
| 62 | +tags: [review, collaboration, comments] # Available as hyperlinked tags in the video card and individual video page |
| 63 | +duration: 2:30 # Optional: duration in minutes:seconds format ("min" is automatically added) |
| 64 | +--- |
| 65 | +
|
| 66 | +# the following youtube shortcode is used for individual video page |
| 67 | +# Example: {{</* youtube id=bb6J--aApk8 class="yt-embed-container" */>}} |
| 68 | +# we can control the styling of resulting iframe and wrapping div by modify style of .yt-embed-container in assets/scss/_videos_project.scss |
| 69 | +{{</* youtube id="videoId" class="yt-embed-container" */>}} |
| 70 | +``` |
| 71 | + |
| 72 | +### Approach B: Add Videos Directly Under a Category |
| 73 | + |
| 74 | +Create video markdown files directly in the category directory with the same frontmatter format shown above. These videos will automatically be assigned to an "ALL" subcategory within the parent category. |
| 75 | + |
| 76 | +## Video and Documentation Page Matching |
| 77 | + |
| 78 | +To display `Related Videos` carousel on documentation pages section pages and individual pages, videos are matched with the docs pages based on shared tags and categories: |
| 79 | + |
| 80 | +- Each matching tag contributes 1 point to the relevance score |
| 81 | +- Each matching category contributes 2 points to the relevance score |
| 82 | +- Videos with at least one matching tag or category appear in the "Related Videos" carousel |
| 83 | +- Videos with higher scores appear first in the carousel |
| 84 | + |
| 85 | +### Example |
| 86 | + |
| 87 | +If a documentation page has: |
| 88 | +```yaml |
| 89 | +categories: [Designer] |
| 90 | +tags: [catalog, publishing] |
| 91 | +``` |
| 92 | + |
| 93 | +And there are two videos: |
| 94 | + |
| 95 | +**Video A**: |
| 96 | +```yaml |
| 97 | +categories: [Designer] |
| 98 | +tags: [catalog, review] |
| 99 | +``` |
| 100 | + |
| 101 | +**Video B**: |
| 102 | +```yaml |
| 103 | +categories: [Designer] |
| 104 | +tags: [designs] |
| 105 | +``` |
| 106 | + |
| 107 | +- **Video A** scores: 2 (category match) + 1 (tag 'catalog') = 3 |
| 108 | +- **Video B** scores: 2 (category match) + 0 = 2 |
| 109 | + |
| 110 | +Video A will appear before Video B in the carousel on the documentation page. |
| 111 | + |
| 112 | +## Example Directory Structure |
| 113 | + |
| 114 | +```yaml |
| 115 | +content/en/videos/ |
| 116 | +└── template-category/ # Top-level section (category) |
| 117 | + ├── _index.md # Defines the "Template Category" section |
| 118 | + └── sub-category/ # Sub-section inside the above category |
| 119 | + ├── _index.md # Defines the "Sub Category" sub-section |
| 120 | + └── video-1.md # file containing video specific data |
| 121 | +``` |
| 122 | + |
| 123 | +See `content/en/videos/template-category/` for an example of a category with subcategories and videos. It is set to draft and is not published and is intended as a reference for adding videos. |
0 commit comments