Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

hugo-fixit/shortcode-mmt-netease

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

19 Commits

Repository files navigation

shortcode-mmt-netease

preview

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

Demo

https://lruihao.cn/guestbook/

安装

Tip

本组件适用于所有 Hugo 主题,但你必须有一个主体主题来使用它,以下以 FixIt 主题为例。

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

安装为 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
  • current [可选](第六个位置参数)是否播放当前评论的音乐,默认:false

这是一个用法示例:

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

Dependencies

About

🎶 A Hugo theme component with a NetEase Cloud random comment shortcode.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /