Skip to content

Commit

Permalink
Disable import of theme config by default
Browse files Browse the repository at this point in the history
Users can *opt-in* by setting `import_theme_config: true` in their config
file.
  • Loading branch information
ashmaroli committed Apr 30, 2020
1 parent 923a039 commit a6f932e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 3 additions & 11 deletions features/theme_configuration.feature
Expand Up @@ -3,24 +3,16 @@ Feature: Bundling Config file with Theme gems
I want to be able to pre-configure my gemified theme
In order to make it easier for other Jekyllites to use my theme

Scenario: Easy onboarding with a pre-configured theme
Given I have a configuration file with "theme" set to "test-theme"
And I have an "index.md" page that contains "{{ site.test_theme.skin }}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "aero" in "_site/index.html"

Scenario: Disabling import of theme configuration entirely
Scenario: Enabling import of theme configuration
Given I have a configuration file with:
| key | value |
| theme | test-theme |
| ignore_theme_config | true |
| import_theme_config | true |
And I have an "index.md" page that contains "{{ site.test_theme.skin }}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should not see "aero" in "_site/index.html"
And I should see "aero" in "_site/index.html"

Scenario: A pre-configured theme with valid config file overriding Jekyll defaults
Given I have a configuration file with "theme" set to "test-theme"
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/site.rb
Expand Up @@ -432,7 +432,7 @@ def collections_path
private

def load_theme_configuration(config)
return config if config["ignore_theme_config"]
return config unless config["import_theme_config"] == true

theme_config_file = in_theme_dir("_config.yml")
return config unless File.exist?(theme_config_file)
Expand Down

0 comments on commit a6f932e

Please sign in to comment.