hugo-theme-zzo/exampleSite/content/en/posts/shortcodes.md

136 lines
1.9 KiB
Markdown
Raw Normal View History

2020-01-24 22:07:56 +00:00
---
title: "Shortcodes"
date: 2020-01-25T06:40:51+09:00
description: tabs, code-tabs, expand, alert, warning, notice, img, box
2020-01-24 22:07:56 +00:00
draft: false
hideToc: false
enableToc: true
enableTocContent: true
2020-01-24 22:07:56 +00:00
tocPosition: inner
tags:
- shortcode
series:
-
categories:
-
image: images/feature3/code-file.png
2020-01-24 22:07:56 +00:00
---
## Markdownify box
{{< boxmd >}}
This is **boxmd** shortcode
{{< /boxmd >}}
## Simple box
2020-01-24 22:07:56 +00:00
{{< box >}}
This is **box** shortcode
2020-01-24 22:07:56 +00:00
{{< /box >}}
## Code tabs
Make it easy to switch between different code
2020-01-24 22:07:56 +00:00
{{< codes java javascript >}}
{{< code >}}
2020-01-24 22:07:56 +00:00
```java
System.out.println('Hello World!');
```
2020-01-24 22:07:56 +00:00
{{< /code >}}
2020-01-24 22:07:56 +00:00
{{< code >}}
2020-01-24 22:07:56 +00:00
```javascript
console.log('Hello World!');
```
2020-01-24 22:07:56 +00:00
{{< /code >}}
{{< /codes >}}
## Tabs for general purpose
2020-01-24 22:07:56 +00:00
{{< tabs Windows MacOS Ubuntu >}}
{{< tab >}}
### Windows section
```javascript
console.log('Hello World!');
```
Becareful that the content in the tab should be different from each other. The tab makes unique id hashes depending on the tab contents. So, If you just copy-paste the tabs with multiple times, since it has the same contents, the tab will not work.
2020-01-24 22:07:56 +00:00
{{< /tab >}}
{{< tab >}}
### MacOS section
Hello world!
{{< /tab >}}
{{< tab >}}
### Ubuntu section
Great!
{{< /tab >}}
{{< /tabs >}}
## Expand
{{< expand "Expand me" >}}
### Title
contents
{{< /expand >}}
{{< expand "Expand me2" >}}
### Title2
contents2
{{< /expand >}}
## Alert
Colored box
2020-01-24 22:07:56 +00:00
{{< alert theme="warning" >}}
**this** is a text
{{< /alert >}}
{{< alert theme="info" >}}
**this** is a text
{{< /alert >}}
{{< alert theme="success" >}}
**this** is a text
{{< /alert >}}
{{< alert theme="danger" >}}
**this** is a text
{{< /alert >}}
## Notice
{{< notice success >}}
success text
{{< /notice >}}
{{< notice info >}}
info text
{{< /notice >}}
{{< notice warning >}}
warning text
{{< /notice >}}
{{< notice error >}}
error text
{{< /notice >}}