Coder Social home page Coder Social logo

odinshat / hexo-deezer-playlist-helper Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 168 KB

Display a playlist from Deezer in your Hexo template with this helper tag

Home Page: http://www.strawdogs.co/2015/12/Hexo-Deezer-Playlist-Helper/

License: MIT License

JavaScript 100.00%
hexo music plugin static-site-generator npm

hexo-deezer-playlist-helper's Introduction

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

hexo-deezer-playlist-helper's People

Contributors

odinshat avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.