|
| 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 | +Welcome! This page showcases examples of Hugo shortcodes, images, and Markdown. |
| 9 | + |
| 10 | +{{< alert type="note" title="Example Page: Not for Production" >}} |
| 11 | +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. |
| 12 | +{{< /alert >}} |
| 13 | + |
| 14 | +## Image styling |
| 15 | + |
| 16 | +By default, Markdown images are written like this: |
| 17 | + |
| 18 | +```markdown |
| 19 | + |
| 20 | +``` |
| 21 | + |
| 22 | +These are rendered with: |
| 23 | +* `max-width: 70%` of the viewport |
| 24 | +* `max-height: 80vh` of the viewport height |
| 25 | +* centered block layout |
| 26 | + |
| 27 | +This default styling works well for most landscape (horizontal) images. However, if an image is very tall, narrow, or otherwise looks awkward, you can override the default by embedding raw HTML and specifying a custom size: |
| 28 | + |
| 29 | +```html |
| 30 | +<img src="./images/example.png" alt="Example description" |
| 31 | +style="max-width: 40vw; max-height: 60vh; display: block; margin: 1rem auto;" /> |
| 32 | +``` |
| 33 | + |
| 34 | +## Using Hugo shortcodes |
| 35 | + |
| 36 | +Shortcodes let you define reusable snippets and embed them in content. |
| 37 | + |
| 38 | +Usage: |
| 39 | + |
| 40 | +```code |
| 41 | + { {% shortcode-name %}} |
| 42 | +``` |
| 43 | + |
| 44 | +The shortcode name is the file name (minus the `.html`) in `layouts/shortcodes/your-org-uuid`. |
| 45 | + |
| 46 | +## Markdown |
| 47 | + |
| 48 | +Text can be **bold**, _italic_, or ~~strikethrough~~. [Links](https://gohugo.io) have no underline (unless hovered). |
| 49 | + |
| 50 | +> Blockquotes are lighter with a left border. |
| 51 | +
|
| 52 | +### Code |
| 53 | + |
| 54 | +``` |
| 55 | +This is a code block. |
| 56 | +``` |
| 57 | + |
| 58 | +Inline code like `var foo = "bar";` is supported. |
| 59 | + |
| 60 | +### Lists |
| 61 | + |
| 62 | +Unordered: |
| 63 | + |
| 64 | +* Liverpool F.C. |
| 65 | +* Chelsea F.C. |
| 66 | +* Manchester United F.C. |
| 67 | + |
| 68 | +Ordered: |
| 69 | + |
| 70 | +1. Michael Brecker |
| 71 | +2. Seamus Blake |
| 72 | +3. Branford Marsalis |
| 73 | + |
| 74 | +Task list: |
| 75 | + |
| 76 | +* [x] Create a Hugo theme |
| 77 | +* [x] Add task lists to it |
| 78 | +* [ ] Take a vacation |
| 79 | + |
| 80 | +### Tables |
| 81 | + |
| 82 | +| Artist | Album | Year | |
| 83 | +|-------------------|-----------------|------| |
| 84 | +| Michael Jackson | Thriller | 1982 | |
| 85 | +| Prince | Purple Rain | 1984 | |
| 86 | +| Beastie Boys | License to Ill | 1986 | |
| 87 | + |
| 88 | +Inline code inside table cells: |
| 89 | + |
| 90 | +| Language | Code | |
| 91 | +|-------------|--------------------| |
| 92 | +| JavaScript | `var foo = "bar";` | |
| 93 | +| Ruby | `foo = "bar"` | |
| 94 | + |
| 95 | +---------------- |
| 96 | + |
| 97 | +Small images should be shown at their actual size. |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +Large images should always scale down and fit in the content container. |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +_The photo above of the Spruce Picea abies shoot with foliage buds: Bjørn Erik Pedersen, CC-BY-SA._ |
| 106 | + |
| 107 | +## Components |
| 108 | + |
| 109 | +### Embedded design |
| 110 | + |
| 111 | +``` |
| 112 | +{{</* meshery-design-embed |
| 113 | + id="embedded-design-c811e9f4-2522-4eb6-b775-7475545356d8" |
| 114 | + src="./embedded-design-deploy-meshery-using-meshery.js" |
| 115 | +*/>}} |
| 116 | +``` |
| 117 | + |
| 118 | +The rendered output is shown below: |
| 119 | + |
| 120 | +<!-- Learn more at https://docs.layer5.io/kanvas/designer/export-designs/#exporting-as-embedding --> |
| 121 | +{{< meshery-design-embed |
| 122 | + id="embedded-design-c811e9f4-2522-4eb6-b775-7475545356d8" |
| 123 | + src="./embedded-design-deploy-meshery-using-meshery.js" |
| 124 | +>}} |
| 125 | +
|
| 126 | +> [Learn more](https://docs.layer5.io/kanvas/designer/embedding-designs/) about embedded designs. |
| 127 | +
|
| 128 | +### Alerts |
| 129 | + |
| 130 | +{{< alert title="Note" >}}A plain alert with a title.{{< /alert >}} |
| 131 | +{{< alert type="note" title="Note" >}}This alert supports a title and **Markdown**.{{< /alert >}} |
| 132 | +{{< alert type="info" title="Info" >}}This is an informational alert.{{< /alert >}} |
| 133 | +{{< alert type="danger" title="Danger" >}}This is a danger alert.{{< /alert >}} |
| 134 | +{{< alert type="warning" title="Warning" >}}This is a warning alert.{{< /alert >}} |
| 135 | + |
| 136 | +### TabPanel |
| 137 | + |
| 138 | +{{< tabpane text=true >}} |
| 139 | + |
| 140 | +{{% tab header="Example 1" lang="en" active="true" %}} |
| 141 | + |
| 142 | +Tabs help organize related content. |
| 143 | + |
| 144 | +- Concise explanation |
| 145 | +- Another brief point |
| 146 | + |
| 147 | +{{< /tab >}} |
| 148 | + |
| 149 | +{{% tab header="Example 2" lang="en" %}} |
| 150 | + |
| 151 | +Tabs help organize related content. |
| 152 | + |
| 153 | +- Concise explanation |
| 154 | +- Another brief point |
| 155 | + |
| 156 | +{{< /tab >}} |
| 157 | + |
| 158 | +{{% tab header="Example 3" lang="en" %}} |
| 159 | + |
| 160 | +Here is an example image: |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | +{{< /tab >}} |
| 165 | + |
| 166 | +{{< /tabpane >}} |
| 167 | + |
| 168 | +### Collapsible |
| 169 | + |
| 170 | +{{< details summary="This is a collapsible title" >}} |
| 171 | + |
| 172 | +This is the collapsed content. |
| 173 | + |
| 174 | +It can be a list: |
| 175 | +- First item |
| 176 | +- Second item |
| 177 | +{{< /details >}} |
| 178 | + |
| 179 | +### Footnotes |
| 180 | + |
| 181 | +This is a superscript number for your footnote. [^1] |
| 182 | + |
| 183 | +[^1]: This is a footnote. |
0 commit comments