Skip to content

Commit c9434d9

Browse files
committed
docs: add internal shortcode formatting examples
Signed-off-by: YASHMAHAKAL <yvsst01@gmail.com>
1 parent 694d002 commit c9434d9

85 files changed

Lines changed: 1942 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Content Formatting Examples
3+
weight: 5
4+
description: A collection of examples for formatting content, from basic Markdown text to advanced custom components and shortcodes.
5+
draft: true
6+
---
7+
8+
The Layer5 Academy platform supports a wide range of shortcodes for enriching your learning content. Shortcodes are reusable template snippets you invoke in Markdown files to generate HTML output. They come from four sources:
9+
10+
1. **Academy Theme** — custom shortcodes built specifically for the Academy platform.
11+
2. **Hextra** — shortcodes ported from the [Hextra](https://imfing.github.io/hextra/docs/guide/shortcodes/) Hugo theme, namespaced under `hextra/` to avoid conflicts.
12+
3. **Docsy Theme** — shortcodes inherited from the [Google Docsy](https://www.docsy.dev/) documentation theme.
13+
4. **Hugo Built-in** — shortcodes included with the [Hugo](https://gohugo.io/) static site generator.
14+
15+
For guidance on creating your own shortcodes, see [Extending the Academy](/cloud/academy/creating-content/extending-the-academy/).
16+
17+
{{< alert type="note" title="Example Page: Not for Production" >}}
18+
This page will not be published in the [production version](https://cloud.layer5.io/academy/) of the site. It is only visible for local preview and serves as a reference. You can safely delete this page from your repository at any time.
19+
{{< /alert >}}
20+
21+
## Browse by category
22+
23+
Each example lives in its own page so you can inspect and reuse it independently. Use the sidebar or the links below to navigate.
24+
25+
### [Markdown](./markdown/)
26+
27+
Standard Markdown formatting: text styles, code blocks, lists, tables, images, and footnotes.
28+
29+
### [Hugo Built-in Shortcodes](./hugo-builtins/)
30+
31+
Shortcodes included with Hugo: `figure`, `highlight`, `ref`, `relref`, `param`, `qr`, `details`, and embedded media (`youtube`, `vimeo`, `instagram`, `x`).
32+
33+
### [Docsy Shortcodes](./docsy/)
34+
35+
Shortcodes from the Google Docsy theme: alerts, page info, blocks (cover, lead, section, feature), cards, tabs, comments, conditional text, iframe, imgproc, readfile, and API docs (Redoc, SwaggerUI).
36+
37+
### [Hextra Shortcodes](./hextra/)
38+
39+
Shortcodes ported from the Hextra theme: callouts, cards, details, steps, tabs, file tree, badges, icons, PDF embed, page include, glossary terms, Jupyter notebooks, and asciinema recordings.
40+
41+
### [Academy Theme Shortcodes](./academy-theme/)
42+
43+
Custom shortcodes for the Academy platform: alerts, details, pageinfo, chapterstyle, image, SVG, local video, version labels, CSV tables, Meshery design embeds, and usestatic path resolution.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Academy Theme Shortcodes
3+
linkTitle: Academy Theme
4+
description: Custom shortcodes built specifically for the Layer5 Academy platform.
5+
weight: 5
6+
draft: true
7+
---
8+
9+
These shortcodes are built specifically for the [Layer5 Academy](https://github.com/layer5io/academy-theme) platform.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Alert
3+
linkTitle: Alert
4+
weight: 1
5+
description: Academy theme alert shortcode with multiple type variants.
6+
draft: true
7+
---
8+
9+
The academy-theme `alert` shortcode renders a styled alert box. The `type` parameter controls the color and icon.
10+
11+
```text
12+
{{</* alert type="note" title="Note" */>}}Alert content with **Markdown** support.{{</* /alert */>}}
13+
```
14+
15+
**Parameters:**
16+
17+
| Parameter | Description | Default |
18+
|-----------|-------------|---------|
19+
| `type` | Alert style: `note`, `info`, `danger`, `warning` | _(none)_ |
20+
| `title` | Optional title above the alert body | _(none)_ |
21+
22+
**Examples:**
23+
24+
{{< alert title="Note" >}}A plain alert with a title.{{< /alert >}}
25+
26+
{{< alert type="note" title="Note" >}}This alert supports a title and **Markdown**.{{< /alert >}}
27+
28+
{{< alert type="info" title="Info" >}}This is an informational alert.{{< /alert >}}
29+
30+
{{< alert type="danger" title="Danger" >}}This is a danger alert.{{< /alert >}}
31+
32+
{{< alert type="warning" title="Warning" >}}This is a warning alert.{{< /alert >}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Chapterstyle
3+
linkTitle: Chapterstyle
4+
weight: 5
5+
description: Academy theme chapterstyle shortcode for custom section styling.
6+
draft: true
7+
---
8+
9+
The `chapterstyle` shortcode wraps content in a `<div>` with custom inline styles, useful for visually distinguishing chapter or section blocks.
10+
11+
```text
12+
{{%/* chapterstyle style="padding: 1rem; border: 1px solid #d0d7de; border-radius: 0.75rem; background: #f8fafc;" */%}}
13+
Your styled content here.
14+
{{%/* /chapterstyle */%}}
15+
```
16+
17+
**Parameters:**
18+
19+
| Parameter | Description | Default |
20+
|-----------|-------------|---------|
21+
| `style` | CSS style string applied to the wrapper `<div>` | _(none)_ |
22+
23+
**Example:**
24+
25+
{{% chapterstyle style="padding: 1rem; border: 1px solid #d0d7de; border-radius: 0.75rem; background: #f8fafc;" %}}
26+
This content is wrapped by the `chapterstyle` shortcode. The border, padding, and background color are applied via the `style` parameter. This shortcode is useful for visually grouping related content into a styled container.
27+
{{% /chapterstyle %}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: CSV Table Roles
3+
linkTitle: CSV Table Roles
4+
weight: 10
5+
description: Academy theme csvtable-roles shortcode for role-specific permissions tables.
6+
draft: true
7+
---
8+
9+
The `csvtable-roles` shortcode reads `static/data/csv/keys-backup.csv` and renders per-role permission tables showing which functions each role has access to.
10+
11+
```text
12+
{{</* csvtable-roles */>}}
13+
```
14+
15+
The CSV file must be located at `static/data/csv/keys-backup.csv` with the same format used by `csvtable`.
16+
17+
**Example:**
18+
19+
{{< csvtable-roles >}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: CSV Table
3+
linkTitle: CSV Table
4+
weight: 9
5+
description: Academy theme csvtable shortcode for rendering permissions tables from CSV data.
6+
draft: true
7+
---
8+
9+
The `csvtable` shortcode reads `static/data/csv/keys-backup.csv` and renders a permissions table grouped by category. Each role column shows a check or cross indicator.
10+
11+
```text
12+
{{</* csvtable */>}}
13+
```
14+
15+
The CSV file must be located at `static/data/csv/keys-backup.csv` and contain columns for Category, Function, Feature, and various role names.
16+
17+
**Example:**
18+
19+
{{< csvtable >}}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Embedded Design
3+
linkTitle: Embedded Design
4+
5+
description: Example of the meshery-design-embed component shortcode.
6+
draft: true
7+
---
8+
9+
The `meshery-design-embed` shortcode renders an interactive Meshery design diagram.
10+
11+
```text
12+
{{</* meshery-design-embed
13+
id="embedded-design-c811e9f4-2522-4eb6-b775-7475545356d8"
14+
src="./embedded-design-deploy-meshery-using-meshery.js"
15+
*/>}}
16+
```
17+
18+
The rendered output is shown below:
19+
20+
{{< meshery-design-embed
21+
id="embedded-design-c811e9f4-2522-4eb6-b775-7475545356d8"
22+
src="../embedded-design-deploy-meshery-using-meshery.js"
23+
>}}
24+
25+
> [Learn more](https://docs.layer5.io/kanvas/designer/embedding-designs/) about embedded designs.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Image
3+
linkTitle: Image
4+
weight: 6
5+
description: Render the academy-theme image shortcode.
6+
draft: true
7+
---
8+
9+
```text
10+
{{</* image src="/examples/images/exoscale-icon.png" alt="Alt text" title="Title" width="140px" radius="12%" */>}}
11+
```
12+
13+
**Example:**
14+
15+
{{< image src="/examples/images/exoscale-icon.png" alt="Exoscale icon displayed with the academy-theme image shortcode" title="Theme image shortcode" width="140px" radius="12%" >}}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Lab Intro
3+
linkTitle: Lab Intro
4+
weight: 11
5+
description: Academy theme lab-intro shortcode for storing lab introduction content.
6+
draft: true
7+
---
8+
9+
The `lab-intro` shortcode captures its inner content and stores it on the page scratch pad under the key `lab_intro`. This allows layout templates to retrieve and display lab introduction text in a dedicated section of the page.
10+
11+
```text
12+
{{%/* lab-intro */%}}
13+
Welcome to this hands-on lab. In this exercise, you will learn how to deploy a cloud native application using Kubernetes. By the end of this lab, you will be able to create a cluster, deploy workloads, and expose services.
14+
{{%/* /lab-intro */%}}
15+
```
16+
17+
**Example:**
18+
19+
{{% lab-intro %}}
20+
Welcome to this hands-on lab. In this exercise, you will learn how to deploy a cloud native application using Kubernetes. By the end of this lab, you will be able to create a cluster, deploy workloads, and expose services.
21+
{{% /lab-intro %}}
22+
23+
The content above is stored in the page's scratch pad. Layout templates can access it via `.Page.Scratch.Get "lab_intro"` to render it in a dedicated area.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Local Video
3+
linkTitle: Local Video
4+
5+
description: Render the academy-theme local-video shortcode.
6+
draft: true
7+
---
8+
9+
The `local-video` shortcode embeds an HTML5 `<video>` player for a locally hosted video file.
10+
11+
```text
12+
{{</* local-video src="/path/to/video.mp4" muted="true" autoplay="true" loop="true" */>}}
13+
```
14+
15+
**Parameters:**
16+
17+
| Parameter | Description | Default |
18+
|-----------|-------------|---------|
19+
| `src` | Path to the video file | _(required)_ |
20+
| `muted` | Mute the video | `false` |
21+
| `autoplay` | Auto-play the video | `false` |
22+
| `loop` | Loop playback | `false` |
23+
24+
{{< alert type="info" title="Sample video not included" >}}
25+
This shortcode requires a locally hosted `.mp4` video file. Add your video to `static/examples/` and update the `src` path.
26+
{{< /alert >}}

0 commit comments

Comments
 (0)