Maverick 增加音乐 / 看板娘功能

音乐

使用 MetingJS 公开的 CDN 引入方式。

conf.pyhead_addon里添加:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

继续在nav里添加一条指向音乐的导航项:

{
        "name": "音乐",
        "url": "${site_prefix}music/",
        "target": "_self"
}

新建一个music.md文档:

---
layout: page
title: 音乐
slug: music
date: 2020-02-21 08:33:46
status: publish
author: 原谅糖
comment: false
---

<meting-js server="netease" type="playlist" id="147958769" list-max-height="329px">

看板娘

使用 Pio-Typecho 项目中的modelsstatic文件夹。

models整个文件夹和static中的三个静态文件放到 Maverick 中的src/static中。

conf.pyhead_addosn里添加:

<link href='${static_prefix}pio.css' rel='stylesheet' type='text/css'/>

继续在body_addon中添加:

body_addon = r'''
<div class="pio-container left">
    <div class="pio-action"></div>
    <canvas id="pio" width="280" height="250"></canvas>
</div>
<script src='${static_prefix}l2d.js'></script>
<script src='${static_prefix}pio.js'></script>
<script>
    var pio = new Paul_Pio({
    	"mode": "static",
    	"hidden": true,
    	"content": {
    		"welcome": "欢迎来到原谅糖的博客!",
    		"referer": "欢迎来自 %t 的朋友!"
    	},
    	"model": ["${static_prefix}models/umaru/model.json"],
    	tips: true
    });
</script>
'''