1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 04:40:09 +01:00

Merge pull request #215 from github/jekyll2

Upgrade to Jekyll2
This commit is contained in:
Ben Balter 2014-09-05 11:32:34 -04:00
commit 324de45da1
31 changed files with 192 additions and 315 deletions

View File

@ -2,104 +2,126 @@ GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.1.1)
activesupport (4.1.5)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
blankslate (2.1.2.4)
classifier (1.3.4)
fast-stemmer (>= 1.0.0)
celluloid (0.16.0)
timers (~> 4.0.0)
classifier-reborn (2.0.1)
fast-stemmer (~> 1.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.8.0)
colorator (0.1)
colored (1.2)
commander (4.1.6)
highline (~> 1.6.11)
ethon (0.7.0)
ethon (0.7.1)
ffi (>= 1.3.0)
execjs (2.2.1)
fast-stemmer (1.0.2)
ffi (1.9.3)
gemoji (1.5.0)
github-pages (18)
gemoji (2.1.0)
github-pages (24)
RedCloth (= 4.2.9)
jekyll (= 1.5.1)
jekyll-mentions (= 0.0.6)
jekyll-redirect-from (= 0.3.1)
jekyll-sitemap (= 0.2.0)
jemoji (= 0.1.0)
jekyll (= 2.3.0)
jekyll-coffeescript (= 1.0.0)
jekyll-mentions (= 0.1.3)
jekyll-redirect-from (= 0.6.0)
jekyll-sass-converter (= 1.2.0)
jekyll-sitemap (= 0.5.1)
jemoji (= 0.3.0)
kramdown (= 1.3.1)
liquid (= 2.5.5)
liquid (= 2.6.1)
maruku (= 0.7.0)
pygments.rb (= 0.6.0)
rdiscount (= 2.1.7)
redcarpet (= 2.3.0)
highline (1.6.21)
html-pipeline (1.5.0)
redcarpet (= 3.1.2)
hitimes (1.2.2)
html-pipeline (1.9.0)
activesupport (>= 2)
nokogiri (~> 1.4)
html-proofer (0.6.7)
html-proofer (1.3.3)
colored (~> 1.2)
mercenary (~> 0.3.2)
nokogiri (~> 1.6.0)
nokogiri (~> 1.5)
typhoeus (~> 0.6.7)
i18n (0.6.9)
jekyll (1.5.1)
classifier (~> 1.3)
yell (~> 2.0)
i18n (0.6.11)
jekyll (2.3.0)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
commander (~> 4.1.3)
liquid (~> 2.5.5)
listen (~> 1.3)
maruku (= 0.7.0)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.3.0)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-mentions (0.0.6)
html-pipeline (~> 1.5.0)
jekyll (~> 1.4)
jekyll-redirect-from (0.3.1)
jekyll (~> 1.4)
jekyll-sitemap (0.2.0)
jekyll (~> 1.4)
jemoji (0.1.0)
gemoji (~> 1.5.0)
html-pipeline (~> 1.5.0)
jekyll (~> 1.4)
jekyll-coffeescript (1.0.0)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-mentions (0.1.3)
html-pipeline (~> 1.9.0)
jekyll (~> 2.0)
jekyll-paginate (1.0.0)
jekyll-redirect-from (0.6.0)
jekyll (~> 2.0)
jekyll-sass-converter (1.2.0)
sass (~> 3.2)
jekyll-sitemap (0.5.1)
jekyll-watch (1.1.0)
listen (~> 2.7)
jemoji (0.3.0)
gemoji (~> 2.0)
html-pipeline (~> 1.9)
jekyll (~> 2.0)
json (1.8.1)
kramdown (1.3.1)
liquid (2.5.5)
listen (1.3.1)
liquid (2.6.1)
listen (2.7.9)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
maruku (0.7.0)
mercenary (0.3.3)
mini_portile (0.5.3)
minitest (5.3.3)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
mercenary (0.3.4)
mini_portile (0.6.0)
minitest (5.4.1)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.8)
pygments.rb (0.5.4)
posix-spawn (0.3.9)
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rake (10.3.1)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.4)
ffi (>= 0.5.0)
rb-kqueue (0.2.2)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdiscount (2.1.7)
redcarpet (2.3.0)
redcarpet (3.1.2)
safe_yaml (1.0.3)
thread_safe (0.3.3)
sass (3.4.3)
thread_safe (0.3.4)
timers (4.0.0)
hitimes
toml (0.1.1)
parslet (~> 1.5.0)
typhoeus (0.6.8)
ethon (>= 0.7.0)
tzinfo (1.1.0)
typhoeus (0.6.9)
ethon (>= 0.7.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
yajl-ruby (1.1.0)
yell (2.0.4)
PLATFORMS
ruby

View File

@ -4,67 +4,20 @@ relative_permalinks: false
markdown: kramdown
url: "http://choosealicense.com"
rules:
collections:
licenses:
output: true
permalink: /licenses/:path/
required:
- description: Include a copy of the license and copyright notice with the code.
label: License and copyright notice
tag: include-copyright
- description: Indicate significant changes made to the code.
label: State Changes
tag: document-changes
- description: Source code must be made available when distributing the software. In the case of LGPL, the source for the library (and not the entire program) must be made available.
label: Disclose Source
tag: disclose-source
- description: Users who interact with the software via network are given the right to receive a copy of the corresponding source code.
label: Network Use is Distribution
tag: network-use-disclose
- description: The library may be used within a non-open-source application.
label: Library usage
tag: library-usage
- description: You must change the name of the software if you modify it.
label: Rename
tag: rename
permitted:
- description: This software and derivatives may be used for commercial purposes.
label: Commercial Use
tag: commercial-use
- description: This software may be modified.
label: Modification
tag: modifications
- description: You may distribute this software.
label: Distribution
tag: distribution
- description: You may grant a sublicense to modify and distribute this software to third parties not included in the license.
label: Sublicensing
tag: sublicense
- description: You may use and modify the software without distributing it.
label: Private Use
tag: private-use
- description: This license provides an express grant of patent rights from the contributor to the recipient.
label: Patent Grant
tag: patent-grant
forbidden:
- description: While this may be implicitly true of all licenses, this license explicitly states that you may NOT use the names, logos, or trademarks of contributors.
label: Use Trademark
tag: trademark-use
- description: Software is provided without warranty and the software author/license owner cannot be held liable for damages.
label: Hold Liable
tag: no-liability
- description: You may not grant a sublicense to modify and distribute this software to third parties not included in the license.
label: Sublicensing
tag: no-sublicense
- description: This software may not be modified.
label: Modification
tag: modifications
- description: You may not distribute this software.
label: Distribution
tag: distribution
- description: You may not grant a sublicense to modify and distribute this software to third parties not included in the license.
label: Sublicensing
tag: sublicense
defaults:
-
scope:
path: ""
type: "licenses"
values:
layout: license
featured: false
"hide-from-license-list": false
exclude:
- app.coffee
@ -76,10 +29,12 @@ exclude:
- Rakefile
- README.md
- script
- bundle
- vendor/bundle
- test
- tests
- assets/vendor/selectivizr/tests
- assets/vendor/zeroclipboard/test
gems:
- jekyll-sitemap
- jekyll-redirect-from

59
_data/rules.yml Normal file
View File

@ -0,0 +1,59 @@
required:
- description: Include a copy of the license and copyright notice with the code.
label: License and copyright notice
tag: include-copyright
- description: Indicate significant changes made to the code.
label: State Changes
tag: document-changes
- description: Source code must be made available when distributing the software. In the case of LGPL, the source for the library (and not the entire program) must be made available.
label: Disclose Source
tag: disclose-source
- description: Users who interact with the software via network are given the right to receive a copy of the corresponding source code.
label: Network Use is Distribution
tag: network-use-disclose
- description: The library may be used within a non-open-source application.
label: Library usage
tag: library-usage
- description: You must change the name of the software if you modify it.
label: Rename
tag: rename
permitted:
- description: This software and derivatives may be used for commercial purposes.
label: Commercial Use
tag: commercial-use
- description: This software may be modified.
label: Modification
tag: modifications
- description: You may distribute this software.
label: Distribution
tag: distribution
- description: You may grant a sublicense to modify and distribute this software to third parties not included in the license.
label: Sublicensing
tag: sublicense
- description: You may use and modify the software without distributing it.
label: Private Use
tag: private-use
- description: This license provides an express grant of patent rights from the contributor to the recipient.
label: Patent Grant
tag: patent-grant
forbidden:
- description: While this may be implicitly true of all licenses, this license explicitly states that you may NOT use the names, logos, or trademarks of contributors.
label: Use Trademark
tag: trademark-use
- description: Software is provided without warranty and the software author/license owner cannot be held liable for damages.
label: Hold Liable
tag: no-liability
- description: You may not grant a sublicense to modify and distribute this software to third parties not included in the license.
label: Sublicensing
tag: no-sublicense
- description: This software may not be modified.
label: Modification
tag: modifications
- description: You may not distribute this software.
label: Distribution
tag: distribution
- description: You may not grant a sublicense to modify and distribute this software to third parties not included in the license.
label: Sublicensing
tag: sublicense

View File

@ -15,11 +15,14 @@
</div> <!-- /container -->
{% if page.layout == "license" or page.class == "license-types" %}
{% if page.collection == "licenses" or page.class == "license-types" %}
<script src="/assets/vendor/jquery/jquery.min.js"></script>
<script src="/assets/vendor/qtip2/jquery.qtip.min.js"></script>
<script src="/assets/vendor/zeroclipboard/ZeroClipboard.min.js"></script>
<script src="/assets/js/javascript.js"></script>
<script>
window.annotations = {{ site.data.rules | jsonify }};
</script>
<script src="/assets/js/app.js"></script>
{% endif %}
<script>

View File

@ -1,9 +0,0 @@
var annotations = {
{% for type_hash in site.rules %}
"{{ type_hash[0] }}": {
{% for rule_hash in type_hash[1] %}
"{{ rule_hash.tag }}" : "{{ rule_hash.description }}"{% if forloop.rindex0 > 0 %},{% endif %}
{% endfor %}
}{% if forloop.rindex0 > 0 %},{% endif %}
{% endfor %}
};

View File

@ -1,132 +0,0 @@
// Generated by CoffeeScript 1.7.1
(function() {
var Choosealicense;
Choosealicense = (function() {
Choosealicense.prototype.flashAvailable = function() {
if (typeof ActiveXObject !== "undefined" && ActiveXObject !== null) {
return !!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"));
} else {
return !!navigator.mimeTypes["application/x-shockwave-flash"];
}
};
Choosealicense.prototype.selectText = function(element) {
var range, selection;
if (document.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(element);
return range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
return selection.addRange(range);
}
};
Choosealicense.prototype.qtip_position = {
my: "top center",
at: "bottom center"
};
Choosealicense.prototype.categories = {
required: "Required",
permitted: "Permitted",
forbidden: "Forbidden"
};
function Choosealicense() {
this.initTooltips();
this.initClipboard();
this.initLicenseVariationNav();
}
Choosealicense.prototype.initTooltips = function() {
var category, label, rules, text, _ref;
for (category in annotations) {
rules = annotations[category];
for (label in rules) {
text = rules[label];
$(".license-rules ul.license-" + category + " li." + label).attr("title", text);
}
}
_ref = this.categories;
for (category in _ref) {
label = _ref[category];
$(".license-" + category + " li").qtip({
content: {
text: false,
title: {
text: label
}
},
position: this.qtip_position,
style: {
classes: "qtip-shadow qtip-" + category
}
});
}
return false;
};
Choosealicense.prototype.initZeroClipboard = function() {
var clip;
$(".js-clipboard-button").data("clipboard-prompt", $(".js-clipboard-button").text());
clip = new ZeroClipboard($(".js-clipboard-button"), {
moviePath: "/assets/vendor/zeroclipboard/ZeroClipboard.swf"
});
clip.on("mouseout", this.clipboardMouseout);
clip.on("complete", this.clipboardComplete);
return clip;
};
Choosealicense.prototype.initAlternativeClipboard = function() {
return $(".js-clipboard-button").click((function(_this) {
return function(e) {
var target;
target = "#" + $(e.target).data("clipboard-target");
return _this.selectText($(target)[0]);
};
})(this));
};
Choosealicense.prototype.initClipboard = function() {
if ((typeof ZeroClipboard !== "undefined" && ZeroClipboard !== null) && this.flashAvailable()) {
return this.initZeroClipboard();
} else {
return this.initAlternativeClipboard();
}
};
Choosealicense.prototype.clipboardMouseout = function(client, args) {
return this.innerText = $(this).data("clipboard-prompt");
};
Choosealicense.prototype.clipboardComplete = function(client, args) {
return this.innerText = "Copied!";
};
Choosealicense.prototype.initLicenseVariationNav = function() {
return $(".js-nav-pills a").click(function(e) {
var nav, selectedTab;
selectedTab = $(this).data("selected-tab");
nav = $(this).closest(".js-nav-pills");
nav.find("li").removeClass("active");
nav.closest(".js-license-variations").siblings(".js-variation-tab").removeClass("active");
$(this).parent("li").addClass("active");
$("." + selectedTab).addClass("active");
return e.preventDefault();
});
};
return Choosealicense;
})();
$(function() {
return new Choosealicense();
});
}).call(this);

View File

@ -1,26 +1,30 @@
<div class="license-family clearfix">
<div class="license-family-heading">
<h3 class="license-family-name"><a href="{{ page.permalink }}">{% if page.category %}{{ page.category }}{% else %}{{ page.title }}{% endif %}</a></h3>
<h3 class="license-family-name">
<a href="{{ license.permalink }}">
{% if license.category %}{{ license.category }}{% else %}{{ license.title }}{% endif %}
</a>
</h3>
<p class="license-family-description">{{ page.description }}</p>
<p class="license-family-description">{{ license.description }}</p>
</div>
<div class="license-details">
<div class="license-variations js-license-variations">
<!-- always show this div, even w/o variations, for proper spacing -->
{% if page.tab-slug %}
{% if license.tab-slug %}
<ul class="nav-pills js-nav-pills">
{% for variation in site.pages %}
{% if variation.category and variation.category == page.category %}
<li{% if page.tab-slug == variation.tab-slug %} class="active"{% endif %}><a href="#{{ variation.tab-slug }}" data-selected-tab="variation-{{ variation.tab-slug }}">{{ variation.title }}</a></li>
{% for variation in site.licenses %}
{% if variation.category and variation.category == license.category %}
<li{% if license.tab-slug == variation.tab-slug %} class="active"{% endif %}><a href="#{{ variation.tab-slug }}" data-selected-tab="variation-{{ variation.tab-slug }}">{{ variation.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% for variation in site.pages %}
{% if variation.category and variation.category == page.category %}
<div {% if variation.tab-slug %}id="{{ variation.tab-slug }}" {% endif %}class="variation-tab {% if variation.tab-slug %}variation-{{ variation.tab-slug }}{% endif %} js-variation-tab{% if page.tab-slug == variation.tab-slug %} active{% endif %}">
{% for variation in site.licenses %}
{% if variation.category and variation.category == license.category %}
<div {% if variation.tab-slug %}id="{{ variation.tab-slug }}" {% endif %}class="variation-tab {% if variation.tab-slug %}variation-{{ variation.tab-slug }}{% endif %} js-variation-tab{% if license.tab-slug == variation.tab-slug %} active{% endif %}">
<table class="license-rules">
<tr>
{% assign types = "required|permitted|forbidden" | split: "|" %}
@ -32,7 +36,7 @@
{% for type in types %}
<td>
<ul class="license-{{ type }}">
{% assign rules = site.rules[type] | sort: "label" %}
{% assign rules = site.data.rules[type] | sort: "label" %}
{% for rule_obj in rules %}
{% assign req = rule_obj.tag %}
{% if variation[type] contains req %}

View File

@ -27,7 +27,7 @@
{% for type in types %}
<h3>{{ type | capitalize }}</h3>
<ul class="license-{{ type }}">
{% assign rules = site.rules[type] | sort: "label" %}
{% assign rules = site.data.rules[type] | sort: "label" %}
{% for rule_obj in rules %}
{% assign req = rule_obj.tag %}
{% if page[type] contains req %}

View File

@ -1,3 +1,6 @@
---
---
class Choosealicense
# Checks if Flash is available in the client.
@ -42,9 +45,9 @@ class Choosealicense
initTooltips: ->
# Dynamically add annotations as title attribute to rule list items
for category, rules of annotations
for label, text of rules
$(".license-rules ul.license-#{category} li.#{label}").attr "title", text
for category, rules of window.annotations
for rule in rules
$(".license-rules ul.license-#{category} li.#{rule["tag"]}").attr "title", rule["description"]
# Init tooltips on all rule list items
for category, label of @categories

View File

@ -1,6 +0,0 @@
---
layout: nil
---
{% include js/annotations.js %}
{% include js/app.js %}

View File

@ -7,14 +7,9 @@ title: Licenses
<h2>Featured Licenses</h2>
{% assign sorted_pages = site.pages | sort: 'path' %}
{% for page in sorted_pages %}
{% if page.layout == "license" %}
{% if page.featured %}
{% include license-overview.html %}
{% endif %}
{% endif %}
{% assign featured_licenses = site.licenses | where:"featured",true %}
{% for license in featured_licenses | sort: 'path' %}
{% include license-overview.html %}
{% endfor %}
<h2>Other licenses</h2>
@ -22,11 +17,7 @@ title: Licenses
Some communities tend to have specific licenses preferred by the
community. For example, Perl developers often choose the Artistic License.
</p>
{% for page in sorted_pages %}
{% if page.layout == "license" %}
{% if page.featured != true and page.hide-from-license-list != true %}
{% include license-overview.html %}
{% endif %}
{% endif %}
{% assign licenses = site.licenses | where:"featured",false | where:"hide-from-license-list",false %}
{% for license in licenses %}
{% include license-overview.html %}
{% endfor %}

View File

@ -1,8 +1,4 @@
---
comment: \
because the for loop is being filtered by layout, the normal rindex0 check
for the trailing comma doesn't work. Count the number of licenses and manually
increment an index to see if we're on the true last iteration.
---
{% assign count = 0 %}{% for page in site.pages %}{% if page.layout == "license" %}{% assign count = count | plus: 1 %}{% endif %}{% endfor %}{% assign i = 0 %}
[{% for page in site.pages %}{% if page.layout == "license" %}{{ page | jsonify }}{% assign i = i | plus: 1 %}{% if i < count %},{% endif %}{% endif %}{% endfor %}]
{{ site.licenses | jsonify }}

View File

@ -6,8 +6,5 @@ echo "bundling installin'"
gem install bundler
bundle install
echo "npm installin'"
npm install coffee-script
echo
echo "You're all set. Just run script/server and you can play license roulette!"
echo "You're all set. Just run script/server and you can play license roulette!"

View File

@ -2,8 +2,5 @@
set -e
echo "compiling javascript..."
./node_modules/.bin/coffee -c _includes/js/app.coffee
echo "building the site..."
bundle exec rake test

View File

@ -2,11 +2,8 @@
set -e
echo "compiling javascript..."
./node_modules/.bin/coffee -c _includes/js/app.coffee
echo "spinning up the server..."
bundle exec jekyll serve -w
echo "cleaning up..."
rm -Rf _site
rm -Rf _site