Skip to content

🎶 一个含有网易云随机评论 shortcode 的 Hugo 主题组件。

Notifications You must be signed in to change notification settings

hugo-fixit/shortcode-mmt-netease

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shortcode-mmt-netease

preview

一个含有网易云随机评论 shortcode 的 Hugo 主题组件。

Demo

https://lruihao.cn/guestbook/

安装

安装方法与 安装主题 相同。有几种安装方法,请选择一种。

安装为 Hugo 模块

首先确保你的项目本身是一个 Hugo 模块

然后将此主题组件添加到你的 hugo.toml 配置文件中:

[module]
  [[module.imports]]
    path = "github.com/hugo-fixit/FixIt"
  [[module.imports]]
    path = "github.com/hugo-fixit/shortcode-mmt-netease"

在第一次启动 Hugo 时,它将下载所需的文件。

要更新到模块的最新版本,请运行:

hugo mod get -u
hugo mod tidy

安装为 Git 子模块

FixIt 和此 git 存储库克隆到你的主题文件夹中,并将其添加为网站目录的子模块。

git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
git submodule add https://github.com/hugo-fixit/shortcode-mmt-netease.git themes/shortcode-mmt-netease

接下来编辑项目的 hugo.toml 并将此主题组件添加到你的主题中:

theme = ["FixIt", "shortcode-mmt-netease"]

使用

mmt-netease shortcode 有以下命名参数:

  • mid [必需](第一个位置参数)网易云歌单 ID
  • autoplay [可选](第二个位置参数)是否自动播放,默认:false
  • fixed [可选](第三个位置参数)是否启用固定模式,默认:false
  • mini [可选](第四个位置参数)是否启用迷你模式,默认:false
  • volume [可选](第五个位置参数)默认音量,注意播放器会记住用户设置,用户自己设置音量后默认音量将不起作用,默认:0.7

这是一个用法示例:

{{< mmt-netease mid="2280569152" autoplay="false" >}}
<!-- OR -->
{{< mmt-netease "2280569152" false >}}

Warning

同一页面只支持使用一次!

Dependencies