Hugo的shortcodes记录

记录自己可能常用的shortcodes的使用指令

WithdewHua 171 words 1 minute to read

TOC


本文最后更新于2019-01-05,若有失效或者错误内容请留言,尽可能及时更新。


Hugo 内置

主题内置

fancybox

Fancybox is a jQuery lightbox script for displaying images, videos and more. It is touch enabled, responsive and fully customizable.

  • Named

< fancybox path="path" file="file" caption="caption" gallery="gallery" >

  • Positional

< fancybox "path" "file" "caption" "gallery" >

img-post

Add an image which can be aligned center, left, or right.

  • Named

< img-post path="date" file="filename.jpg" alt="Alt Text" type="left" >

  • Positional

< img-post "title" "filename.jpg" "Alt Text" "left" >

img-fit

Insert multiple images with the ability to create a gallery if needed.

< img-fit
    "4u" "filename1.jpg" "Alt text 1"
    "4u" "filename2.jpg" "Alt text 2"
    "4u$" "filename3.jpg" "Alt text 3"
    "date" >

注意:由于build的时候会直接将shortcodes结果产生,所以主题内置内容均省略了必需的符号,使用符号见Hugo 内置的示例。