liquid-disqus 1.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.
- checksums.yaml +7 -0
- data/LICENSE.md +21 -0
- data/README.md +46 -0
- data/lib/liquid-disqus.rb +5 -0
- data/lib/liquid/disqus.rb +40 -0
- data/lib/liquid/plugin_version.rb +6 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 87d61492ab2288dacc6e525213d1907c03d12fd1
|
4
|
+
data.tar.gz: af8e7a80744dbfe106584258c4515c043ca1b633
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9569809a4d8e8ba4026f657a3d4af5dcffb13d6eac8d260fcc890614c291a734acdd4cc48cb2323bd147ca6fded129094c12c4b5e354991ce5941b83d276c670
|
7
|
+
data.tar.gz: 2464438d21e3736209a267e4e24bbe4130ea79d899beb04fcc6efb8ce50234bad63d202461dd12d6e99a97268992167635d9ae31fa1272e029fe69d0f50c2a44
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Rohan Sakhale
|
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.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Liquid Disqus Tag
|
2
|
+
|
3
|
+
This plugin helps generate Disqus code snippet easily as a Liquid Tag call
|
4
|
+
|
5
|
+
### Installation
|
6
|
+
|
7
|
+
This plugin is available as a [RubyGem](https://rubygems.org/gems/liquid-disqus/)
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```
|
12
|
+
gem 'liquid-disqus'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute the `bundle install` command to install the gem.
|
16
|
+
|
17
|
+
Alternatively, you can also manually install the gem using the following command:
|
18
|
+
|
19
|
+
```
|
20
|
+
$ gem install liquid-disqus
|
21
|
+
```
|
22
|
+
|
23
|
+
For Jekyll Users, after the plugin has been installed successfully, add the following lines to your _config.yml in order to tell Jekyll to use the plugin:
|
24
|
+
|
25
|
+
```yaml
|
26
|
+
gems:
|
27
|
+
- liquid-disqus
|
28
|
+
```
|
29
|
+
|
30
|
+
### Usage
|
31
|
+
|
32
|
+
You need to use `disqus` as liquid tag and pass the Tracking Code as parameter shown below
|
33
|
+
|
34
|
+
```
|
35
|
+
{{ disqus UA-12345 }}
|
36
|
+
```
|
37
|
+
|
38
|
+
### Contribute
|
39
|
+
|
40
|
+
Fork this repository, make your changes and then issue a pull request. If you find bugs or have new ideas that you do not want to implement yourself, file a bug report.
|
41
|
+
|
42
|
+
### Copyright
|
43
|
+
|
44
|
+
Copyright (c) 2015 Rohan Sakhale
|
45
|
+
|
46
|
+
License: MIT
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
module Liquid
|
3
|
+
class Disqus < Liquid::Tag
|
4
|
+
TEMPLATE = <<-EOF
|
5
|
+
<div id="disqus_thread"></div>
|
6
|
+
<script>
|
7
|
+
|
8
|
+
/**
|
9
|
+
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
|
10
|
+
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
|
11
|
+
/*
|
12
|
+
var disqus_config = function () {
|
13
|
+
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
|
14
|
+
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
|
15
|
+
};
|
16
|
+
*/
|
17
|
+
(function() { // DON'T EDIT BELOW THIS LINE
|
18
|
+
var d = document, s = d.createElement('script');
|
19
|
+
s.src = '//%s.disqus.com/embed.js';
|
20
|
+
s.setAttribute('data-timestamp', +new Date());
|
21
|
+
(d.head || d.body).appendChild(s);
|
22
|
+
})();
|
23
|
+
</script>
|
24
|
+
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
25
|
+
EOF
|
26
|
+
|
27
|
+
def initialize(tag_name, disqus_username, tokens)
|
28
|
+
super
|
29
|
+
@disqus_username = disqus_username.to_s.strip
|
30
|
+
end
|
31
|
+
|
32
|
+
def render(context)
|
33
|
+
code = ""
|
34
|
+
if @disqus_username
|
35
|
+
code = format(TEMPLATE, @disqus_username)
|
36
|
+
end
|
37
|
+
code
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: liquid-disqus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rohan Sakhale
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-18 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.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
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.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 5.9.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 5.9.0
|
69
|
+
description: Generate Disqus Script code with simple Liquid Tag
|
70
|
+
email: rohansakhale@gmail.com
|
71
|
+
executables: []
|
72
|
+
extensions: []
|
73
|
+
extra_rdoc_files: []
|
74
|
+
files:
|
75
|
+
- LICENSE.md
|
76
|
+
- README.md
|
77
|
+
- lib/liquid-disqus.rb
|
78
|
+
- lib/liquid/disqus.rb
|
79
|
+
- lib/liquid/plugin_version.rb
|
80
|
+
homepage: https://gitlab.com/SaiAshirwadInformatia/Liquid-Disqus
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata:
|
84
|
+
allowed_push_host: https://rubygems.org
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 2.4.5
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: Generate Disqus Script code with simple Liquid Tag
|
105
|
+
test_files: []
|