jekyll-v4-github-pages 232 → 234

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ec66e769e01b1d4742041cc722e946ca77166e9a0df03106688651d4455ce04
4
- data.tar.gz: 56ad6f63329c5d397c3a7f489a45c82f1e9fa5f13b59face93a07f6937ecd89b
3
+ metadata.gz: 4b7b2f07ded77eb57ce3e458cf8db3430d993768a4f339d40499994c5c9f0bc6
4
+ data.tar.gz: 2d27a62c365a684b1020925d4e9696701b4852d8dc93a1261d14b781b46b76d7
5
5
  SHA512:
6
- metadata.gz: a930e8f7b707ae7d2c4362c7b2d9531397558361450fd53223f31619f7054a82cb265f679dc5c99a1578de68fa86093ddf492168faef476cabd601a101dd42c7
7
- data.tar.gz: 9a9763209bc8c9b64dbd40e453c29ef6f288e0297679b646da9bc515e148a251d580eb5d2ad631ed947711f1c0826ce76b65786e980bbf2ae7018488442d4f76
6
+ metadata.gz: af2e44624f0d1b02f8a1247200b85da6da9323dfa75350b634fb2170c26a6d9b1c6b27b8b0fc86790b7e8455f859a6c025bc76b1e4024a75f4337b4a89ef5a04
7
+ data.tar.gz: baadf79d24dc847f035965f766a0a1dd094b98b1f98f4beea7ca2b1ac257a7be669c5c72daa5a397f01b8c3ef567cd9d57332f7a5e3667ab26bd74230e73151e
@@ -65,8 +65,19 @@ Mercenary.program(:"jekyll-v4-github-pages") do |p|
65
65
  c.option 'source', '--source DIR', 'From where to collect the source files'
66
66
  c.option 'destination', '--destination DIR', 'To where the compiled files should be written'
67
67
  c.option 'future', '--future', 'Publishes posts with a future date'
68
+ c.option 'config', '--config FILE1[,FILE2[,FILE3]]', Array, 'Specify config files instead of using _config.yml'
68
69
 
69
70
  c.action do |_, options|
71
+ Jekyll.logger.log_level = :error
72
+ config_options = options.clone
73
+ config_options.delete("verbose")
74
+ user_configs = Jekyll::Configuration.new.config_files(config_options)
75
+ Jekyll.logger.log_level = :info
76
+
77
+ default_config = File.expand_path("../../lib/_default_config.yml", __FILE__)
78
+
79
+ options["config"] = [default_config] + user_configs
80
+
70
81
  Jekyll::Commands::Build.process(options)
71
82
  end
72
83
  end
@@ -0,0 +1,23 @@
1
+ # Default, user overwritable options
2
+ jailed: false
3
+ future: false
4
+ theme: jekyll-v4-theme-primer
5
+ markdown: kramdown
6
+ kramdown:
7
+ input: GFM
8
+ hard_wrap: false
9
+ gfm_quirks: paragraph_end
10
+ syntax_highlighter_opts:
11
+ default_lang: plaintext
12
+ template: ""
13
+ math_engine: mathjax
14
+ syntax_highlighter: rouge
15
+ exclude:
16
+ - CNAME
17
+
18
+ # Previously not overwritable, now these can be configured as well
19
+ lsi: false
20
+ safe: true
21
+ highlighter: rouge
22
+ gist:
23
+ noscript: false
@@ -3,7 +3,8 @@
3
3
  require "securerandom"
4
4
 
5
5
  module GitHubPages
6
- # Sets and manages Jekyll configuration defaults and overrides
6
+ # Sets and manages Jekyll configuration defaults
7
+ # Most configuration is now set in _default_config.yml
7
8
  class Configuration
8
9
  # Backward compatability of constants
9
10
  DEFAULT_PLUGINS = GitHubPages::Plugins::DEFAULT_PLUGINS
@@ -11,57 +12,13 @@ module GitHubPages
11
12
  DEVELOPMENT_PLUGINS = GitHubPages::Plugins::DEVELOPMENT_PLUGINS
12
13
  THEMES = GitHubPages::Plugins::THEMES
13
14
 
14
- # Default, user overwritable options
15
- DEFAULTS = {
16
- "jailed" => false,
17
- "plugins" => GitHubPages::Plugins::DEFAULT_PLUGINS,
18
- "future" => true,
19
- "theme" => "jekyll-v4-theme-primer",
20
- "markdown" => "kramdown",
21
- "kramdown" => {
22
- "input" => "GFM",
23
- "hard_wrap" => false,
24
- "gfm_quirks" => "paragraph_end",
25
- "syntax_highlighter_opts" => {
26
- "default_lang" => "plaintext",
27
- },
28
- },
29
- "exclude" => ["CNAME"],
30
- }.freeze
31
-
32
15
  # User-overwritable defaults used only in production for practical reasons
33
- PRODUCTION_DEFAULTS = Jekyll::Utils.deep_merge_hashes DEFAULTS, {
16
+ PRODUCTION_DEFAULTS = {
34
17
  "sass" => {
35
18
  "style" => "compressed",
36
19
  },
37
20
  }.freeze
38
21
 
39
- # Options which GitHub Pages sets, regardless of the user-specified value
40
- #
41
- # The following values are also overridden by GitHub Pages, but are not
42
- # overridden locally, for practical purposes:
43
- # * source
44
- # * destination
45
- # * jailed
46
- # * verbose
47
- # * incremental
48
- # * GH_ENV
49
- OVERRIDES = {
50
- "lsi" => false,
51
- "safe" => true,
52
- "plugins_dir" => SecureRandom.hex,
53
- "whitelist" => GitHubPages::Plugins::PLUGIN_WHITELIST,
54
- "highlighter" => "rouge",
55
- "kramdown" => {
56
- "template" => "",
57
- "math_engine" => "mathjax",
58
- "syntax_highlighter" => "rouge",
59
- },
60
- "gist" => {
61
- "noscript" => false,
62
- },
63
- }.freeze
64
-
65
22
  class << self
66
23
  def processed?(site)
67
24
  site.instance_variable_get(:@_github_pages_processed) == true
@@ -79,31 +36,19 @@ module GitHubPages
79
36
  Jekyll.env == "development"
80
37
  end
81
38
 
82
- def defaults_for_env
83
- defaults = development? ? DEFAULTS : PRODUCTION_DEFAULTS
84
- Jekyll::Utils.deep_merge_hashes Jekyll::Configuration::DEFAULTS, defaults
85
- end
86
-
87
- # Given a user's config, determines the effective configuration by building a user
88
- # configuration sandwhich with our overrides overriding the user's specified
89
- # values which themselves override our defaults.
90
- #
91
39
  # Returns the effective Configuration
92
40
  #
93
41
  # Note: this is a highly modified version of Jekyll#configuration
94
42
  def effective_config(user_config)
95
- # Merge user config into defaults
96
- config = Jekyll::Utils.deep_merge_hashes(defaults_for_env, user_config)
97
- .add_default_collections
43
+ config = user_config
44
+ if !development?
45
+ config = Jekyll::Utils.deep_merge_hashes PRODUCTION_DEFAULTS, config
46
+ end
98
47
 
99
48
  # Allow theme to be explicitly disabled via "theme: null"
100
49
  config["theme"] = user_config["theme"] if user_config.key?("theme")
101
50
 
102
51
  migrate_theme_to_remote_theme(config)
103
- exclude_cname(config)
104
-
105
- # Merge overwrites into user config
106
- config = Jekyll::Utils.deep_merge_hashes config, OVERRIDES
107
52
 
108
53
  restrict_and_config_markdown_processor(config)
109
54
 
@@ -123,7 +68,7 @@ module GitHubPages
123
68
  processed(site)
124
69
  end
125
70
 
126
- # Set the site's configuration with all the proper defaults and overrides.
71
+ # Set the site's configuration with all the proper defaults.
127
72
  # Should be called by #set to protect against multiple processings.
128
73
  def set!(site)
129
74
  site.config = effective_config(site.config)
@@ -154,17 +99,11 @@ module GitHubPages
154
99
  # This functionality has been rolled back due to complications with jekyll-remote-theme.
155
100
  end
156
101
 
157
- # If the user's 'exclude' config is the default, also exclude the CNAME
158
- def exclude_cname(config)
159
- return unless config["exclude"].eql? Jekyll::Configuration::DEFAULT_EXCLUDES
160
-
161
- config["exclude"].concat(DEFAULTS["exclude"])
162
- end
163
-
164
102
  # Requires default plugins and configures whitelist in development
165
103
  def configure_plugins(config)
166
104
  # Ensure we have those gems we want.
167
105
  config["plugins"] = Array(config["plugins"]) | DEFAULT_PLUGINS
106
+ config["whitelist"] = Array(config["whitelist"]) | PLUGIN_WHITELIST
168
107
 
169
108
  # To minimize errors, lazy-require jekyll-remote-theme if requested by the user
170
109
  config["plugins"].push("jekyll-remote-theme") if config.key? "remote_theme"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitHubPages
4
- VERSION = 232
4
+ VERSION = 234
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-v4-github-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: '232'
4
+ version: '234'
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub, Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-09 00:00:00.000000000 Z
12
+ date: 2023-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jekyll
@@ -700,6 +700,7 @@ extra_rdoc_files: []
700
700
  files:
701
701
  - ".rubocop.yml"
702
702
  - bin/jekyll-v4-github-pages
703
+ - lib/_default_config.yml
703
704
  - lib/github-pages.rb
704
705
  - lib/github-pages/configuration.rb
705
706
  - lib/github-pages/dependencies.rb