Skip to content

Commit 2c5effc

Browse files
Merge pull request #119 from layer5io/examples
Shortcode examples
2 parents b6d22f1 + ebb449a commit 2c5effc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1825
-700
lines changed

.github/build/Makefile.core.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ GIT_STRIPPED_VERSION=$(shell git describe --tags `git rev-list --tags --max-coun
2323
REMOTE_PROVIDER="Layer5"
2424

2525
LOCAL_PROVIDER="None"
26-
GOVERSION = 1.23
26+
GOVERSION = 1.24.5
2727
GOPATH = $(shell go env GOPATH)
2828
GOBIN = $(GOPATH)/bin
29-
KEYS_PATH="../../server/permissions/keys.csv"
3029

3130
SHELL := /usr/bin/env bash -o pipefail
3231

@@ -36,7 +35,7 @@ SHELL := /usr/bin/env bash -o pipefail
3635
# All Adapters
3736
# ADAPTER_URLS := "localhost:10000 localhost:10001 localhost:10002 localhost:10004 localhost:10005 localhost:10006 localhost:10007 localhost:10009 localhost:10010 localhost:10012"
3837
# No Adapters
39-
ADAPTER_URLS := "localhost:10000 localhost:10001 localhost:10012 localhost:10013"
38+
# ADAPTER_URLS := "localhost:10000 localhost:10001 localhost:10012 localhost:10013"
4039

4140
#-----------------------------------------------------------------------------
4241
# Providers (Add your provider here. See https://docs.meshery.io/extensibility/providers)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ public/
2424
resources/
2525
node_modules/
2626
.hugo_build.lock
27+
.DS_Store

assets/icons/exoscale-demo.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading
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 >}}

0 commit comments

Comments
 (0)