1.2.1 • Published 8 years ago

hexo-deezer-playlist-helper v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Hexo Dezer Playlist Helper

npm version Build Status Code Climate

Hexo helper for use in templates to display a Deezer playlist with a given playlist ID, width and height.

Installation

$ npm install hexo-deezer-playlist-helper --save

Usage

Helpers are for use in Hexo templates so to add a playlist on your sidebar or in posts or somewhere else in your template the very least would be something like this:

<%- deezerpl(1302841255); %>

// Or for custom width and height:

<%- deezerpl(1302841255, {width: 270, height: 300});

You could also have the playlist as a config variable and a widget setup like so:

Usage Example

On my own blog I have this as a weidgt in the default Light theme of Hexo. The widget has the following code:

<!-- This is in wigets/_deezerpl.ejs -->
<% if (config.deezer.playlist){ %>
<div class="widget deezerpl">
    <h3 class="title">Deezer Playlist</h3>
    <%- deezerpl(config.deezer.playlist, 270, 300) %>
</div>
<% } %>

Note that the above EJS (template) code has the following:

  1. It checks to see if deezer playlist is defined in the site _config.yml
  2. If it is then it will display that playlist.
  3. I not the widget will nt display at all.

You can see this in action on the left sidebar of my site here.

Screenshot

Screenshot of Deezer Playlist for Hexo

Uninstall

  1. Remove all usages of the helper from your template.

  2. Then run:

$ npm uninstall hexo-deezer-playlist-helper

License

MIT

1.2.1

8 years ago

1.2.0

8 years ago

1.0.0

9 years ago