Hexo 博客主题怎么设置 aplayer 的位置

2019-09-25 08:44:20 +08:00
 GavinCrown

Hexo:3.9.0 NexT:7.4.0 使用 hexo-tag-aplayer 来插入音乐: https://github.com/MoePlayer/hexo-tag-aplayer/blob/master/docs/README-zh_cn.md

如下是一段插入音乐的代码,在文章中可以正常显示,请问我怎么才能让它显示在主页的左下角呢?主题源码看不懂... {% meting "0040OHwn3s9Phn" "tencent" "song" "theme:#555" "mutex:true" "listmaxheight:340px" "preload:auto" %}

2455 次点击
所在节点    问与答
5 条回复
Track13
2019-09-25 09:05:11 +08:00
你把它最后生成的 html 代码放在你想要的效果那个文件哪里不就可以了
mrobot
2019-09-25 10:14:59 +08:00
写文章的 source 下新建_data 目录 然后在_data 目录新建 sidebar.swig 文件 如果是放在侧边栏位置代码直接写在这里就可以
mrobot
2019-09-25 10:17:15 +08:00
主题配置文件记得放开对应注释
GavinCrown
2019-09-25 10:38:15 +08:00
@mrobot 按照你说的做但出现如下报错,这是怎么回事?
INFO Start processing
ERROR Process failed: _data/sidebar.swig
Error: Unexpected tag "meting "0040OHwn3s9Phn" "tencent" "song" "theme:#555" "mutex:true" "listmaxheight:340px" "preload:auto"" on line 1 in file C:\Users\Autek\Desktop\test\blog\source\_data\sidebar.swig.
mrobot
2019-09-25 13:07:50 +08:00
你插入的代码应该是 markdown 转换后的 html+js,你在文章中可以播放是因为你贴的插件代码只是 hexo 的自定义标签而已只能在 markdown 中使用,你可以在浏览器直接 F12 打开开发者工具复制生成的 html 和 js 代码( id 为 aplayer-XCwnIKtd 的 html 代码块加上紧接着下面的 script 代码块)到 sidebar.swig 中就可以了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/603904

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX