Skip to content

Commit 6dc0ec4

Browse files
authored
Merge pull request #703 from zihanKuang/remove-usestatic
Update How to Add an Image
2 parents b015215 + 6129b95 commit 6dc0ec4

File tree

1 file changed

+11
-16
lines changed
  • content/en/cloud/academy/creating-your-learning-path

1 file changed

+11
-16
lines changed

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,33 +149,32 @@ You can find and copy your Organization UUID from your organization page on [Lay
149149

150150

151151
{{< alert type="warning" title="Banner Image Paths" >}}
152-
When using the `banner` field in your frontmatter, you cannot use the `usestatic` shortcode. You must provide the full, static path to the image, starting with your Organization UUID.
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`.
153153
{{< /alert >}}
154154

155155
> 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/).
156156

157157
## 3. Add Assets and Interactive Content
158158

159-
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.
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.
160160

161-
{{< alert type="warning" title="Do Not Use Standard Markdown Image Links" >}}
162-
Do not use standard Markdown image links. Always use the `usestatic` shortcode for images to ensure compatibility with the platform.
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.
163163
{{< /alert >}}
164164

165165
**How to Add an Image**
166166

167-
1. Place your image file (e.g., `hugo-logo.png`) in your scoped static directory:
167+
1. Place your image file (e.g., `hugo-logo.png`) in the **same directory** as your Markdown file (e.g., `Chapter-1.md`).
168168

169-
```text
170-
static/<your-organization-uid>/images/hugo-logo.png
171-
```
172-
2. In your `Chapter-1.md` file, embed the image using the `usestatic` shortcode. The `path` is relative to your scoped static folder:
169+
2. In your `Chapter-1.md` file, embed the image using a **standard Markdown link**. The path should just be the filename.
173170

174-
```text
175-
![The Hugo Logo]({{</* usestatic path="images/hugo-logo.png" */>}})
171+
```markdown
172+
![The Hugo Logo](hugo-logo.png)
176173
```
177174

178-
Then the system will automatically convert this into the correct URL when building the site.
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 >}}
179178

180179
**How to Add a Video**
181180

@@ -189,10 +188,6 @@ title="Video: Example" */>}}
189188
{{</* /card */>}}
190189
```
191190

192-
{{< alert type="info" title="Best Practice" >}}
193-
If your images are only needed for a specific chapter or section (not globally), it is recommended to place them next to the relevant content folder. This keeps your project organized and makes asset management easier.
194-
{{< /alert >}}
195-
196191
## 4. Build and Preview Locally
197192

198193
Before publishing, it is crucial to preview your content locally to check for formatting errors, broken links, and overall structure.

0 commit comments

Comments
 (0)