portails/content/docs/cheat-sheets/shortcodes/index.md

8.2 KiB

title description summary date lastmod draft images menu weight toc
Shortcodes A quick reference to the Doks shortcodes. A quick reference to the Doks shortcodes. 2023-05-12T16:36:04+02:00 2023-05-12T16:36:04+02:00 false
docs
parent identifier
shortcodes-b20379ce4f24fa487bf2dd1a8367a4f1
230 true

A quick reference to the Doks shortcodes. {.lead}

{{< callout icon="info-circle" >}} Refer to components for more information. {{< /callout >}}

SVG

Insert an SVG from the assets directory, page resources, or Tabler Icons.

{{< callout icon="info-circle" >}} The SVG gets embedded into the pages' HTML. {{< /callout >}}

Assets directory

Add e.g. a logo from the assets directory:

{{</* inline-svg src="svgs/logos/logo-netlify-small-fullcolor-lightmode.svg" width="192px" height="79px" class="svg-inline-custom svg-lightmode" */>}}

{{</* inline-svg src="svgs/logos/logo-netlify-small-fullcolor-darkmode.svg" width="192px" height="79px" class="svg-inline-custom svg-darkmode" */>}}

{{< inline-svg src="svgs/logos/logo-netlify-small-fullcolor-lightmode.svg" width="192px" height="79px" class="svg-inline-custom svg-lightmode" >}}

{{< inline-svg src="svgs/logos/logo-netlify-small-fullcolor-darkmode.svg" width="192px" height="79px" class="svg-inline-custom svg-darkmode" >}}

Page resource

{{< callout src="info-circle" >}} Refer to page resources and page bundles for more information. {{< /callout >}}

Add e.g a monogram:

{{</* inline-svg src="logo-netlify-monogram-monochrome-lightmode.svg" width="64px" height="57px" class="svg-inline-custom svg-monochrome" */>}}

{{< inline-svg src="logo-netlify-monogram-monochrome-lightmode.svg" width="64px" height="57px" class="svg-inline-custom svg-monochrome" >}}

Tabler icons

{{< callout src="copy" >}} Copy the icon name from Tabler Icons by clicking on it's name. {{< /callout >}}

Add a Tabler icon:

{{</* inline-svg "coffee" */>}}

{{< inline-svg "coffee" >}}

Specify SVG attributes, for example:

{{</* inline-svg src="hand-rock" stroke-width="1" stroke="#ee52b7" height="3rem" width="3rem" class="svg-inline-custom" */>}}

{{< inline-svg src="hand-rock" stroke-width="1" stroke="#ee52b7" height="3rem" width="3rem" class="svg-inline-custom" >}}

Callouts

{{</* callout */>}} This is a default callout. Example text to show it in action. {{</* /callout */>}}
{{</* callout info */>}} This is an info callout. Example text to show it in action. {{</* /callout */>}}
{{</* callout warning */>}} This is a warning callout. Example text to show it in action. {{</* /callout */>}}
{{</* callout danger */>}} This is a danger callout. Example text to show it in action. {{</* /callout */>}}

{{< callout >}} This is a default callout. Example text to show it in action. {{< /callout >}}

{{< callout info >}} This is an info callout. Example text to show it in action. {{< /callout >}}

{{< callout warning >}} This is a warning callout. Example text to show it in action. {{< /callout >}}

{{< callout danger >}} This is a danger callout. Example text to show it in action. {{< /callout >}}

Tabler icons

{{< callout icon="copy" >}} Copy the icon name from Tabler Icons by clicking on it's name. {{< /callout >}}

{{</* callout context="info" icon="info-circle" */>}} This is an **info** callout. Example text to show it in action. {{</* /callout */>}}

{{< callout context="info" icon="info-circle" >}} This is an info callout. Example text to show it in action.{{< /callout >}}

{{</* callout context="info" icon="info-circle" */>}}
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within a callout works with this kind of content.
{{</* /callout */>}}

{{< callout context="info" icon="info-circle" >}} Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within a callout works with this kind of content. {{< /callout >}}

Title

{{</* callout context="info" title="Callout title" */>}} This is an info callout. Example text to show it in action. {{</* /callout */>}}

{{< callout context="info" title="Callout title" >}} This is an info callout. Example text to show it in action. {{< /callout >}}

{{</* callout context="info" title="Callout title" icon="info-circle" */>}} This is an info callout. Example text to show it in action. {{</* /callout */>}}

{{< callout context="info" title="Callout title" icon="info-circle" >}} This is an info callout. Example text to show it in action. {{< /callout >}}

Inline code

{{< callout context="light" icon="info-circle" >}} You can change the commands in the scripts section of ./package.json. {{< /callout >}}

{{< callout context="warning" icon="info-circle" >}} You can change the commands in the scripts section of ./package.json. {{< /callout >}}

{{< callout context="danger" icon="info-circle" >}} You can change the commands in the scripts section of ./package.json. {{< /callout >}}

{{< callout context="info" icon="info-circle" >}} You can change the commands in the scripts section of ./package.json. {{< /callout >}}

Details

{{</* details "Details" */>}}
Something small enough to escape casual notice.
{{</* /details */>}}

{{< details "Details" >}} Something small enough to escape casual notice. {{< /details >}}

Start in open state

{{</* details "Start in open state" open */>}}
This Boolean attribute indicates whether the details — that is, the contents of the <details> element — are currently visible. The details are shown when this attribute exists, or hidden when this attribute is absent. By default this attribute is absent which means the details are not visible.
{{</* /details */>}}

{{< details "Start in open state" open >}} This Boolean attribute indicates whether the details — that is, the contents of the <details> element — are currently visible. The details are shown when this attribute exists, or hidden when this attribute is absent. By default this attribute is absent which means the details are not visible. {{< /details >}}

Tabs

{{</* tabs "create-new-site" */>}}
{{</* tab "npm" */>}}

```bash
npm create hyas@latest
```

{{</* /tab */>}}
{{</* tab "pnpm" */>}}

```bash
pnpm create hyas@latest
```

{{</* /tab */>}}
{{</* tab "Yarn" */>}}

```bash
yarn create hyas
```

{{</* /tab */>}}
{{</* /tabs */>}}

{{< callout icon="info-circle" >}} The selected tab is remembered in and across pages. {{< /callout >}}

Run the following command in your terminal to start our handy install wizard, create-hyas.

{{< tabs "create-new-site" >}} {{< tab "npm" >}}

npm create hyas@latest

{{< /tab >}} {{< tab "pnpm" >}}

pnpm create hyas@latest

{{< /tab >}} {{< tab "Yarn" >}}

yarn create hyas

{{< /tab >}} {{< /tabs >}}

cd into your new project directory to begin using Hyas. Install your dependencies before continuing.

{{< tabs "install-dependencies" >}} {{< tab "npm" >}}

npm install

{{< /tab >}} {{< tab "pnpm" >}}

pnpm install

{{< /tab >}} {{< tab "Yarn" >}}

yarn install

{{< /tab >}} {{< /tabs >}}

Image

Assets directory

Add an image from the assets directory:

{{</* picture src="assets/images/bozhin-karaivanov-3HnVKfQZGTQ-unsplash.jpg" alt="Red raspberry" */>}}

{{< picture src="assets/images/bozhin-karaivanov-3HnVKfQZGTQ-unsplash.jpg" alt="Red raspberry" >}}

Page resource

{{</* picture src="bozhin-karaivanov-zs6GW81O538-unsplash.jpg" alt="Red apples on a tree" */>}}

{{< picture src="bozhin-karaivanov-zs6GW81O538-unsplash.jpg" alt="Red apples on a tree" >}}

Video

{{</* video src="flower" autoplay="true" muted="true" */>}}

{{< video src="flower" autoplay="true" muted="true" >}}