github-pages 61 → 62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/github-pages/configuration.rb +132 -0
- data/lib/github-pages/dependencies.rb +67 -0
- data/lib/github-pages/version.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 236cdbaaf5f3c69fe54ebb00dd8806661bd66f89
|
4
|
+
data.tar.gz: 24918367d9f67c809bd4190fdc70ec0605853852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fb4e897495fdbe09956c5b88f59b3cfa32b4eef9137b5ee35b00e24c003cb31647f3075524e1f3e7688ec5720e6b990ffb4068a700ffe08f8f09659a733d228
|
7
|
+
data.tar.gz: d785bf11c96d2761db3f2f707163c29ceb740399366a30b7e9a164fe594e98b61df86f68bed2983691a94c1ee9519fbff56fd5b384af4f870d0d9839b8596af6
|
@@ -0,0 +1,132 @@
|
|
1
|
+
module GitHubPages
|
2
|
+
#
|
3
|
+
class Configuration
|
4
|
+
# Plugins which are activated by default
|
5
|
+
DEFAULT_PLUGINS = %w(
|
6
|
+
jekyll-coffeescript
|
7
|
+
jekyll-gist
|
8
|
+
jekyll-github-metadata
|
9
|
+
jekyll-paginate
|
10
|
+
jekyll-textile-converter
|
11
|
+
).freeze
|
12
|
+
|
13
|
+
# Plugins allowed by GitHub Pages
|
14
|
+
PLUGIN_WHITELIST = %w(
|
15
|
+
jekyll-coffeescript
|
16
|
+
jekyll-feed
|
17
|
+
jekyll-gist
|
18
|
+
jekyll-github-metadata
|
19
|
+
jekyll-mentions
|
20
|
+
jekyll-paginate
|
21
|
+
jekyll-redirect-from
|
22
|
+
jekyll-seo-tag
|
23
|
+
jekyll-sitemap
|
24
|
+
jekyll-textile-converter
|
25
|
+
jemoji
|
26
|
+
).freeze
|
27
|
+
|
28
|
+
# Default, user overwritable options
|
29
|
+
DEFAULTS = {
|
30
|
+
"jailed" => false,
|
31
|
+
"gems" => DEFAULT_PLUGINS,
|
32
|
+
"kramdown" => {
|
33
|
+
"input" => "GFM",
|
34
|
+
"hard_wrap" => false
|
35
|
+
}
|
36
|
+
}.freeze
|
37
|
+
|
38
|
+
# Jekyll defaults merged with Pages defaults.
|
39
|
+
MERGED_DEFAULTS = Jekyll::Utils.deep_merge_hashes(
|
40
|
+
Jekyll::Configuration::DEFAULTS,
|
41
|
+
DEFAULTS
|
42
|
+
).freeze
|
43
|
+
|
44
|
+
# Options which GitHub Pages sets, regardless of the user-specified value
|
45
|
+
#
|
46
|
+
# The following values are also overridden by GitHub Pages, but are not
|
47
|
+
# overridden locally, for practical purposes:
|
48
|
+
# * source
|
49
|
+
# * destination
|
50
|
+
# * jailed
|
51
|
+
# * verbose
|
52
|
+
# * incremental
|
53
|
+
# * GH_ENV
|
54
|
+
OVERRIDES = {
|
55
|
+
"lsi" => false,
|
56
|
+
"safe" => true,
|
57
|
+
"plugins" => SecureRandom.hex,
|
58
|
+
"whitelist" => PLUGIN_WHITELIST,
|
59
|
+
"highlighter" => "rouge",
|
60
|
+
"kramdown" => {
|
61
|
+
"template" => "",
|
62
|
+
"math_engine" => "mathjax",
|
63
|
+
"syntax_highligher" => "rouge"
|
64
|
+
},
|
65
|
+
"gist" => {
|
66
|
+
"noscript" => false
|
67
|
+
}
|
68
|
+
}.freeze
|
69
|
+
|
70
|
+
# These configuration settings have corresponding instance variables on
|
71
|
+
# Jekyll::Site and need to be set properly when the config is updated.
|
72
|
+
CONFIGS_WITH_METHODS = %w(
|
73
|
+
safe lsi highlighter baseurl exclude include future unpublished
|
74
|
+
show_drafts limit_posts keep_files gems
|
75
|
+
).freeze
|
76
|
+
|
77
|
+
class << self
|
78
|
+
def processed?(site)
|
79
|
+
site.instance_variable_get(:@_github_pages_processed) == true
|
80
|
+
end
|
81
|
+
|
82
|
+
def processed(site)
|
83
|
+
site.instance_variable_set :@_github_pages_processed, true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Given a user's config, determines the effective configuration by building a user
|
87
|
+
# configuration sandwhich with our overrides overriding the user's specified
|
88
|
+
# values which themselves override our defaults.
|
89
|
+
#
|
90
|
+
# Returns the effective Configuration
|
91
|
+
#
|
92
|
+
# Note: this is a highly modified version of Jekyll#configuration
|
93
|
+
def effective_config(user_config)
|
94
|
+
# Merge user config into defaults
|
95
|
+
config = Jekyll::Utils.deep_merge_hashes(MERGED_DEFAULTS, user_config)
|
96
|
+
.fix_common_issues
|
97
|
+
.add_default_collections
|
98
|
+
|
99
|
+
# Merge overwrites into user config
|
100
|
+
config = Jekyll::Utils.deep_merge_hashes config, OVERRIDES
|
101
|
+
|
102
|
+
# Ensure we have those gems we want.
|
103
|
+
config["gems"] = Array(config["gems"]) | DEFAULT_PLUGINS
|
104
|
+
|
105
|
+
config
|
106
|
+
end
|
107
|
+
|
108
|
+
# Set the site's configuration. Implemented as an `after_reset` hook.
|
109
|
+
# Equivalent #set! function contains the code of interest. This function
|
110
|
+
# guards against double-processing via the value in #processed.
|
111
|
+
def set(site)
|
112
|
+
return if processed? site
|
113
|
+
set!(site)
|
114
|
+
processed(site)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Set the site's configuration with all the proper defaults and overrides.
|
118
|
+
# Should be called by #set to protect against multiple processings.
|
119
|
+
def set!(site)
|
120
|
+
config = effective_config(site.config)
|
121
|
+
|
122
|
+
# Assign everything to the site
|
123
|
+
site.instance_variable_set :@config, config
|
124
|
+
|
125
|
+
# Ensure all
|
126
|
+
CONFIGS_WITH_METHODS.each do |opt|
|
127
|
+
site.public_send("#{opt}=", site.config[opt])
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module GitHubPages
|
2
|
+
# Dependencies is where all the public dependencies for GitHub Pages are defined,
|
3
|
+
# and versions locked. Any plugin for Pages must be specified here with a
|
4
|
+
# corresponding version to which it shall be locked in the runtime dependencies.
|
5
|
+
class Dependencies
|
6
|
+
VERSIONS = {
|
7
|
+
# Jekyll
|
8
|
+
"jekyll" => "3.0.3",
|
9
|
+
"jekyll-sass-converter" => "1.3.0",
|
10
|
+
"jekyll-textile-converter" => "0.1.0",
|
11
|
+
|
12
|
+
# Converters
|
13
|
+
"kramdown" => "1.10.0",
|
14
|
+
"rdiscount" => "2.1.8",
|
15
|
+
"redcarpet" => "3.3.3",
|
16
|
+
"RedCloth" => "4.2.9",
|
17
|
+
|
18
|
+
# Liquid
|
19
|
+
"liquid" => "3.0.6",
|
20
|
+
|
21
|
+
# Highlighters
|
22
|
+
"rouge" => "1.10.1",
|
23
|
+
|
24
|
+
# Plugins
|
25
|
+
"jemoji" => "0.5.1",
|
26
|
+
"jekyll-mentions" => "1.0.1",
|
27
|
+
"jekyll-redirect-from" => "0.9.1",
|
28
|
+
"jekyll-sitemap" => "0.10.0",
|
29
|
+
"jekyll-feed" => "0.4.0",
|
30
|
+
"jekyll-gist" => "1.4.0",
|
31
|
+
"jekyll-paginate" => "1.1.0",
|
32
|
+
"github-pages-health-check" => "1.1.0",
|
33
|
+
"jekyll-coffeescript" => "1.0.1",
|
34
|
+
"jekyll-seo-tag" => "1.3.2",
|
35
|
+
"jekyll-github-metadata" => "1.9.0"
|
36
|
+
}.freeze
|
37
|
+
|
38
|
+
# Jekyll and related dependency versions as used by GitHub Pages.
|
39
|
+
# For more information see:
|
40
|
+
# https://help.github.com/articles/using-jekyll-with-pages
|
41
|
+
def self.gems
|
42
|
+
VERSIONS
|
43
|
+
end
|
44
|
+
|
45
|
+
# Versions used by GitHub Pages, including github-pages gem and ruby version
|
46
|
+
# Useful for programmatically querying for the current-running version
|
47
|
+
def self.versions
|
48
|
+
gems.merge version_report
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.version_report
|
52
|
+
require "html/pipeline/version"
|
53
|
+
require "sass/version"
|
54
|
+
require "safe_yaml/version"
|
55
|
+
|
56
|
+
{
|
57
|
+
"ruby" => RUBY_VERSION,
|
58
|
+
|
59
|
+
# Gem versions we're curious about
|
60
|
+
"github-pages" => VERSION.to_s,
|
61
|
+
"html-pipeline" => HTML::Pipeline::VERSION,
|
62
|
+
"sass" => Sass.version[:number],
|
63
|
+
"safe_yaml" => SafeYAML::VERSION
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '62'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
@@ -355,6 +355,9 @@ extra_rdoc_files: []
|
|
355
355
|
files:
|
356
356
|
- bin/github-pages
|
357
357
|
- lib/github-pages.rb
|
358
|
+
- lib/github-pages/configuration.rb
|
359
|
+
- lib/github-pages/dependencies.rb
|
360
|
+
- lib/github-pages/version.rb
|
358
361
|
homepage: https://github.com/github/pages-gem
|
359
362
|
licenses:
|
360
363
|
- MIT
|
@@ -381,7 +384,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
381
384
|
version: '0'
|
382
385
|
requirements: []
|
383
386
|
rubyforge_project:
|
384
|
-
rubygems_version: 2.
|
387
|
+
rubygems_version: 2.6.1
|
385
388
|
signing_key:
|
386
389
|
specification_version: 4
|
387
390
|
summary: Track GitHub Pages dependencies.
|