Jektify

Jektify is a Gem for entering track, playlist, albums and artists in Jekyll templates.

Download

Lasted version  1.0.3

Documentation

Table of contents

Resume

Why does Jektify exist?

Beautiful and Customizable, much more appealing than a simple “iframe”!

Jektify is a jewel using to enter a theme for track entry, playlist, albums and artists of Spotify, in Jekyll templates.

Besides inserting music is fully responsive, adjusting as your page layout, even on mobile devices.

You need to install, so let’s mission:

Dependencies

Dependency Status

You can see the dependencies of gem Jektify through Gemnasium. All dependencies are listed.

With Jektify running, it uses dependency on JQuery.

Get Jektify

Add Jektify to your Gemfile and run the command: bundle install:

1 group :jekyll_plugins do
2   gem "jektify"
3 end

or run command:

1 gem install jektify

Setting up

Setting up your stylesheet using Jekyll SASS

If you use CSS Jekyll, insert this line in the manifest main.scss SASS of your project:

1 @import "jektify";

Note: It is advisable to insert the end of all imports

I do not use SASS Jekyll, now what?

If you do not use the SASS Jekyll, the Jektify also solves this constraint, keep reading Configuration file “_config.yml” and find out how to configure without needing to use the Jekyll SASS manager.

Configuration file “_config.yml”

Now, you need to configure the file _config.yml your theme Jekyll.

The following lines should be inserted:

 1 plugins:
 2   - jektify
 3 
 4 jektify:
 5   enable: true
 6   open: true
 7   toggle:
 8     enable: true  
 9   spotify:
10     user: williamcanin
11     text: See me no Spotify
12   sass:
13     jekyll: true
14     other:
15       dir: "way/to/your/SASS"   
16   title:
17     enable: true
18     text: "Jektify"
19   description:
20     enable: true
21     text: |
22       Jekyll plugin to generate html snippets for embedding Spotify Musics.
23       To listen to the full song, open your Spotify and start these musics.

What does each option do?

[ Line 2 ] Report for Jekyll use Jektify.

[ Line 5 ] - Option: [ true / false ] Enables or disables the plugin for all site.

[ Line 6 ] - Option: [ true / false ] In this line you define whether you want the “Jektify” let the music box in open or closed mode in page. Remember that if the “toggle => enable” option is set to false, any value in this option will have no implication.

If a different value of these two themes is inserted, the Jekyll Spotify Plugin will have operation error.

[ Line 8 ] - Option [ true / false ] This feature enables you to enable or disable the Toggle function of the Jektify. If it is set to true a button in the upper right corner will exist for an action to scroll and unroll the window. If the value is equal to false, the button will not exist, only open window will be created, this causes the javascript of Jektify not to be generated for the user, because the scrolling and unwinding depends on the script.

[ Line 10 ] - Option [ user Spotify ] Put your Spotify user on this line to create a redirect button in the Spotify online player. If name or text are empty, the Jektify will not render this option. So, if you do not want to use it, leave the values with nothing.

[ Line 11 ] - Option [ text ] Here is the custom text that the redirect button will have. Put a very attractive and short.

[ Line 13 ] Option [ true / false ] This line is very important! In it you will define using the build SASS Jekyll or other compilation of SASS, as the Gulp. If you use the Jekyll, let true. If you do not use SASS of Jekyll leaves to false.

[ Line 15 ] Option [ path ] If the line 13 is false, you should inform the way the vendor folder of your SASS files. For example: If you store your SASS files in the src/sass/vendor, then that is the way you have to put in the variable dir.

After setting the path and build the project, a folder will be created to export the SASS of Jektify, in the path of the dir . With this, you must load the exported SASS in your manifest (main.scss). For example:

1 @import "{way/to/your/SASS/vendor}/jektify/jektify"

[ Line 17 and 20 ] - Option: [ true / false ] If you want a title or description, leave to true. Otherwise, leave as false.

[ Line 18 and 21 ] If the line 17 (or line 20) is in the true, enter your title (or description) in variable text. So if you want a title and content inside the music box…use true.

Importing JavaScript

ATTENTION! Using Javascript in the Jektify will only be necessary if the Toggle feature is set to true at line 8(eight) in “Configuration file _config.yml”. Before you begin, you must import the JQuery for your project.

After setting the _config.yml file and imported the SASS of Jektify, you must import the JavaScript Jektify for HTML. The Jektify copy the Javascript to the folder of the compiled site _site.

assets/vendor/jektify/js/jektify.min.js

Do import JavaScript in _layout/default.html at the end of </ body>, like this:

1 ...
2 { % if site.jektify.enable == true and site.jektify.toggle.enable == true % }
3 <script src="{ { "/assets/vendor/jektify/js/jektify.min.js" | prepend: site.baseurl } }" ></script>
4 { % endif % }
5 </body>

Note 1: Do not leave space between { { and } }, { % and % }

Note 2: Do not forget to load the script Jektify after JQuery.

Importing with CDN:

You can use CDN of the respective version:

1 ---
2 <script src="https://cdn.rawgit.com/jektify/jektify/master/cdn/v[VERSION]/jektify.min.js"></script>
3 </body>

You can see the CDNs of the other [VERSION] in:

Jektify - CDN Versions

Note: It is recommended to use the “static” version. In case of error, use the version according to Jektify. If you do not have the Jektify version on CDN, the “static” version is also used.

Using

How does Jektify work?

The Jektify capture songs, playlists and albums from artists in the Spotify, by URI code distributed by Spotify. You can do this by the Spotify application on your computer or through Spotify in the browser.

First you have to get the URL of the song, album, playlist, of artist you want. An easy way to know how to do this is in the Spotify of support documentation, here.

See an illustrative picture of how to capture the URI:

Capture URI

It will open a dialog, when open click URI to copy.

What you will get looks like this:

spotify:track:08mG3Y1vljYA6bvDt4Wqkj

The Jektify will use this URI, the only difference being that instead of being : will be /. See below how it works.

Tag Jektify

The Jektify it works with the following tags:

1 { % jektify [user]/[type]/[id]/[theme] % }

Note: There can be no spaces between the keys. This here for the Jektify does not come into work.

Note that there are three (4) parameters, all separated by slash. Let us know what each one does:

[user] Option [ spotify / your_user ]

By default it is spotify. Will only change if you use playlist in the second parameter (type), which will have to inform the user of the playlist.

[type] Option [ track / album / playlist / artist ]

  • This is the parameter with more options, it will inform you, that the ID Jektify will insert, if a track, album, playlist or artist.

[id] Option [ id ]

  • Here is the track ID, album, playlist, artist constituted by an extension number.

[theme] Option [ white / dark ]

  • Here you put a theme, Spotify makes available 2 (two) at the moment, the “dark” and the “light”.

Example:

1 { % jektify spotify/track/62qsgMnY4wg8nE5qjyOdWO/dark % }
2 
3 { % jektify williamcanin/playlist/48brJJZdVifY79QAFmEImq/light % }
4 
5 { % jektify spotify/artist/711MCceyCBcFnzjGY4Q7Un/dark % }
6 
7 { % jektify spotify/album/6OwvO40ahugJE5PH4TjqTg/light % }

Note: Do not leave spaces between the keys.

Customizable

SASS

Jektify already has a suitable customization for sensitive layouts, but still leaves a case of personalization itself, the user chooses the themes at hand and the way it fits into your page template.

To customize to your liking, use the class .jektify in your stylesheets (SASS). Use your browser’s developer tool. E.g: Google Dev Tools, to know which classes to change.

The class structure .jektify this is:

NOTE: You should put CSS properties inside the subclass “–custom”.

 1 .jektify{
 2   &--custom{ }
 3   &__header{
 4     &--custom{}
 5   }
 6   &__brand{
 7     &--custom{}
 8   }
 9   &__year{
10     &--custom{}
11   }
12   &__button{
13     &--custom{}
14   }
15   &__user{
16     &--custom{}
17     &-link{
18       &--custom{}
19     }
20     &-text{
21       &--custom{}
22     }
23   }
24   &__body{
25     &--custom{}
26   }
27   &__title{
28     &--custom{}
29   }
30   &__description{
31     &--custom{}
32   }
33   &__tracklist{
34     &--custom{}
35   }
36   &__track{
37     &--custom{}
38   }
39 }

Demos

Here is examples of how the “Jektify” will behave in your page:

Track

jektify © 2018  +

Playlist

jektify © 2018  +

Artist

jektify © 2018  +

Album

jektify © 2018  +

Report questions / Feedbacks

You can take questions in GitHub Issues,

License

The gem is available as open source under the terms of the MIT


Copyright (c) 2018 William Canin