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

Merge pull request #348 from github/tab-slug-bye

Remove need for tab-slug
This commit is contained in:
Mike Linksvayer 2016-02-13 18:15:34 -08:00
commit d5828d5318
18 changed files with 4 additions and 35 deletions

View File

@ -57,7 +57,6 @@ Licenses sit in the `/_licenses` folder. Each license has YAML front matter desc
* `nickname` - A shorter, human-readable license name where the SPDX license name (`title` above) is long
* `variant` - Whether the license is a variant of a family of licenses (defaults to false)
* `family` - If part of a license family, the name of the license family (e.g., `GPL`)
* `tab-slug` - If part of a license family, a license slug containing only `a-z`, `0-9`, and `_` characters, used for internal links on the licenses page
### Auto-populated fields

View File

@ -62,7 +62,3 @@
- name: family
description: If part of a license family, the name of the license family (e.g., `GPL`)
required: false
- name: tab-slug
description: If part of a license family, a license slug containing only `a-z`, `0-9`, and `_` characters, used for internal links on the licenses page
required: false

View File

@ -24,7 +24,7 @@
<ul class="nav-pills js-nav-pills">
{% assign variations = site.licenses | where:"hidden",false | where:"family",license.family %}
{% for variation in variations %}
<li{% if license.tab-slug == variation.tab-slug %} class="active"{% endif %}><a href="#{{ variation.tab-slug }}" data-selected-tab="variation-{{ variation.tab-slug }}">
<li{% if license.id == variation.id %} class="active"{% endif %}><a href="#{{ variation.id | remove: '/licenses/' | slugify }}" data-selected-tab="variation-{{ variation.id | remove: '/licenses/' | slugify }}">
{% if variation.nickname != nil %}
{{ variation.nickname }}
{% else %}
@ -43,7 +43,7 @@
{% endif %}
{% for variation in variations %}
<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 %}">
<div {% if variation.id %}id="{{ variation.id | remove: '/licenses/' | slugify }}" {% endif %}class="variation-tab {% if variation.id %}variation-{{ variation.id | remove: '/licenses/' | slugify }}{% endif %} js-variation-tab{% if license.id == variation.id %} active{% endif %}">
<table class="license-rules">
<tr>
{% assign types = "required|permitted|forbidden" | split: "|" %}

View File

@ -1,7 +1,6 @@
---
title: GNU Affero General Public License v3.0
nickname: GNU Affero GPL v3.0
tab-slug: agpl-v3
redirect_from: /licenses/agpl/
family: GPL
variant: true

View File

@ -1,7 +1,6 @@
---
title: BSD 2-clause "Simplified" License
nickname: Simplified BSD
tab-slug: bsd
redirect_from: /licenses/bsd/
family: BSD
variant: true

View File

@ -3,7 +3,6 @@ title: BSD 3-clause Clear License
nickname: Clear BSD
family: BSD
tab-slug: bsd-3-clear
variant: true
description: A permissive license that comes in two variants, the <a href="/licenses/bsd">BSD 2-Clause</a> and <a href="/licenses/bsd-3-clause">BSD 3-Clause</a>. Both have very minute differences to the MIT license. The three clause variant prohibits others from using the name of the project or its contributors to promote derivative works without written consent.

View File

@ -1,7 +1,6 @@
---
title: BSD 3-clause "New" or "Revised" License
nickname: New BSD
tab-slug: bsd-3
family: BSD
variant: true
source: http://opensource.org/licenses/BSD-3-Clause

View File

@ -1,7 +1,6 @@
---
title: Creative Commons Zero v1.0 Universal
nickname: CC0 1.0 Universal
tab-slug: cc0
redirect_from: /licenses/cc0/
family: Public Domain Dedication
variant: true

View File

@ -1,7 +1,6 @@
---
title: European Union Public License 1.1
nickname: EUPL-1.1
tab-slug: eupl-v1.1
redirect_from: /licenses/eupl-v1.1/
family: EUPL
featured: false

View File

@ -1,7 +1,6 @@
---
title: GNU General Public License v2.0
nickname: GNU GPL v2.0
tab-slug: gpl-v2
redirect_from: /licenses/gpl-v2/
family: GPL
variant: true

View File

@ -1,7 +1,6 @@
---
title: GNU General Public License v3.0
nickname: GNU GPL v3.0
tab-slug: gpl-v3
redirect_from: /licenses/gpl-v3/
family: GPL
featured: true

View File

@ -1,6 +1,5 @@
---
title: ISC License
tab-slug: isc
family: BSD
source: http://opensource.org/licenses/isc-license

View File

@ -1,7 +1,6 @@
---
title: GNU Lesser General Public License v2.1
nickname: GNU LGPL v2.1
tab-slug: lgpl-v2_1
redirect_from: /licenses/lgpl-v2.1/
family: LGPL
variant: true

View File

@ -1,7 +1,6 @@
---
title: GNU Lesser General Public License v3.0
nickname: GNU LGPL v3.0
tab-slug: lgpl-v3
redirect_from: /licenses/lgpl-v3/
family: LGPL
source: http://www.gnu.org/licenses/lgpl-3.0.txt

View File

@ -2,7 +2,6 @@
title: LaTeX Project Public License v1.3c
hidden: true
nickname: LPPL-1.3c
tab-slug: lppl-v1.3c
family: LPPL
source: https://latex-project.org/lppl/lppl-1-3c.html

View File

@ -1,6 +1,5 @@
---
title: The Unlicense
tab-slug: unlicense
family: Public Domain Dedication
source: http://unlicense.org/UNLICENSE

View File

@ -15,19 +15,6 @@ describe 'license categories' do
expected = family_licenses.count - 1
expect(variants.count).to eql(expected)
end
family_licenses.each do |license|
context "the #{license['title']} license" do
it 'should have a unique slug' do
dupes = family_licenses.count { |l| l['tab-slug'] == license['tab-slug'] }
expect(dupes).to eql(1)
end
it 'should have a valid tab-slug' do
expect(license['tab-slug']).to match(/[a-z0-9_]/)
end
end
end
end
end
end

View File

@ -19,12 +19,12 @@ describe 'license meta' do
if license['family']
it 'should contain the required license variant fields' do
missing = ['family', 'tab-slug'] - license.keys
missing = %w(family) - license.keys
expect(missing).to be_empty
end
else
it 'should not contain license family specific fields' do
extra = ['variant', 'family', 'tab-slug'].select { |f| raw_fields.keys.include?(f) }
extra = %w(variant family).select { |f| raw_fields.keys.include?(f) }
expect(extra).to be_empty
end
end