Spritz for Jekyll
This is a plugin for Jekyll that attempts to simplify the process of using Spritz on your Jekyll-powered sites.
- You need a client ID issued by Spritz. Register here to get one.
Install this gem:
gem install spritz_for_jekyll
Add this gem to the list of gems in
gems: [..., "spritz_for_jekyll"]
login_success.htmlto the list of included files in
_config.yml(this option is customizable - see Global Configuration):
include: [..., "login_success.html"]
Configuration at the global level can be done in your Jekyll configuration file, most likely it is
_config.yml. All options described below must be nested inside the
spritz key (refer to the example):
client_id(required): The client ID issued by Spritz:
url(optional in some cases, recommended): The base URL of your Jekyll site. It can be a URL itself, or the key that points to another option in the configuration file that contains the URL. (See the example below.)
auto_mode(optional, defaults to
true): This can field can be either
false. When it is set to true, necessary scripts and tags will be added to the beginning of each posts. If you wish to customize the location of Spritz (called Redicle), set this field to
falseand refer to the section below,
login_success_name(optional, defaults to
login_success.html): Spritz require a particular HTML file to work, and we have included it with this gem. By default, it is written to the root of your project using the name
login_success.html. However, if you have had a file with that name, just set this field to another desired name, say,
spritz_login_success.html. Also, include this name in the list of included files (see step 3 of Installation).
spritz_selector(optional, but highly recommended): A CSS selector that selects the HTML element containing the actual content. By default, Spritz will just load the entire page, including stuff like your site title, copyright statement, etc.
jquery(optional): Use this option to customize jQuery fallbacks to be used. Can be
false(disable fallback, not recommended), a String, or an Array.
redicle(optional): Use this option to customize your Redicle. The value of this option should be a hash containing some or all of these keys:
control_titles. Refer to the example to see the uses of each of these keys.
base_url: http://www.example.com spritz: client_id: "12345" url: base_url # or # url: http://www.example.com auto_mode: true login_success_name: "spritz_login_success.html" selector: "div#content" jquery: ["asset/js/jquery.js", "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"] redicle: width: 500 height: 200 default_speed: 300 speed_items: [200, 300, 400] control_buttons: ["back", "pauseplay", "rewind"] control_titles: back: "Go back" pause: "Stop (temporarily)" play: "Play" rewind: "Restart"
In posts that you don't want Spritz to be enabled, set
false in their front-matter:
Clearly, Spritz requires some scripts in order for it to work. More specifically, it needs jQuery and Spritz's script to work. By default, that is, when
true, these scripts and the Redicle are placed at the beginning of each post. If you wish to customize these behaviors, for example, you are using your own jQuery, you can set
false and manually place those scripts and Redicle at desired positions.
spritz_scripts: Returns the necessary HTML tags to import required files. If you are already using jQuery, this tag should appear after the
scripttag that imports jQuery.
spritz_redicle: Place the Spritz Redicle.