disqus-for-jekyll 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3bee6304049b17e5d1c991bd1c1ad4c123120b930870cdf09c42e733b9f99f17
4
+ data.tar.gz: 50bb0d1002ee867f074c0265f89f9a7db6ca051b159a40c4673d4fecf070d6da
5
+ SHA512:
6
+ metadata.gz: 8adddc3bb264b11a2e197998ec59b6679cc7c27bea0d52a8753a2ff6ec0565215ea1ad62d433b135648ef154542a5c13251889861d90bd81f070632e7d44f731
7
+ data.tar.gz: 90a50df463d3498e8dcdcc24f8ea5862910f917324f43c3cdbfadf6d2c1516d544795653d1c45b6920fefd7bf32abb90e99caca6103967d8d067904eeb29d885
@@ -0,0 +1,11 @@
1
+ .idea/
2
+ *.gem
3
+ /.bundle/
4
+ /.yardoc
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+
@@ -0,0 +1,19 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.2
5
+ before_install: gem install bundler -v 1.16.0
6
+ script:
7
+ # license_finder
8
+ - license_finder whitelist add MIT
9
+ - license_finder
10
+
11
+ # bundle-audit
12
+ - bundle-audit
13
+
14
+ # rake
15
+ - rake
16
+
17
+
18
+ notfications:
19
+ email: false
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ gemspec
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ disqus-for-jekyll (1.0.0)
5
+ jekyll (~> 3.3)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.5.2)
11
+ public_suffix (>= 2.0.2, < 4.0)
12
+ bundler-audit (0.6.0)
13
+ bundler (~> 1.2)
14
+ thor (~> 0.18)
15
+ colorator (1.1.0)
16
+ ffi (1.9.18-x64-mingw32)
17
+ forwardable-extended (2.6.0)
18
+ httparty (0.15.6)
19
+ multi_xml (>= 0.5.2)
20
+ jekyll (3.6.2)
21
+ addressable (~> 2.4)
22
+ colorator (~> 1.0)
23
+ jekyll-sass-converter (~> 1.0)
24
+ jekyll-watch (~> 1.1)
25
+ kramdown (~> 1.14)
26
+ liquid (~> 4.0)
27
+ mercenary (~> 0.3.3)
28
+ pathutil (~> 0.9)
29
+ rouge (>= 1.7, < 3)
30
+ safe_yaml (~> 1.0)
31
+ jekyll-sass-converter (1.5.0)
32
+ sass (~> 3.4)
33
+ jekyll-watch (1.5.0)
34
+ listen (~> 3.0, < 3.1)
35
+ kramdown (1.15.0)
36
+ license_finder (3.0.4)
37
+ bundler
38
+ httparty
39
+ rubyzip
40
+ thor
41
+ with_env (> 1.0)
42
+ xml-simple
43
+ liquid (4.0.0)
44
+ listen (3.0.8)
45
+ rb-fsevent (~> 0.9, >= 0.9.4)
46
+ rb-inotify (~> 0.9, >= 0.9.7)
47
+ mercenary (0.3.6)
48
+ minitest (5.10.3)
49
+ multi_xml (0.6.0)
50
+ pathutil (0.16.0)
51
+ forwardable-extended (~> 2.6)
52
+ public_suffix (3.0.1)
53
+ rake (10.5.0)
54
+ rb-fsevent (0.10.2)
55
+ rb-inotify (0.9.10)
56
+ ffi (>= 0.5.0, < 2)
57
+ rouge (2.2.1)
58
+ rubyzip (1.2.1)
59
+ safe_yaml (1.0.4)
60
+ sass (3.5.3)
61
+ sass-listen (~> 4.0.0)
62
+ sass-listen (4.0.0)
63
+ rb-fsevent (~> 0.9, >= 0.9.4)
64
+ rb-inotify (~> 0.9, >= 0.9.7)
65
+ thor (0.20.0)
66
+ with_env (1.1.0)
67
+ xml-simple (1.1.5)
68
+
69
+ PLATFORMS
70
+ x64-mingw32
71
+
72
+ DEPENDENCIES
73
+ bundler (~> 1.16)
74
+ bundler-audit (~> 0.6.0)
75
+ disqus-for-jekyll!
76
+ license_finder (~> 3.0.4)
77
+ minitest (~> 5.0)
78
+ rake (~> 10.0)
79
+
80
+ BUNDLED WITH
81
+ 1.16.0
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017-present Kacper Duras
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # disqus-for-jekyll [![Build Status](https://travis-ci.org/kacperduras/disqus-for-jekyll.svg?branch=master)](https://travis-ci.org/kacperduras/disqus-for-jekyll)
2
+ A Jekyll plugin to view the comments powered by Disqus.
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+ ```
8
+ $ gem 'disqus-for-jekyll'
9
+ ```
10
+
11
+ And then execute:
12
+ ```
13
+ $ bundle
14
+ ```
15
+
16
+ Or install it yourself as:
17
+ ```
18
+ $ gem install disqus-for-jekyll
19
+ ```
20
+
21
+ Then add the following to your site's `_config.yml`
22
+ ```yaml
23
+ plugins:
24
+ - disqus-for-jekyll
25
+ ```
26
+
27
+ ## Configuration
28
+ ```yaml
29
+ disqus:
30
+ name: kacperduras # required
31
+ noscript: "Your noscript tag message." # optional
32
+ ```
33
+
34
+ ## Usage
35
+ Use the tag as follows in your Jekyll pages, posts and collections:
36
+ ```
37
+ {% disqus %}
38
+ ```
39
+
40
+ ## License
41
+ [MIT](LICENSE)
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task default: :test
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'jekyll/disqus'
5
+
6
+ require 'irb'
7
+ IRB.start(__FILE__)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
@@ -0,0 +1,39 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = 'disqus-for-jekyll'
6
+ spec.version = '1.0.0'
7
+ spec.authors = ['Kacper Duras']
8
+ spec.email = ['git@kacperduras.pl']
9
+
10
+ spec.summary = 'A Jekyll plugin to view the comments powered by Disqus.'
11
+ spec.homepage = 'https://github.com/kacperduras/disqus-for-jekyll'
12
+ spec.license = 'MIT'
13
+
14
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
15
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
16
+ if spec.respond_to?(:metadata)
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
+ else
19
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
20
+ 'public gem pushes.'
21
+ end
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
+ f.match(%r{^(test|spec|features)/})
25
+ end
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+
30
+ spec.add_dependency 'jekyll', '~> 3.3'
31
+
32
+ spec.add_development_dependency 'bundler', '~> 1.16'
33
+ spec.add_development_dependency 'bundler-audit', '~> 0.6.0'
34
+
35
+ spec.add_development_dependency 'license_finder', '~> 3.0'
36
+
37
+ spec.add_development_dependency 'rake', '~> 10.0'
38
+ spec.add_development_dependency 'minitest', '~> 5.0'
39
+ end
@@ -0,0 +1,30 @@
1
+ require 'jekyll'
2
+ require 'liquid'
3
+
4
+ module Jekyll
5
+
6
+ class DisqusTag < Liquid::Tag
7
+
8
+ def initialize(tag_name, txt, tokens)
9
+ super
10
+ end
11
+
12
+ def render(context)
13
+ template.render!(context)
14
+ end
15
+
16
+ private
17
+
18
+ def template
19
+ @template ||= Liquid::Template.parse(template_content)
20
+ end
21
+
22
+ def template_content
23
+ File.read(File.expand_path('./template.html', File.dirname(__FILE__)))
24
+ end
25
+
26
+ end
27
+
28
+ end
29
+
30
+ Liquid::Template.register_tag("disqus", Jekyll::DisqusTag)
@@ -0,0 +1,25 @@
1
+ {% if site.disqus.name %}
2
+
3
+ <div id="disqus_thread"></div>
4
+ <script>
5
+ var disqus_name = "{{ site.disqus.name }}";
6
+
7
+ (function() {
8
+ var dsq = document.createElement('script');
9
+ dsq.type = 'text/javascript';
10
+ dsq.async = true;
11
+
12
+ dsq.src = '//' + disqus_name + '.disqus.com/embed.js';
13
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
14
+ })();
15
+ </script>
16
+
17
+ {% if site.disqus.noscript %}
18
+ <noscript>{{ site.disqus.noscript }}</noscript>
19
+ {% else %}
20
+ <noscript>Please, enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus</a>.</noscript>
21
+ {% endif %}
22
+
23
+ {% else %}
24
+ <p>Please, type your Disqus shortname to view the <a href="https://disqus.com/" rel="nofollow">comments powered by Disqus</a>.</p>
25
+ {% endif %}
metadata ADDED
@@ -0,0 +1,141 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: disqus-for-jekyll
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Kacper Duras
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-12-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.16'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler-audit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.6.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: license_finder
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '5.0'
97
+ description:
98
+ email:
99
+ - git@kacperduras.pl
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".travis.yml"
106
+ - Gemfile
107
+ - Gemfile.lock
108
+ - LICENSE
109
+ - README.md
110
+ - Rakefile
111
+ - bin/console
112
+ - bin/setup
113
+ - disqus-for-jekyll.gemspec
114
+ - lib/disqus-for-jekyll.rb
115
+ - lib/template.html
116
+ homepage: https://github.com/kacperduras/disqus-for-jekyll
117
+ licenses:
118
+ - MIT
119
+ metadata:
120
+ allowed_push_host: https://rubygems.org
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 2.7.3
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: A Jekyll plugin to view the comments powered by Disqus.
141
+ test_files: []