我在这里

🏠 HOME 🗂️ DOCS 🔗 LINK 👴🏻 ABOUT

播放音频与视频,shortcode使用说明

2021-05-26 11:32

  • doc
  • video
  • music

Hugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.

Hugo默认支付播放YouTube,Vimeo等视频格式,所有支持的类型见: Hugo/templates/shortcodes

使用方式见官方文档: shortcode-templates

如添加一个YouTube视频:

YouTube Privacy Enhanced Shortcode

<!-- 实际写的时候 '['替换为 '{' ']'替换为'}' -->
[[< youtube hDy9BrB9_VU >]]

除了官方已有的shortcode模版,kagome目前有两个自定义的shortcode,分别是aplayer和dplayer,如下:

aplayer文档地址

dplayer文档地址

aPlayer Shortcode

如果需要使用aplayer需要在Front Matter中添加aplayer: true

<!-- 实际写的时候 '['替换为 '{' ']'替换为'}' -->
[[< aplayer
    url="https://qiniu.sukoshi.xyz/public/music/鹿乃 - アイロニ.mp3"
    name="アイロニ"
    artist="鹿乃"
    cover="https://qiniu.sukoshi.xyz/public/music/鹿乃 - アイロニ.jpg"
    lrc="https://qiniu.sukoshi.xyz/public/music/鹿乃 - アイロニ.lrc"
    lrcType="3"
>]]

dPlayer Shortcode

如果需要使用dplayer需要在Front Matter中添加dplayer: true

<!-- 实际写的时候 '['替换为 '{' ']'替换为'}' -->
[[< dplayer
    url="https://qiniu.sukoshi.xyz/video/%E7%BE%8E.mp4"
    pic="https://qiniu.sukoshi.xyz/video/%E7%BE%8E.mp4?vframe/jpg/offset/10"
>]]

config.toml配置

2021-06-09 11:32

插入公式,图片与Widget目录显示

2021-05-25 16:59

Sukoshi

Sukoshi

不觉得鹿角即可爱又有攻击性吗(

Related Posts

  • 如何丰富Banner信息
  • i18n多语言配置
  • Front Matter 相关参数说明
  • config.toml配置
  • 插入公式,图片与Widget目录显示

Categories

  • 笔记 20
  • 归档记录 9
  • 碎碎念 8
  • QAQ 7
  • doc 6
  • mv 3
show all

Tags

摄影 日常 js 浪 mongodb 日记 碎碎念 canvas cos css git github
show all

© 2022 Sukoshi.

蜀ICP备15014309号

Powered by Hugo Theme - kagome

🌞 light 🌛 dark 🤖️ auto