cloudcannon-jekyll 2.3.4 → 3.0.0

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.
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'jekyll'
4
+
5
+ module CloudCannonJekyll
6
+ # Helper functions for generating paths
7
+ module Paths
8
+ def self.collections_dir(site)
9
+ return '' if Jekyll::VERSION.start_with? '2.'
10
+
11
+ site.config['collections_dir']&.sub(%r{^/+}, '') || ''
12
+ end
13
+
14
+ def self.data_dir(site)
15
+ site.config['data_dir']&.sub(%r{^/+}, '') || '_data'
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'jekyll'
4
+
5
+ module CloudCannonJekyll
6
+ # Logging helpers
7
+ class Logger
8
+ def self.info(str)
9
+ Jekyll.logger.info('CloudCannon:', str)
10
+ end
11
+ end
12
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- unless Jekyll::VERSION.start_with? "2."
4
- require "jekyll"
3
+ unless Jekyll::VERSION.start_with? '2.'
4
+ require 'jekyll'
5
5
 
6
6
  module CloudCannonJekyll
7
7
  # Reads data files and creates a collections-style hash representation
@@ -12,7 +12,7 @@ unless Jekyll::VERSION.start_with? "2."
12
12
  # Returns a hash with the path to the data file.
13
13
  def read_data_file(path)
14
14
  {
15
- "path" => path,
15
+ 'path' => path
16
16
  }
17
17
  end
18
18
  end
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if Jekyll::VERSION.start_with? "2."
4
- require "jekyll"
3
+ if Jekyll::VERSION.start_with? '2.'
4
+ require 'jekyll'
5
+ require 'fileutils'
5
6
 
6
7
  module CloudCannonJekyll
7
8
  # Reads data files and creates a collections-style hash representation
@@ -25,14 +26,16 @@ if Jekyll::VERSION.start_with? "2."
25
26
  return unless File.directory?(dir) && (!@safe || !File.symlink?(dir))
26
27
 
27
28
  entries = Dir.chdir(dir) do
28
- Dir["*.{yaml,yml,json,csv}"] + Dir["*"].select { |fn| File.directory?(fn) }
29
+ Dir['*.{yaml,yml,json,csv}'] + Dir['*'].select do |fn|
30
+ File.directory?(fn)
31
+ end
29
32
  end
30
33
 
31
34
  entries.each do |entry|
32
35
  path = Jekyll.sanitized_path(dir, entry)
33
36
  next if File.symlink?(path) && @safe
34
37
 
35
- key = sanitize_filename(File.basename(entry, ".*"))
38
+ key = sanitize_filename(File.basename(entry, '.*'))
36
39
  if File.directory?(path)
37
40
  read_data_to(path, data[key] = {})
38
41
  else
@@ -43,14 +46,14 @@ if Jekyll::VERSION.start_with? "2."
43
46
 
44
47
  def read_data_file(path)
45
48
  {
46
- "path" => path,
49
+ 'path' => path
47
50
  }
48
51
  end
49
52
 
50
53
  def sanitize_filename(name)
51
- name.gsub!(%r![^\w\s_-]+!, "")
52
- name.gsub!(%r!(^|\b\s)\s+($|\s?\b)!, '\\1\\2')
53
- name.gsub(%r!\s+!, "_")
54
+ name.gsub!(/[^\w\s_-]+/, '')
55
+ name.gsub!(/(^|\b\s)\s+($|\s?\b)/, '\\1\\2')
56
+ name.gsub(/\s+/, '_')
54
57
  end
55
58
  end
56
59
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "jekyll"
4
- require_relative "readers/old-data-reader"
5
- require_relative "readers/data-reader"
3
+ require 'jekyll'
4
+ require_relative 'old-data-reader'
5
+ require_relative 'data-reader'
6
6
 
7
7
  module CloudCannonJekyll
8
8
  # Wraps read functions into one class
@@ -13,28 +13,28 @@ module CloudCannonJekyll
13
13
  @site = site
14
14
  end
15
15
 
16
- def read_data(dir = "_data")
16
+ def read_data(dir = '_data')
17
17
  # DataReader doesn't exist in old versions of Jekyll
18
- if Jekyll::VERSION.start_with? "2."
18
+ if Jekyll::VERSION.start_with? '2.'
19
19
  CloudCannonJekyll::OldDataReader.new(@site).read(dir)
20
20
  else
21
21
  CloudCannonJekyll::DataReader.new(@site).read(dir)
22
22
  end
23
23
  end
24
24
 
25
- def read_drafts(dir = "")
25
+ def read_drafts(dir = '')
26
26
  # PostReader doesn't exist in old versions of Jekyll
27
- if Jekyll::VERSION.start_with? "2."
28
- @site.read_content(dir, "_drafts", Jekyll::Draft)
27
+ if Jekyll::VERSION.start_with? '2.'
28
+ @site.read_content(dir, '_drafts', Jekyll::Draft)
29
29
  else
30
30
  Jekyll::PostReader.new(@site).read_drafts(dir)
31
31
  end
32
32
  end
33
33
 
34
- def read_posts(dir = "")
34
+ def read_posts(dir = '')
35
35
  # PostReader doesn't exist in old versions of Jekyll
36
- if Jekyll::VERSION.start_with? "2."
37
- @site.read_content(dir, "_posts", Jekyll::Post)
36
+ if Jekyll::VERSION.start_with? '2.'
37
+ @site.read_content(dir, '_posts', Jekyll::Post)
38
38
  else
39
39
  Jekyll::PostReader.new(@site).read_posts(dir)
40
40
  end
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'jekyll'
4
+
3
5
  module CloudCannonJekyll
4
- # Processes Jekyll configuration to enable the plugin is run and fix common issues
5
- class Configuration
6
+ # Processes Jekyll configuration to enable the plugin and fix common issues
7
+ class Setup
6
8
  def self.processed?(site)
7
9
  site.instance_variable_get(:@_cloudcannon_jekyll_processed) == true
8
10
  end
@@ -17,10 +19,11 @@ module CloudCannonJekyll
17
19
  config = config.fix_common_issues if config.respond_to? :fix_common_issues
18
20
  config = config.add_default_excludes if config.respond_to? :add_default_excludes
19
21
 
20
- key = Jekyll::VERSION.start_with?("2.") ? "gems" : "plugins"
22
+ key = Jekyll::VERSION.start_with?('2.') ? 'gems' : 'plugins'
21
23
 
22
24
  config[key] = Array(config[key])
23
- config[key].push("cloudcannon-jekyll") unless config[key].include? "cloudcannon-jekyll"
25
+ config[key].push('cloudcannon-jekyll') unless config[key].include? 'cloudcannon-jekyll'
26
+
24
27
  config
25
28
  end
26
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudCannonJekyll
4
- VERSION = "2.3.4"
4
+ VERSION = '3.0.0'
5
5
  end
@@ -1,29 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "jekyll"
3
+ require 'jekyll'
4
+ require_relative 'cloudcannon-jekyll/generator'
5
+ require_relative 'cloudcannon-jekyll/setup'
6
+ require_relative 'cloudcannon-jekyll/version'
4
7
 
5
- require_relative "cloudcannon-jekyll/page-without-a-file"
6
- require_relative "cloudcannon-jekyll/generator"
7
- require_relative "cloudcannon-jekyll/configuration"
8
- require_relative "cloudcannon-jekyll/jsonify-filter"
9
- require_relative "cloudcannon-jekyll/version"
10
-
11
- Liquid::Template.register_filter(CloudCannonJekyll::JsonifyFilter)
12
-
13
- if Jekyll::VERSION.start_with? "2."
8
+ if Jekyll::VERSION.start_with? '2.'
14
9
  module Jekyll
15
10
  # Hooks didn't exist in Jekyll 2 so we monkey patch to get an :after_reset hook
16
11
  class Site
17
- alias_method :jekyll_reset, :reset
12
+ alias jekyll_reset reset
18
13
 
19
14
  def reset
20
15
  jekyll_reset
21
- CloudCannonJekyll::Configuration.set(self)
16
+ CloudCannonJekyll::Setup.set(self)
22
17
  end
23
18
  end
24
19
  end
25
20
  else
26
21
  Jekyll::Hooks.register :site, :after_reset do |site|
27
- CloudCannonJekyll::Configuration.set(site)
22
+ CloudCannonJekyll::Setup.set(site)
28
23
  end
29
24
  end
data/script/lint ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ set -ex
4
+
5
+ bundle exec rubocop -S
data/script/test CHANGED
@@ -3,4 +3,3 @@
3
3
  set -ex
4
4
 
5
5
  bundle exec rspec "$@"
6
- bundle exec rubocop -S
@@ -2,10 +2,8 @@
2
2
 
3
3
  set -ex
4
4
 
5
- # Checks to see the build is likely to fail on Travis.
6
- # Duplicated the versions from .travis.yml
7
-
8
5
  JEKYLL_VERSION=2.4.0 bundle update && $(dirname "$0")/test &&
9
6
  JEKYLL_VERSION=3.0.0 bundle update && $(dirname "$0")/test &&
10
7
  JEKYLL_VERSION=3.8.5 bundle update && $(dirname "$0")/test &&
11
- JEKYLL_VERSION=4.2.0 bundle update && $(dirname "$0")/test
8
+ JEKYLL_VERSION=4.2.1 bundle update && $(dirname "$0")/test
9
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudcannon-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CloudCannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-23 00:00:00.000000000 Z
11
+ date: 2021-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.4.0
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '5'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,23 +24,6 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 2.4.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '5'
33
- - !ruby/object:Gem::Dependency
34
- name: json_schemer
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: 0.2.13
40
- type: :development
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: 0.2.13
47
27
  - !ruby/object:Gem::Dependency
48
28
  name: rake
49
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,20 +66,6 @@ dependencies:
86
66
  - - "~>"
87
67
  - !ruby/object:Gem::Version
88
68
  version: '0.80'
89
- - !ruby/object:Gem::Dependency
90
- name: rubocop-jekyll
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '0.11'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '0.11'
103
69
  description: Creates CloudCannon editor details for Jekyll
104
70
  email:
105
71
  - support@cloudcannon.com
@@ -112,7 +78,6 @@ files:
112
78
  - ".reek.yml"
113
79
  - ".rspec"
114
80
  - ".rubocop.yml"
115
- - ".travis.yml"
116
81
  - Gemfile
117
82
  - HISTORY.md
118
83
  - LICENSE.txt
@@ -120,21 +85,22 @@ files:
120
85
  - Rakefile
121
86
  - cloudcannon-jekyll.gemspec
122
87
  - lib/cloudcannon-jekyll.rb
123
- - lib/cloudcannon-jekyll/_cloudcannon/info-2.x.json
124
- - lib/cloudcannon-jekyll/_cloudcannon/info-3.0-4.x.json
125
- - lib/cloudcannon-jekyll/_cloudcannon/info.json
126
- - lib/cloudcannon-jekyll/configuration.rb
88
+ - lib/cloudcannon-jekyll/config.rb
127
89
  - lib/cloudcannon-jekyll/generator.rb
128
- - lib/cloudcannon-jekyll/jsonify-filter.rb
129
- - lib/cloudcannon-jekyll/page-without-a-file.rb
130
- - lib/cloudcannon-jekyll/reader.rb
90
+ - lib/cloudcannon-jekyll/generators/collections.rb
91
+ - lib/cloudcannon-jekyll/generators/data.rb
92
+ - lib/cloudcannon-jekyll/generators/info.rb
93
+ - lib/cloudcannon-jekyll/generators/paths.rb
94
+ - lib/cloudcannon-jekyll/logger.rb
131
95
  - lib/cloudcannon-jekyll/readers/data-reader.rb
132
96
  - lib/cloudcannon-jekyll/readers/old-data-reader.rb
97
+ - lib/cloudcannon-jekyll/readers/reader.rb
98
+ - lib/cloudcannon-jekyll/setup.rb
133
99
  - lib/cloudcannon-jekyll/version.rb
134
- - script/ci-smoke-test
135
- - script/cibuild
100
+ - script/lint
136
101
  - script/release
137
102
  - script/test
103
+ - script/test-all-versions
138
104
  homepage: https://github.com/cloudcannon/cloudcannon-jekyll
139
105
  licenses:
140
106
  - MIT
data/.travis.yml DELETED
@@ -1,19 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 2.6
5
-
6
- before_install:
7
- - gem update --system
8
- - gem install bundler
9
-
10
- script: script/cibuild
11
-
12
- env:
13
- global:
14
- - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
15
- matrix:
16
- - JEKYLL_VERSION="2.4.0"
17
- - JEKYLL_VERSION="3.0.0"
18
- - JEKYLL_VERSION="3.8.5"
19
- - JEKYLL_VERSION="4.2.0"
@@ -1,83 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- "generator": {
8
- "name": "jekyll",
9
- "version": {{ jekyll.version | cc_jsonify }},
10
- "environment": {{ jekyll.env | cc_jsonify }},
11
- "metadata": {
12
- "markdown": {{ site.markdown | cc_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_jsonify }}
15
- }
16
- },
17
- {% if config.timezone %}
18
- "timezone": {{ config.timezone | cc_jsonify }},
19
- {% endif %}
20
- "collections-config": {{ collections_config | cc_jsonify }},
21
- "collections": {
22
- {% for collection in collections %}"{{ collection[0] | xml_escape }}": {{ collection[1] | cc_jsonify }}{% unless forloop.last %},{% endunless %}
23
- {% endfor %}
24
- },
25
- "data": {{ data | cc_jsonify }},
26
- {% if config.baseurl %}
27
- "base-url": {{ config.baseurl | cc_jsonify }},
28
- {% endif %}
29
- {% if config._comments %}
30
- "_comments": {{ config._comments | cc_jsonify }},
31
- {% endif %}
32
- {% if config._enabled_editors %}
33
- "_enabled_editors": {{ config._enabled_editors | cc_jsonify }},
34
- {% endif %}
35
- {% if config._instance_values %}
36
- "_instance_values": {{ config._instance_values | cc_jsonify }},
37
- {% endif %}
38
- {% if config._options %}
39
- "_options": {{ config._options | cc_jsonify }},
40
- {% endif %}
41
- {% if config._inputs %}
42
- "_inputs": {{ config._inputs | cc_jsonify }},
43
- {% endif %}
44
- {% if config._editables %}
45
- "_editables": {{ config._editables | cc_jsonify }},
46
- {% endif %}
47
- {% if config._collection_groups %}
48
- "_collection_groups": {{ config._collection_groups | cc_jsonify }},
49
- {% endif %}
50
- {% if config._editor %}
51
- "_editor": {
52
- "default_path": {{ config._editor.default_path | cc_jsonify }}
53
- },
54
- {% endif %}
55
- {% if config._source_editor %}
56
- "_source_editor": {
57
- "tab_size": {{ config._source_editor.tab_size | cc_jsonify }},
58
- "show_gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
59
- "theme": {{ config._source_editor.theme | cc_jsonify }}
60
- },
61
- {% endif %}
62
- "paths": {
63
- "static": "",
64
- "uploads": {{ config.uploads_dir | cc_jsonify }},
65
- "data": {{ config.data_dir | cc_jsonify }},
66
- "collections": {{ config.collections_dir | cc_jsonify }},
67
- "layouts": {{ config.layouts_dir | cc_jsonify }}
68
- },
69
- {% if config._structures %}
70
- "_structures": {{ config._structures | cc_jsonify: 50 }},
71
- {% endif %}
72
- {% if config._array_structures %}
73
- "_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
74
- {% endif %}
75
- {% assign select_data = config | cc_select_data_jsonify %}
76
- {% if select_data %}
77
- "_select_data": {{ select_data }},
78
- {% endif %}
79
- {% if config.defaults %}
80
- "defaults": {{ config.defaults | cc_jsonify }},
81
- {% endif %}
82
- "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
83
- }
@@ -1,83 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "cloudcannon": {
4
- "name": "cloudcannon-jekyll",
5
- "version": {{ gem_version | cc_jsonify }}
6
- },
7
- "generator": {
8
- "name": "jekyll",
9
- "version": {{ jekyll.version | cc_jsonify }},
10
- "environment": {{ jekyll.env | cc_jsonify }},
11
- "metadata": {
12
- "markdown": {{ site.markdown | cc_jsonify }},
13
- "kramdown": {{ site.kramdown | cc_jsonify }},
14
- "commonmark": {{ site.commonmark | cc_jsonify }}
15
- }
16
- },
17
- {% if config.timezone %}
18
- "timezone": {{ config.timezone | cc_jsonify }},
19
- {% endif %}
20
- "collections-config": {{ collections_config | cc_jsonify }},
21
- "collections": {
22
- {% for collection in collections %}"{{ collection[0] | xml_escape }}": {{ collection[1] | cc_jsonify }}{% unless forloop.last %},{% endunless %}
23
- {% endfor %}
24
- },
25
- "data": {{ data | cc_jsonify }},
26
- {% if config.baseurl %}
27
- "base-url": {{ config.baseurl | cc_jsonify }},
28
- {% endif %}
29
- {% if config._comments %}
30
- "_comments": {{ config._comments | cc_jsonify }},
31
- {% endif %}
32
- {% if config._enabled_editors %}
33
- "_enabled_editors": {{ config._enabled_editors | cc_jsonify }},
34
- {% endif %}
35
- {% if config._instance_values %}
36
- "_instance_values": {{ config._instance_values | cc_jsonify }},
37
- {% endif %}
38
- {% if config._options %}
39
- "_options": {{ config._options | cc_jsonify }},
40
- {% endif %}
41
- {% if config._inputs %}
42
- "_inputs": {{ config._inputs | cc_jsonify }},
43
- {% endif %}
44
- {% if config._editables %}
45
- "_editables": {{ config._editables | cc_jsonify }},
46
- {% endif %}
47
- {% if config._collection_groups %}
48
- "_collection_groups": {{ config._collection_groups | cc_jsonify }},
49
- {% endif %}
50
- {% if config._editor %}
51
- "_editor": {
52
- "default_path": {{ config._editor.default_path | cc_jsonify }}
53
- },
54
- {% endif %}
55
- {% if config._source_editor %}
56
- "_source_editor": {
57
- "tab_size": {{ config._source_editor.tab_size | cc_jsonify }},
58
- "show_gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
59
- "theme": {{ config._source_editor.theme | cc_jsonify }}
60
- },
61
- {% endif %}
62
- "paths": {
63
- "static": "",
64
- "uploads": {{ config.uploads_dir | cc_jsonify }},
65
- "data": {{ config.data_dir | cc_jsonify }},
66
- "collections": {{ config.collections_dir | cc_jsonify }},
67
- "layouts": {{ config.layouts_dir | cc_jsonify }}
68
- },
69
- {% if config._structures %}
70
- "_structures": {{ config._structures | cc_jsonify: 50 }},
71
- {% endif %}
72
- {% if config._array_structures %}
73
- "_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
74
- {% endif %}
75
- {% assign select_data = config | cc_select_data_jsonify %}
76
- {% if select_data %}
77
- "_select_data": {{ select_data }},
78
- {% endif %}
79
- {% if config.defaults %}
80
- "defaults": {{ config.defaults | cc_jsonify }},
81
- {% endif %}
82
- "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
83
- }
@@ -1,86 +0,0 @@
1
- {
2
- "time": {{ site.time | date_to_xmlschema | cc_jsonify }},
3
- "version": {{ version | cc_jsonify }},
4
- "cloudcannon": {
5
- "name": "cloudcannon-jekyll",
6
- "version": {{ gem_version | cc_jsonify }}
7
- },
8
- "generator": {
9
- "name": "jekyll",
10
- "version": {{ jekyll.version | cc_jsonify }},
11
- "environment": {{ jekyll.env | cc_jsonify }},
12
- "metadata": {
13
- "markdown": {{ site.markdown | cc_jsonify }},
14
- "kramdown": {{ site.kramdown | cc_jsonify }},
15
- "commonmark": {{ site.commonmark | cc_jsonify }}
16
- }
17
- },
18
- {% if config.timezone -%}
19
- "timezone": {{ config.timezone | cc_jsonify }},
20
- {%- endif %}
21
- "collections-config": {{ collections_config | cc_jsonify }},
22
- "collections": {
23
- {%- for collection in collections -%}
24
- "{{ collection[0] | xml_escape }}": {{ collection[1] | cc_jsonify }}
25
- {%- unless forloop.last %},{% endunless %}
26
- {%- endfor -%}
27
- },
28
- "data": {{ data | cc_jsonify }},
29
- {% if config.baseurl -%}
30
- "base-url": {{ config.baseurl | cc_jsonify }},
31
- {%- endif %}
32
- {% if config._comments -%}
33
- "_comments": {{ config._comments | cc_jsonify }},
34
- {%- endif %}
35
- {% if config._enabled_editors -%}
36
- "_enabled_editors": {{ config._enabled_editors | cc_jsonify }},
37
- {%- endif %}
38
- {% if config._instance_values -%}
39
- "_instance_values": {{ config._instance_values | cc_jsonify }},
40
- {%- endif %}
41
- {% if config._options -%}
42
- "_options": {{ config._options | cc_jsonify }},
43
- {%- endif %}
44
- {% if config._inputs -%}
45
- "_inputs": {{ config._inputs | cc_jsonify }},
46
- {%- endif %}
47
- {% if config._editables -%}
48
- "_editables": {{ config._editables | cc_jsonify }},
49
- {%- endif %}
50
- {% if config._collection_groups -%}
51
- "_collection_groups": {{ config._collection_groups | cc_jsonify }},
52
- {%- endif %}
53
- {% if config._editor -%}
54
- "_editor": {
55
- "default_path": {{ config._editor.default_path | cc_jsonify }}
56
- },
57
- {%- endif %}
58
- {% if config._source_editor -%}
59
- "_source_editor": {
60
- "tab_size": {{ config._source_editor.tab_size | cc_jsonify }},
61
- "show_gutter": {{ config._source_editor.show_gutter | cc_jsonify }},
62
- "theme": {{ config._source_editor.theme | cc_jsonify }}
63
- },
64
- {%- endif %}
65
- "paths": {
66
- "static": "",
67
- "uploads": {{ config.uploads_dir | cc_jsonify }},
68
- "data": {{ config.data_dir | cc_jsonify }},
69
- "collections": {{ config.collections_dir | cc_jsonify }},
70
- "layouts": {{ config.layouts_dir | cc_jsonify }}
71
- },
72
- {% if config._structures -%}
73
- "_structures": {{ config._structures | cc_jsonify: 50 }},
74
- {%- endif %}
75
- {% if config._array_structures -%}
76
- "_array_structures": {{ config._array_structures | cc_jsonify: 50 }},
77
- {%- endif %}
78
- {% assign select_data = config | cc_select_data_jsonify -%}
79
- {% if select_data -%}
80
- "_select_data": {{ select_data }},
81
- {%- endif %}
82
- {% if config.defaults -%}
83
- "defaults": {{ config.defaults | cc_jsonify }},
84
- {%- endif %}
85
- "source": {{ config.source | replace: pwd, "" | cc_jsonify }}
86
- }