kontent-jekyll 0.11.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 14395dd704cf2d64a87117bc43b239c5e1e3e1cd4a15c13541d9b0c54dca13ea
4
+ data.tar.gz: 71e635cdabd40630c2ee296376cf5ce814e002d7c5f380491e4a9ccad3e7b80d
5
+ SHA512:
6
+ metadata.gz: b2c9e8cb3b5334103346c97aff2225338df2996585eb61e869822cdf35229f42ab9ae0c04e9458d8b7e1748df3aa41a886e13b84ad1c72f2d0bc6ed25636e189
7
+ data.tar.gz: 85615a0c1a4a444bf67d55c1b5b8849a64572572841ad5a7f8980dda5956a5702a80cb72082ec81e973c8e11c2b7c6bd17a1b3ace8110c2c7be0b62b1bfdcb43
data/.gitignore ADDED
@@ -0,0 +1,54 @@
1
+ /spec/dest
2
+
3
+ *.gem
4
+ *.rbc
5
+ /.config
6
+ /coverage/
7
+ /InstalledFiles
8
+ /pkg/
9
+ /spec/reports/
10
+ /spec/examples.txt
11
+ /test/tmp/
12
+ /test/version_tmp/
13
+ /tmp/
14
+
15
+ # Used by dotenv library to load environment variables.
16
+ # .env
17
+
18
+ ## Specific to RubyMotion:
19
+ .dat*
20
+ .repl_history
21
+ build/
22
+ *.bridgesupport
23
+ build-iPhoneOS/
24
+ build-iPhoneSimulator/
25
+
26
+ ## Specific to RubyMotion (use of CocoaPods):
27
+ #
28
+ # We recommend against adding the Pods directory to your .gitignore. However
29
+ # you should judge for yourself, the pros and cons are mentioned at:
30
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
31
+ #
32
+ # vendor/Pods/
33
+
34
+ ## Documentation cache and generated files:
35
+ /.yardoc/
36
+ /_yardoc/
37
+ /doc/
38
+ /rdoc/
39
+
40
+ ## Environment normalization:
41
+ /.bundle/
42
+ /vendor/bundle
43
+ /lib/bundler/man/
44
+
45
+ # for a library or gem, you might want to ignore these files since the code is
46
+ # intended to run in multiple environments; otherwise, check them in:
47
+ # Gemfile.lock
48
+ # .ruby-version
49
+ # .ruby-gemset
50
+
51
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
52
+ .rvmrc
53
+
54
+ /.idea/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in kontent-jekyll.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,133 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ kontent-jekyll (0.11.0)
5
+ kontent-delivery-sdk-ruby (~> 2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ capybara (3.29.0)
13
+ addressable
14
+ mini_mime (>= 0.1.3)
15
+ nokogiri (~> 1.8)
16
+ rack (>= 1.6.0)
17
+ rack-test (>= 0.6.3)
18
+ regexp_parser (~> 1.5)
19
+ xpath (~> 3.2)
20
+ colorator (1.1.0)
21
+ concurrent-ruby (1.1.5)
22
+ diff-lcs (1.3)
23
+ domain_name (0.5.20190701)
24
+ unf (>= 0.0.5, < 1.0.0)
25
+ dotenv (2.7.5)
26
+ em-websocket (0.5.1)
27
+ eventmachine (>= 0.12.9)
28
+ http_parser.rb (~> 0.6.0)
29
+ eventmachine (1.2.7-x64-mingw32)
30
+ ffi (1.11.3-x64-mingw32)
31
+ forwardable-extended (2.6.0)
32
+ http-accept (1.7.0)
33
+ http-cookie (1.0.3)
34
+ domain_name (~> 0.5)
35
+ http_parser.rb (0.6.0)
36
+ i18n (0.9.5)
37
+ concurrent-ruby (~> 1.0)
38
+ jekyll (3.8.6)
39
+ addressable (~> 2.4)
40
+ colorator (~> 1.0)
41
+ em-websocket (~> 0.5)
42
+ i18n (~> 0.7)
43
+ jekyll-sass-converter (~> 1.0)
44
+ jekyll-watch (~> 2.0)
45
+ kramdown (~> 1.14)
46
+ liquid (~> 4.0)
47
+ mercenary (~> 0.3.3)
48
+ pathutil (~> 0.9)
49
+ rouge (>= 1.7, < 4)
50
+ safe_yaml (~> 1.0)
51
+ jekyll-sass-converter (1.5.2)
52
+ sass (~> 3.4)
53
+ jekyll-watch (2.2.1)
54
+ listen (~> 3.0)
55
+ kontent-delivery-sdk-ruby (2.0.12)
56
+ dotenv (~> 2.7.0)
57
+ nokogiri (~> 1.10.0, >= 1.8.4)
58
+ rest-client (~> 2.1.0.rc1, >= 2.1.0.rc1)
59
+ kramdown (1.17.0)
60
+ liquid (4.0.3)
61
+ listen (3.2.1)
62
+ rb-fsevent (~> 0.10, >= 0.10.3)
63
+ rb-inotify (~> 0.9, >= 0.9.10)
64
+ mercenary (0.3.6)
65
+ mime-types (3.3)
66
+ mime-types-data (~> 3.2015)
67
+ mime-types-data (3.2019.1009)
68
+ mini_mime (1.0.2)
69
+ mini_portile2 (2.4.0)
70
+ netrc (0.11.0)
71
+ nokogiri (1.10.7-x64-mingw32)
72
+ mini_portile2 (~> 2.4.0)
73
+ pathutil (0.16.2)
74
+ forwardable-extended (~> 2.6)
75
+ public_suffix (4.0.1)
76
+ rack (1.6.11)
77
+ rack-jekyll (0.5.0)
78
+ jekyll (>= 1.3)
79
+ listen (>= 1.3)
80
+ rack (~> 1.5)
81
+ rack-test (1.1.0)
82
+ rack (>= 1.0, < 3)
83
+ rake (10.5.0)
84
+ rb-fsevent (0.10.3)
85
+ rb-inotify (0.10.0)
86
+ ffi (~> 1.0)
87
+ regexp_parser (1.6.0)
88
+ rest-client (2.1.0-x64-mingw32)
89
+ ffi (~> 1.9)
90
+ http-accept (>= 1.7.0, < 2.0)
91
+ http-cookie (>= 1.0.2, < 2.0)
92
+ mime-types (>= 1.16, < 4.0)
93
+ netrc (~> 0.8)
94
+ rouge (3.13.0)
95
+ rspec (3.9.0)
96
+ rspec-core (~> 3.9.0)
97
+ rspec-expectations (~> 3.9.0)
98
+ rspec-mocks (~> 3.9.0)
99
+ rspec-core (3.9.0)
100
+ rspec-support (~> 3.9.0)
101
+ rspec-expectations (3.9.0)
102
+ diff-lcs (>= 1.2.0, < 2.0)
103
+ rspec-support (~> 3.9.0)
104
+ rspec-mocks (3.9.0)
105
+ diff-lcs (>= 1.2.0, < 2.0)
106
+ rspec-support (~> 3.9.0)
107
+ rspec-support (3.9.0)
108
+ safe_yaml (1.0.5)
109
+ sass (3.7.4)
110
+ sass-listen (~> 4.0.0)
111
+ sass-listen (4.0.0)
112
+ rb-fsevent (~> 0.9, >= 0.9.4)
113
+ rb-inotify (~> 0.9, >= 0.9.7)
114
+ unf (0.1.4)
115
+ unf_ext
116
+ unf_ext (0.0.7.6)
117
+ xpath (3.2.0)
118
+ nokogiri (~> 1.8)
119
+
120
+ PLATFORMS
121
+ x64-mingw32
122
+
123
+ DEPENDENCIES
124
+ bundler (~> 2.0)
125
+ capybara (= 3.29.0)
126
+ jekyll (= 3.8.6)
127
+ kontent-jekyll!
128
+ rack-jekyll (= 0.5)
129
+ rake (~> 10.0)
130
+ rspec (~> 3.0)
131
+
132
+ BUNDLED WITH
133
+ 2.0.1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Radoslav Karlík
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Jekyll Kentico
2
+
3
+ Jekyll Kentico is utilizing Kentico Kontent, headless CMS, as a content repository and integrates it with Jekyll static site generator. You can generate posts, pages, collections and data items.
4
+
5
+ ## Examples
6
+
7
+ For a working example see [this project](https://github.com/RadoslavK/kontent-jekyll-blog).
8
+
9
+ ## Installation
10
+
11
+ Add this to your gem's Jekyll plugins:
12
+
13
+ ```ruby
14
+ source 'https://rubygems.org'
15
+
16
+ group :jekyll_plugins do
17
+ gem 'kontent-jekyll'
18
+ end
19
+ ```
20
+
21
+ And then execute `bundle install`
22
+
23
+ ## Usage
24
+
25
+ Run `bundle exec jekyll build` as you would normally build your Jekyll site.
26
+ You can also run `bundle exec jekyll serve` to run the built site.
27
+
28
+ ## Configuration
29
+
30
+ To configure the extension, add the following configuration block to Jekyll's `_config.yml`:
31
+
32
+ For full configuration [see wiki](https://github.com/RadoslavK/kontent-jekyll/wiki).
33
+
34
+ ```yaml
35
+ plugins:
36
+ - kontent-jekyll
37
+ kentico:
38
+ project_id: 2dd742d6-107b-48b0-8335-6674c76c9b93
39
+ posts:
40
+ type: blog_post
41
+ ```
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "kontent-jekyll"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,73 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'kontent-jekyll/version'
5
+ require 'kontent-jekyll/gem_name'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = Kentico::Kontent::GEM_NAME
9
+ spec.version = Kentico::Kontent::VERSION
10
+ spec.licenses = ['MIT']
11
+ spec.authors = ['RadoslavK']
12
+ spec.email = ['RadoslavK@kentico.com']
13
+
14
+ spec.summary = 'Kentico Kontent plugin for Jekyll'
15
+ spec.description = 'Kontent Jekyll is utilizing Kentico Kontent, headless CMS, as a content repository and integrates it with Jekyll static site generator. You can generate posts, pages, collections and data items.'
16
+ spec.homepage = 'https://github.com/RadoslavK/kontent-jekyll'
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+ spec.bindir = 'exe'
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ['lib']
26
+
27
+ spec.required_ruby_version = '>= 2.6.3'
28
+
29
+ spec.add_development_dependency 'bundler', '~> 2.0'
30
+ spec.add_development_dependency 'rake', '~> 10.0'
31
+ spec.add_development_dependency 'rspec', '~> 3.0'
32
+ spec.add_development_dependency 'rack-jekyll', '0.5'
33
+ spec.add_development_dependency 'capybara', '3.29.0'
34
+ spec.add_development_dependency 'jekyll', '3.8.6'
35
+
36
+ spec.add_runtime_dependency 'kontent-delivery-sdk-ruby', '~> 2.0'
37
+ end
38
+
39
+ # Local gem dependency when developing locally
40
+ #embedded_gemspec = Gem::Specification::load('C:\kontent-delivery-sdk-ruby\kontent-delivery-sdk-ruby.gemspec')
41
+ #
42
+ #Gem::Specification.new do |spec|
43
+ # spec.name = Kentico::Kontent::GEM_NAME
44
+ # spec.version = Kentico::Kontent::VERSION
45
+ # spec.licenses = ['MIT']
46
+ # spec.authors = ['RadoslavK']
47
+ # spec.email = ['RadoslavK@kentico.com']
48
+ #
49
+ # spec.summary = 'Kentico Kontent plugin for Jekyll'
50
+ # spec.description = 'Jekyll Kentico is utilizing Kentico Kontent, headless CMS, as a content repository and integrates it with Jekyll static site generator. You can generate posts, pages, collections and data items.'
51
+ # spec.homepage = 'https://github.com/RadoslavK/kentico-jekyll'
52
+ #
53
+ # # Specify which files should be added to the gem when it is released.
54
+ # # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
55
+ # spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
56
+ # `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
57
+ # end
58
+ # spec.files += embedded_gemspec.files
59
+ # spec.bindir = 'exe'
60
+ # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
61
+ # spec.require_paths = ['lib']
62
+ #
63
+ # spec.required_ruby_version = '>= 2.6.3'
64
+ #
65
+ # spec.add_development_dependency 'bundler', '~> 2.0'
66
+ # spec.add_development_dependency 'rake', '~> 10.0'
67
+ # spec.add_development_dependency 'rspec', '~> 3.0'
68
+ # spec.add_development_dependency 'rack-jekyll', '0.5'
69
+ # spec.add_development_dependency 'capybara', '3.29.0'
70
+ # spec.add_development_dependency 'jekyll', '3.8.6'
71
+ #
72
+ # embedded_gemspec.runtime_dependencies.each { |d| spec.add_dependency d }
73
+ #end
@@ -0,0 +1,15 @@
1
+ require 'kontent-jekyll/version'
2
+ require 'kontent-jekyll/generator'
3
+
4
+ require File.dirname(__FILE__) + '/kontent-jekyll/resolvers/front_matter_resolver'
5
+ require File.dirname(__FILE__) + '/kontent-jekyll/resolvers/content_resolver'
6
+ require File.dirname(__FILE__) + '/kontent-jekyll/resolvers/data_resolver'
7
+ require File.dirname(__FILE__) + '/kontent-jekyll/resolvers/filename_resolver'
8
+
9
+ require File.dirname(__FILE__) + '/kontent-jekyll/resolvers/content_link_resolver'
10
+ require File.dirname(__FILE__) + '/kontent-jekyll/resolvers/inline_content_item_resolver'
11
+
12
+ require File.dirname(__FILE__) + '/kontent-jekyll/constants/item_element_type'
13
+ require File.dirname(__FILE__) + '/kontent-jekyll/constants/page_type'
14
+
15
+ require File.dirname(__FILE__) + '/kontent-jekyll/utils/normalize_object'
@@ -0,0 +1,17 @@
1
+ module Kentico
2
+ module Kontent
3
+ module Constants
4
+ module ItemElementType
5
+ ASSET = 'asset'
6
+ DATE_TIME = 'date_time'
7
+ LINKED_ITEMS = 'modular_content'
8
+ MULTIPLE_CHOICE = 'multiple_choice'
9
+ NUMBER = 'number'
10
+ RICH_TEXT = 'rich_text'
11
+ TAXONOMY = 'taxonomy'
12
+ TEXT = 'text'
13
+ URL_SLUG = 'url_slug'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ module Kentico
2
+ module Kontent
3
+ module Constants
4
+ module KenticoConfigKeys
5
+ PROJECT_ID = 'project_id'
6
+ SECURE_KEY = 'secure_key'
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module Kentico
2
+ module Kontent
3
+ module Constants
4
+ ##
5
+ # Options provided to a front matter resolver's resolve method.
6
+ # They determine type of the page that will have the front matter injected.
7
+
8
+ module PageType
9
+ PAGE = 'page'
10
+ POST = 'post'
11
+ end
12
+ end
13
+ end
14
+ end