DualWield / hexo-tag-aplayer

Embed aplayer in Hexo posts/pages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hexo-tag-aplayer

Embed APlayer(https://github.com/DIYgod/APlayer) in Hexo posts/pages.

plugin screenshot

Installation

npm install --save hexo-tag-aplayer

Usage

{% aplayer title author url [picture_url, narrow, autoplay, width:xxx, lrc:xxx] %}

Arguments

  • title : music title
  • author: music author
  • url: music file url
  • picture_url: optional, music picture url
  • narrow: optional, narrow style
  • autoplay: optional, autoplay music, not supported by mobile browsers
  • width:xxx: optional, prefix width:, player's width (default: 100%)
  • lrc:xxx: optional, prefix lrc:, LRC file url

With post asset folders enabled, you can easily place your image, music and LRC file into asset folder, and reference them like:

{% aplayer "Caffeine" "Jeff Williams" "caffeine.mp3" "picture.jpg" "lrc:caffeine.txt" %}

With lyrics

Besides 'lrc' option, you can use aplayerlrc which has end tag to show lyrics.

{% aplayerlrc "title" "author" "url" "autoplay" %}
[00:00.00]lrc here
{% endaplayerlrc %}

Upstream Issue

Hexo has an issue that cannot use space within tag arguments.

If you encounter this problem, install the latest (beta) version, and wrap the arguments within a string literal, for example:

{% aplayer "Caffeine" "Jeff Williams" "caffeine.mp3" "autoplay" "width:70%" "lrc:caffeine.txt" %}

Customization

You can modify variables scriptDir(default: "/assets/js/" ) in index.js according to your blog's directory structure.

LICENSE

MIT

About

Embed aplayer in Hexo posts/pages

License:MIT License


Languages

Language:JavaScript 100.0%