Shortcodes
内容目录
Minimo comes with several 短代码s built-in.
短代码: center
Center align you content.
center: 参数
- Markdown content between opening and closing tags.
center: Usage Example
{{< center >}}
_Center Aligned Text_
{{< /center >}}
Output:
Shortcode: convo
Renders conversation blocks.
convo: Parameters
sep
[String
] (optional): seperator between person and text (default: “:
”)
convo: Inner Syntax
person :: text
You can remove the person
part, if you want.
convo: Usage Example
{{< convo sep=":" >}}
Jerry :: You don't look so tough.
Finch :: It's because I have only two modes, Jerry. Calm, and furious. It's a rare person that sees the latter and lives to talk about it.
{{< /convo >}}
Output:
-
Jerry:You don’t look so tough.
-
Finch:It’s because I have only two modes, Jerry. Calm, and furious. It’s a rare person that sees the latter and lives to talk about it.
Shortcode: file
Include content from seperate file with syntax highlighting.
file: Parameters
0 => filename [String
] (required)
1 => filetype [String
] (optional)
file: Usage Example
{{< file "content/_index.md" >}}
Output:
---
title: 主页面
linkTitle: 首页
menu:
- main
# - sidebar
weight: -970
---
> 用编程开启通向未来世界的大门.
> — 比尔盖茨
Shortcode: katex
Renders KaTeX.
katex: Parameters
0 => mode [String
] (optional): inline / block
katex: Usage Example
Inline: {{< katex inline >}} ax^2 + bx + c = 0 {{< /katex >}}
Block:
{{< katex >}}
x = {-b \pm \sqrt{b^2-4ac} \over 2a}
{{< /katex >}}
Output:
Inline: \( ax^2 + bx + c = 0 \)
Block: \[ x = {-b \pm \sqrt{b^2-4ac} \over 2a} \]
Shortcode: text
Text with custom size and color
text: Parameters
You can use either Named or Unnamed Parameters
Named Parameters:
s
orsize
[String
] (optional): multiplier relative to the normal sizec
orcolor
[String
] (optional): name / hex / rgb / rgba
Unnamed Parameters:
0 => textsize [String
] (required): multiplier relative to the normal size
1 => textcolor [String
] (optional): name / hex / rgb / rgba
text: Usage Example
{{< text s="1.4" color="purple" >}}
font-size: 1.4em;
color: purple;
{{< /text >}}
Output:
color: purple;
Shortcode: slideshare
ppt分享 SlideShare presentation/document into your page.
slideshare: Parameters
Named Parameters:
id
[String
] (required):id
of SlideShare you want to embed. You can find it in SlideShare URL or click “Share” -> Seeid
field in “WordPress Shortcode” section.
slideshare: Usage Example
{{< slideshare 237760779 >}}
Output: