hexo中插入音乐


title: " hexo中插入音乐"
date: 2017-02-14 01:24:49
tags:
hexo

前言

从用QQ空间开始就喜欢插入背景音乐,如今自己管理自己的博客,当然也要插入音乐,不用开绿钻哈哈哈哈。

关于主题

我用的是yilia

添加音乐

添加的网易云音乐,很方便。
打开网易云音乐某首歌详情页,点击生成外链播放器,选择iframe插件。选择好尺寸。复制html代码。如:

<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=298 height=52 src="//music.163.com/outchain/player?type=2&id=4940455&auto=1&height=32"></iframe>

这里手动修改width为"100%",再添上class。然后把下面这段代码复制到
themes\yilia\layout\_partial\left-col.ejs里,代码:

<nav class="header-music">
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=298 height=52 src="//music.163.com/outchain/player?type=2&id=4940455&auto=1&height=32"></iframe>
</nav>

如图:

![开启网易云](http://github-10029416.cos.myqcloud.com/%E5%BC%80%E5%90%AF%E7%BD%91%E6%98%93%E4%BA%91.png
)。

这样就可以生成播放器了,但是还需要调一下css样式。
在themes\yilia\source\main.2d7529.css(如果名字不同,也应为main.xx.css)末尾添加

.header-music {margin-top: 80px; }

接着hexo clean,hexo g,hexo s 搞定。
效果如下:
网易云效果

之后会试着利用cplayer把列表插入到主题中。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值