Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# This file is auto-generated by Jekyll Auth
# # Feel free to add additional Rake tasks so long as
# # `rake assets:precompile` continues to generate the jekyll site
#
namespace :assets do
task :precompile do
sh "bundle exec jekyll-auth build"
end
end

require "rake/testtask"
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/*_test.rb"]
t.warning = false
t.verbose = false
end

task :default => :test
9 changes: 9 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ exclude:
- CONTRIBUTING.md
- vendor/
- script/
- bin
- test
markdown: kramdown
kramdown:
auto_ids: false
Expand All @@ -30,6 +32,13 @@ collections:
output: true
permalink: /:path/

defaults:
- scope:
path: ""
type: "content"
values:
layout: article

sections:
- /basics/
- /consuming/
Expand Down
2 changes: 0 additions & 2 deletions _content/basics.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
layout: article
title: What is open source?
breadcrumb: Basics
category: basics
credits:
- title: "What is open source?"
attribution: "opensource.com"
Expand Down
2 changes: 0 additions & 2 deletions _content/basics/free-software.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: Is Open Source Software The Same As ‘Free Software’?
category: basics
credits:
- title: "What Is Open Source Software?"
attribution: "OSS Watch"
Expand Down
4 changes: 1 addition & 3 deletions _content/basics/licensing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
layout: article
title: What is Open Source Licensing?
category: basics
attribution:
credits:
- title: "Open Source Development - An Introduction To Ownership And Licensing Issues"
attribution: "OSS Watch"
url: "http://oss-watch.ac.uk/resources/iprguide"
Expand Down
2 changes: 0 additions & 2 deletions _content/basics/proprietary.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: What's the difference between open source software and other types of software?
category: basics
credits:
- title: "What is open source?"
attribution: "opensource.com"
Expand Down
2 changes: 0 additions & 2 deletions _content/basics/who-benefits.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: Who benefits from open source software?
category: basics
credits:
- title: "What is open source?"
attribution: "opensource.com"
Expand Down
2 changes: 0 additions & 2 deletions _content/basics/who-uses.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: Who uses open source software?
category: basics
credits:
- title: "What is open source?"
attribution: "opensource.com"
Expand Down
2 changes: 0 additions & 2 deletions _content/consuming.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: Consuming
category: consuming
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Expand Down
2 changes: 0 additions & 2 deletions _content/contributing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: Contributing
category: contributing
related:
- contributing/how.md
---
Expand Down
17 changes: 0 additions & 17 deletions _content/contributing/finding-projects.md

This file was deleted.

2 changes: 0 additions & 2 deletions _content/contributing/how.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
layout: article
title: How to contribute
breadcrumb: How
category: contributing
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/code.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Code"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/design.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Design"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/financial.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Financial support"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/marketing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Marketing"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/qa.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Quality assurance"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/support.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "User support"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/translation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Language translation"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/ux.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "User experience"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
1 change: 0 additions & 1 deletion _content/contributing/how/writing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Writing"
layout: article
credits:
- title: "Roles In Open Source Projects"
attribution: "OSS Watch"
Expand Down
2 changes: 0 additions & 2 deletions _content/producing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
layout: article
title: Producing
category: producing
---

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Expand Down
42 changes: 0 additions & 42 deletions _content/producing/kindly-closing-pull-requests.md

This file was deleted.

4 changes: 1 addition & 3 deletions _content/producing/naming.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
layout: article
title: Choosing a name
category: producing
credits:
- title: "How to choose a brand name for your open source project"
attribution: Chris Grams
url: https://opensource.com/business/16/2/how-choose-brand-name-open-source-project
license: CC-BY-4.0
license: CC-BY
---

When it comes to developing a new open source software project, most developers don't spend a lot of time thinking about brand strategy. After all, a great idea, solid code, and a passionate community are what really matter when you're getting a project underway.
Expand Down
1 change: 0 additions & 1 deletion _content/producing/prevent-rudeness.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: article
title: Nip Rudeness in the Bud
credits:
- title: "Producing Open Source Software"
Expand Down
12 changes: 12 additions & 0 deletions _data/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Each piece of content has YAML front matter with these properties:

title:
required: true

related:
type: Array

credits:
type: Array

breadcrumb: {}
7 changes: 7 additions & 0 deletions _data/licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Approved licenses for content that can be used on the site.
CC-BY:
name: Creative Commons Attribution
url: https://creativecommons.org/licenses/by/4.0/
CC-BY-SA:
name: Creative Commons Attribution-ShareAlike
url: https://creativecommons.org/licenses/by-sa/4.0/
6 changes: 6 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/bin/sh

set -e

echo "==> Running tests"
time bundle exec rake

echo "==> Running html-proofer…"
time bundle exec htmlproof _site
29 changes: 29 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require "minitest/autorun"
require "jekyll"

module Helper
class << self
attr_accessor :config, :site
end
end

def source
File.expand_path('../', File.dirname(__FILE__))
end

def config
Helper.config ||= Jekyll.configuration("source" => source)
end

def content
site.collections['content'].docs.map { |doc| doc.to_liquid }
end

def site
Helper.site ||= begin
site = Jekyll::Site.new(config)
site.reset
site.read
site
end
end
54 changes: 54 additions & 0 deletions test/lint_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
require_relative "./helper"

describe "lint test" do

content.each do |page|

describe page["path"] do

describe "frontmatter" do

before do
# Load raw metadata to skip defaults
@data = SafeYAML.load_file(page["path"])
end

it "contains supported fields" do
extra_fields = @data.keys - site.data["fields"].keys
assert extra_fields.empty?, "Unexpected metadata in #{page["path"]}: #{extra_fields.inspect}"
end

site.data["fields"].each do |name, attrs|
it "#{name} is required" do
assert @data.key?(name), "#{name} is required"
end if attrs["required"]

it "#{name} should be an Array" do
assert_kind_of Array, @data[name],
"#{name} should be an Array" if @data[name]
end if attrs["type"] == "Array"

it "#{name} has valid attributes" do
end
end

it "related articles should exist" do
@data["related"].each do |path|
assert File.exist?("_content/#{path}"), "#{path} does not exist"
end if @data["related"]
end

it "has valid credits" do
Array(page["credits"]).each do |credit|
keys = ["attribution", "license", "title", "url"].sort
assert_equal credit.keys.sort, keys,
"Malformed credits in #{page["path"]}"

assert site.data["licenses"].include?(credit["license"]),
"Unapproved license in #{page["path"]} for #{credit["url"]}: #{credit["license"]}"
end
end
end
end
end
end