变听歌边看本文吧(=´ω`=)

今天给网站加入了全局吸底部音乐播放器并实现了单独在页面中插入的简单音乐播放器参考b站视频Butterfly 文檔(六) 進階教程 | Butterflyhexo-tag-aplayer | Easy Hexo 👨‍💻Hexo 折腾:音乐播放 | Tianma,其中不知道是我的问题还是啥,在没有进行Butterfly 文檔(六) 進階教程 | Butterfly中的全局吸底音乐播放器的配置前,我明明已经安装了hexo-tag-aplayer,并对博客根目录下的_config.yml文件进行了如下配置:

#音乐播放器
aplayer:
# 插件會在每一個文件都插入 js 和 css,為了避免這一情況,3.0 版本內置了 aplayer 需要的 css 和 js。首先在 Hexo 根目錄 _config 裏配置 asset_inject 為 false
asset_inject: false
# 设置MetingJS支持,以便调用若干主流播放器(网易云、QQ音乐等)的歌曲、歌单、专辑资源等(MetingJS 是基于Meting API 的 APlayer 衍生播放器)
meting: true
cdn: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js # 引用 APlayer.js 外部 CDN 地址 (默认不开启)
style_cdn: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css
meting_cdn: https://cdn.jsdelivr.net/npm/meting/dist/Meting.min.js # 引用 Meting.js 外部 CDN 地址 (默认不开启)

并在我博客的music页面的Front-matter页面启用了aplayer: true

---
title: 天气很棒,来点音乐吧?✧٩(ˊωˋ*)و✧
date: 2025-01-26 00:00:09
aplayer: true
---
**有点音乐只有30秒是因为调用的网易云的API,该歌曲在网易云里为VIP歌曲**
{% meting "524868012" "netease" "song" %} 23213213213213

可还是无法在本地成功渲染出该有的音乐播放器,于是多次尝试无果后决定先进行全局吸底播放器的配置:

# https://github.com/MoOx/pjax
pjax:
enable: true
# Exclude the specified pages from pjax, such as '/music/'
exclude:
# - /xxxxxx/

# Inject the css and script (aplayer/meting)
aplayerInject:
enable: true
per_page: true
# Inject
# Insert the code to head (before '</head>' tag) and the bottom (before '</body>' tag)
inject:
head:
# - <link rel="stylesheet" href="/xxx.css">
bottom:
- <div class="aplayer no-destroy" data-id="13216346882" data-server="netease" data-type="playlist" data-fixed="true" data-mini="true" data-autoplay="true"> </div>

进行了以上配置后成功在本地实现了吸底播放器,而且惊喜的发现之前怎么也渲染不出来的特定页面播放器也能渲染出来了,所以还是开全局吧,不想要吸底播放器单独将- <div class="aplayer no-destroy" data-id="13216346882" data-server="netease" data-type="playlist" data-fixed="true" data-mini="true" data-autoplay="true"> </div>注释掉即可。