|
| 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 our Hugo shortcodes and images and Markdown. |
| 9 | + |
| 10 | +{{< alert title="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 | +效果如下面: |
| 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 | +### Alerts |
| 127 | + |
| 128 | +{{< alert >}}This is an alert.{{< /alert >}} |
| 129 | +{{< alert title="Note" >}}This is an alert with a title.{{< /alert >}} |
| 130 | +{{< alert title="Note" >}}This is an alert with a title and **Markdown**.{{< /alert >}} |
| 131 | +{{< alert type="success" title="Successful Note">}}This is a successful alert.{{< /alert >}} |
| 132 | +{{< alert type="warning" >}}This is a warning.{{< /alert >}} |
| 133 | +{{< alert type="warning" title="Warning Title" >}}This is a warning with a title.{{< /alert >}} |
| 134 | + |
| 135 | +### TabPane |
| 136 | + |
| 137 | +{{< tabpane text=true >}} |
| 138 | + |
| 139 | +{{% tab header="Full-sized Logo Example" lang="en" active="true" %}} |
| 140 | + |
| 141 | +When users register through the [Open Organization Invitation Link](https://docs.layer5.io/cloud/identity/organizations/org-management/#using-the-open-organization-invitation-link), they will see the full-sized logo. |
| 142 | + |
| 143 | +{{< /tab >}} |
| 144 | + |
| 145 | +{{% tab header="Logo Mark Example" lang="en" %}} |
| 146 | + |
| 147 | +When logging into Layer5 Cloud on mobile devices, the small logo mark will be displayed. |
| 148 | + |
| 149 | +<img src="./images/example.png" alt="Logo Mark" style="width:50%; height:auto;" /> |
| 150 | + |
| 151 | +{{< /tab >}} |
| 152 | + |
| 153 | +{{< /tabpane >}} |
| 154 | + |
| 155 | +### Collapsible |
| 156 | + |
| 157 | +{{< details summary="This is a collapsible title" >}} |
| 158 | +This is the collapsed content. |
| 159 | + |
| 160 | +It can be a list: |
| 161 | +- First item |
| 162 | +- Second item |
| 163 | +{{< /details >}} |
| 164 | + |
| 165 | +### Footnotes |
| 166 | + |
| 167 | +This is a superscript number for your footnote. [^1] |
| 168 | + |
| 169 | +[^1]: This is a footnote. |
0 commit comments