kontent-jekyll 0.11.2 → 0.12.0

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: 223fb2ce1eee60fc1038e8040676d944185960dadbbf723954f3a2abb341f281
4
- data.tar.gz: 55dfa5c312f2fd48471a66c9388a91be743f1060c80a1a2dcf4904ce2d60ce2d
3
+ metadata.gz: 2348ee20002939b60bfaa7c4bd6ce7da395747ee6024e2ad9249816d787ee26a
4
+ data.tar.gz: aeca8c81e53d30e0c9d6c881a6f5e1b25e29a711443d0f8d7fdb639c422ffdc9
5
5
  SHA512:
6
- metadata.gz: f261c178131eaf68a018f147d3ac2d1db2a2369b4c860666b426565856348fd169b24478f891978dc87cd929e3c1acce1317378548add7945807749423cdac3f
7
- data.tar.gz: 811bf655837934e04d6ebcca18be5333891a3d99f2404429b41a3dfb4e152f8b81b0a2dd413ecf090a2f660db0fdd5d5730c24ccfe2fd717e55814a70d3fb735
6
+ metadata.gz: 1239aa5f4408d69fe650ff6251410558be3409adcef832513f7f6617e5f73a9a1c924aebe27909ed9082a69ccc3266f258e451d08ccbdff37425b6e2d21fbab8
7
+ data.tar.gz: 80b22d1d6955a0af7c999cd6c9e3244f39810ac25bdea0918d2cc3f0134545f05d3a075900f8218e137d4966e60b92a3511a807e009113a0d58f50919e07d7a0
@@ -0,0 +1,4 @@
1
+ # Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
2
+ # See https://help.github.com/articles/about-code-owners/
3
+
4
+ * @RadoslavK
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+
5
+ ---
6
+
7
+ ### Brief bug description
8
+
9
+ What went wrong?
10
+
11
+ ### Repro steps
12
+
13
+ 1. Go to '...'
14
+ 2. Click on '....'
15
+ 3. Scroll down to '....'
16
+ 4. See error
17
+
18
+ ### Expected behavior
19
+
20
+ What the correct behavior is?
21
+
22
+ ### Test environment
23
+
24
+ - Platform/OS: [e.g. .NET Core 2.1, iOS]
25
+ - Browser [e.g. chrome, safari]
26
+ - Version [e.g. 22]
27
+
28
+ ### Additional context
29
+
30
+ Add any other context about the problem here.
31
+
32
+ ### Screenshots
33
+
34
+ Add links to screenshots, if possible.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+
5
+ ---
6
+
7
+ ### Motivation
8
+
9
+ Why is this feature required? What problems does it solve?
10
+
11
+ ### Proposed solution
12
+
13
+ An ideal solution for the above problems.
14
+
15
+ ### Additional context
16
+
17
+ Add any other context, screenshots, or reference links about the feature request here.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: Question
3
+ about: Ask a question
4
+
5
+ ---
6
+
7
+ ### Question
8
+
9
+ What do you want to ask?
10
+
11
+ ### Reference
12
+
13
+ * URL
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Spike
3
+ about: Suggest an analysis of a problem
4
+
5
+ ---
6
+
7
+ ### Expected result
8
+
9
+ What do we want to explore and why? Which questions do we want to answer with this spike?
10
+
11
+ ### Additional context
12
+
13
+ Add any other context or guidelines here.
14
+
15
+ ### Resources
16
+
17
+ * URL
@@ -0,0 +1,17 @@
1
+ ### Motivation
2
+
3
+ Which issue does this fix? Fixes #`issue number`
4
+
5
+ If no issue exists, what is the fix or new feature? Were there any reasons to fix/implement things that are not obvious?
6
+
7
+ ### Checklist
8
+
9
+ - [ ] Code follows coding conventions held in this repo
10
+ - [ ] Automated tests have been added
11
+ - [ ] Tests are passing
12
+ - [ ] Docs have been updated (if applicable)
13
+ - [ ] Temporary settings (e.g. variables used during development and testing) have been reverted to defaults
14
+
15
+ ### How to test
16
+
17
+ If manual testing is required, what are the steps?
@@ -0,0 +1,48 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at DevelopersCommunity@kentico.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: https://contributor-covenant.org
46
+ [version]: https://contributor-covenant.org/version/1/4/
47
+
48
+ ![Analytics](https://kentico-ga-beacon.azurewebsites.net/api/UA-69014260-4/Kentico/Home/master/CODE_OF_CONDUCT.md?pixel)
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,72 @@
1
+ # Ways to contribute
2
+ <img align="right" width="100" height="100" src="https://i.imgur.com/PYTV0jP.png">
3
+
4
+ There are many different ways in which you can contribute. One of the easiest ways is simply to use our software and provide us with your feedback through the right channel. You can also help us improve the open-source projects by submitting pull requests with code and documentation changes.
5
+
6
+ ## Where to get support
7
+ Please note that **level of provided support is always determined by the [LICENSE](LICENSE.md)** of a given open-source project. Also, always make sure you use the **[latest version](../../releases)** of any given OS project. We can't provide any help for older versions. We don't want to make things complicated so we try to take the same approach in all our repositories.
8
+
9
+ ### I found a bug in a Kentico's open-source project
10
+ <img align="right" width="100" height="100" src="https://i.imgur.com/TYIQdpv.png">
11
+
12
+ Sorry to hear that. Just log a new [GitHub issue](../../issues) and someone will take a look at it. Remember, the more information you provide, the easier it will be to fix the issue. If you feel like it, you can also fix the bug on your own and submit a new pull request.
13
+
14
+ ### I need help with using the projects and/or coding
15
+ <img align="right" width="100" height="100" src="https://cdn.sstatic.net/Sites/stackoverflow/company/img/logos/so/so-icon.svg">
16
+
17
+ To get help with coding and structuring your projects, use [StackOverflow](https://stackoverflow.com/) to ask questions with one of the following tags:
18
+ - [`kentico-kontent`](https://stackoverflow.com/questions/tagged/kentico-kontent)
19
+ - [`kentico`](https://stackoverflow.com/questions/tagged/kentico)
20
+
21
+ Our team members and the community monitor these channels on a regular basis.
22
+
23
+ ### I want to report a security bug
24
+ <img align="right" width="100" height="100" src="https://i.imgur.com/z82nnJB.png">
25
+
26
+ Security issues and bugs should be reported privately, via email, to the Kentico Developer Community Team developerscommunity@kentico.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
27
+
28
+
29
+ ### I have an idea for a new feature (or feedback on existing functionality)
30
+ <img align="right" width="100" height="100" src="https://i.imgur.com/rUFkyPy.png">
31
+
32
+ Everybody loves new features! You can submit a new [feature request](../../issues) or you can code it on your own and [send us a pull request](#submitting-pull-requests). In either case, don't forget to mention what's the use case and what's the expected output.
33
+
34
+
35
+ ## Submitting pull requests
36
+ <img align="right" width="100" height="100" src="https://i.imgur.com/aSeiliy.png">
37
+
38
+ Unless you're fixing a typo, it's usually a good idea to discuss the feature before you submit a pull request with code changes, so let's start with submitting a new [GitHub issue](../../issues) and discussing the whether it fits the vision of a given project.
39
+ You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](https://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. Note that all code submissions will be rigorously reviewed and tested by the Kentico Maintainers teams, and only those that meet an high bar for both quality and design/roadmap appropriateness will be merged into the source.
40
+
41
+
42
+ ### Example - process of contribution
43
+ If not stated otherwise, we use [feature branch workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow).
44
+
45
+ To start with coding, fork the repository you want to contribute to, create a new branch, and start coding. Once the functionality is [done](#Definition-of-Done), you can submit a [pull request](https://help.github.com/articles/about-pull-requests/).
46
+
47
+ ### Definition of Done
48
+ <img align="right" width="100" height="100" src="https://i.imgur.com/g82Ohdv.png">
49
+
50
+ - New/fixed code is covered with tests
51
+ - CI can build the code
52
+ - All tests are pass
53
+ - New version number follows [semantic versioning](https://semver.org/)
54
+ - Coding style (spaces, indentation) is in line with the rest of the code in a given repository
55
+ - Documentation is updated (e.g. code examples in README, Wiki pages, etc.)
56
+ - All `public` members are documented (using XML doc, phpdoc, etc.)
57
+ - Code doesn't contain any secrets (private keys, etc.)
58
+ - Commit messages are clear. Please read these articles: [Writing good commit messages](https://github.com/erlang/otp/wiki/Writing-good-commit-messages), [A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), [On commit messages](https://who-t.blogspot.com/2009/12/on-commit-messages.html)
59
+
60
+
61
+ ### Feedback
62
+ <img align="right" width="100" height="100" src="https://i.imgur.com/ZQfNzJJ.png">
63
+
64
+ Your pull request will now go through extensive checks by the subject matter experts on our team. Please be patient. Update your pull request according to feedback until it is approved by one of the Kentico maintainers. After that, one of our team members may adjust the branch you merge into based on the expected release schedule.
65
+
66
+
67
+ ## Code of Conduct
68
+ <img align="right" width="100" height="100" src="https://i.imgur.com/cObdKQy.png">
69
+
70
+ The Kentico team is committed to fostering a welcoming community, therefore this project has adopted the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). If you have any additional questions or comments, you can contact us directly at developerscommunity@kentico.com.
71
+
72
+ ![Analytics](https://kentico-ga-beacon.azurewebsites.net/api/UA-69014260-4/Kentico/Home/master/CONTRIBUTING.md?pixel)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kontent-jekyll (0.11.2)
4
+ kontent-jekyll (0.12.0)
5
5
  kontent-delivery-sdk-ruby (~> 2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ [![Build Status](https://api.travis-ci.com/RadoslavK/kontent-jekyll.svg?branch=master)](https://travis-ci.com/RadoslavK/kontent-jekyll)
2
+ [![Join the chat at https://kentico-community.slack.com](https://img.shields.io/badge/join-slack-E6186D.svg)](https://kentico-community.slack.com)
3
+ [![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-ASK%20NOW-FE7A16.svg?logo=stackoverflow&logoColor=white)](https://stackoverflow.com/tags/kentico-kontent)
4
+ [![Version](https://img.shields.io/gem/v/kontent-jekyll.svg?style=flat)](https://rubygems.org/gems/kontent-jekyll)
5
+
1
6
  # Jekyll Kentico
2
7
 
3
8
  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.
@@ -39,3 +44,17 @@ kentico:
39
44
  posts:
40
45
  type: blog_post
41
46
  ```
47
+
48
+ ## Feedback & Contributing
49
+
50
+ Check out the [contributing](https://github.com/RadoslavK/kontent-jekyll/blob/master/CONTRIBUTING.md) page to see the best places to file issues, start discussions, and begin contributing.
51
+
52
+ ## License
53
+
54
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
55
+
56
+ ## Code of Conduct
57
+
58
+ Everyone interacting in the Kontent-Jekyll project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/RadoslavK/kontent-jekyll/blob/master/CODE_OF_CONDUCT.md).
59
+
60
+ ![Analytics](https://kentico-ga-beacon.azurewebsites.net/api/UA-69014260-4/RadoslavK/kontent-jekyll?pixel)
@@ -11,6 +11,7 @@ module Kentico
11
11
 
12
12
  class ContentGenerator < Jekyll::Generator
13
13
  include SiteProcessing
14
+
14
15
  DEFAULT_LANGUAGE = nil
15
16
 
16
17
  safe true
@@ -0,0 +1,35 @@
1
+ module Kentico
2
+ module Kontent
3
+ module Models
4
+ ##
5
+ # Custom page that mimics the behavior of a regular Jekyll::Page
6
+ # without trying to locate the file on the filesystem.
7
+
8
+ class KenticoPage < Jekyll::Page
9
+ def initialize(site, page_info)
10
+ @site = site
11
+ @base = site.source
12
+ @dir = page_info.collection && "_#{page_info.collection}" || ''
13
+ @name = page_info.filename
14
+ @path = if site.in_theme_dir(@base) == @base
15
+ site.in_theme_dir(@base, @dir, @name)
16
+ else
17
+ site.in_source_dir(@base, @dir, @name)
18
+ end
19
+
20
+ self.process(@name)
21
+
22
+ self.data = page_info.front_matter
23
+ self.content = page_info.content
24
+
25
+ data.default_proc = proc do |_, key|
26
+ site.frontmatter_defaults.find(File.join(@dir, @name), type, key)
27
+ end
28
+
29
+ ::Jekyll::Hooks.trigger :pages, :post_init, self
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+
@@ -2,6 +2,8 @@ require 'date'
2
2
 
3
3
  require 'kontent-jekyll/constants/page_type'
4
4
 
5
+ require 'kontent-jekyll/models/kentico_page'
6
+
5
7
  require 'kontent-jekyll/resolvers/front_matter_resolver'
6
8
  require 'kontent-jekyll/resolvers/content_resolver'
7
9
  require 'kontent-jekyll/resolvers/data_resolver'
@@ -19,6 +21,7 @@ module Kentico
19
21
  include Constants
20
22
  include Resolvers
21
23
  include Utils
24
+ include Models
22
25
 
23
26
  ##
24
27
  # These collections have specific purposes in the original Jekyll generation will be omitted.
@@ -59,7 +62,7 @@ module Kentico
59
62
  are_pages_from_collection = collection_name && !collection_name.empty? && !RESERVED_COLLECTIONS.include?(collection_name)
60
63
 
61
64
  unless are_pages_from_collection
62
- @site.pages += pages_data.map { |page_data| create_kentico_page(@site, page_data) }
65
+ @site.pages += pages_data.map { |page_data| KenticoPage.new(@site, page_data) }
63
66
  next
64
67
  end
65
68
 
@@ -179,45 +182,6 @@ module Kentico
179
182
 
180
183
  private
181
184
 
182
- ##
183
- # Creates a Jekyll::Page.
184
-
185
- def create_kentico_page(site, page_info)
186
- page = Jekyll::Page.allocate
187
-
188
- ## A hack to create a Jekyll::Page with custom constructor without overriding the class
189
- # because jekyll-redirect-from can work only with Jekyll::Page instances.
190
- # Once this PR https://github.com/jekyll/jekyll-redirect-from/pull/204 is merged and released
191
- # we can create a subclass of the Page and simplify the code.
192
-
193
- page.define_singleton_method(:initialize) do
194
- @site = site
195
- @base = site.source
196
- @dir = ''
197
- @name = page_info.filename
198
- @path = if site.in_theme_dir(@base) == @base
199
- site.in_theme_dir(@base, @dir, @name)
200
- else
201
- site.in_source_dir(@base, @dir, @name)
202
- end
203
-
204
- self.process(@name)
205
-
206
- self.data = page_info.front_matter
207
- self.content = page_info.content
208
-
209
- data.default_proc = proc do |_, key|
210
- site.frontmatter_defaults.find(File.join(@dir, @name), type, key)
211
- end
212
-
213
- Jekyll::Hooks.trigger :pages, :post_init, self
214
-
215
- self
216
- end
217
-
218
- page.initialize
219
- end
220
-
221
185
  ##
222
186
  # Creates a Jekyll::Document. Used for collections.
223
187
 
@@ -1,5 +1,5 @@
1
1
  module Kentico
2
2
  module Kontent
3
- VERSION = '0.11.2'
3
+ VERSION = '0.12.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontent-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RadoslavK
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-10 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,9 +117,17 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
+ - ".github/CODEOWNERS"
121
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
122
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
123
+ - ".github/ISSUE_TEMPLATE/question.md"
124
+ - ".github/ISSUE_TEMPLATE/spike.md"
125
+ - ".github/PULL_REQUEST_TEMPLATE.md"
120
126
  - ".gitignore"
121
127
  - ".rspec"
122
128
  - ".travis.yml"
129
+ - CODE_OF_CONDUCT.md
130
+ - CONTRIBUTING.md
123
131
  - Gemfile
124
132
  - Gemfile.lock
125
133
  - LICENSE
@@ -134,6 +142,7 @@ files:
134
142
  - lib/kontent-jekyll/constants/page_type.rb
135
143
  - lib/kontent-jekyll/gem_name.rb
136
144
  - lib/kontent-jekyll/generator.rb
145
+ - lib/kontent-jekyll/models/kentico_page.rb
137
146
  - lib/kontent-jekyll/resolvers/content_link_resolver.rb
138
147
  - lib/kontent-jekyll/resolvers/content_resolver.rb
139
148
  - lib/kontent-jekyll/resolvers/data_resolver.rb