jekyll_quote 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +41 -1
- data/jekyll_quote.gemspec +2 -2
- data/lib/jekyll_quote/version.rb +1 -1
- data/lib/jekyll_quote.rb +17 -10
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48d683c6d402cbef996297da7355523a5708c131fc77acd797558861e83dba61
|
4
|
+
data.tar.gz: 4f0ce53ce3c39b2161d294b311ec6ea9f740a588dcc943fce0a188fecf5e82a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 915baf97a1e221eededdaf5cbcc6c37b60f404250b58c33915c6d2f3a01f527c1566fceabb547c2ee349b9b447e9f3fade4766ae047d5afb294958c4f671df2a
|
7
|
+
data.tar.gz: 45ddb8790cc6f9c85598e13e041036a8cbdaf14621f6fade55cea544d24db83c6d98b39f56484951d418798840995a80bab351420b965da1ffa3073c642d1ec8
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,13 +18,53 @@ end
|
|
18
18
|
|
19
19
|
And then execute:
|
20
20
|
|
21
|
-
$ bundle
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
|
24
|
+
## Syntax
|
25
|
+
```
|
26
|
+
{% quote OPTIONS %}
|
27
|
+
Content of quote goes here.
|
28
|
+
{% endquote %}
|
29
|
+
```
|
30
|
+
|
31
|
+
The default preposition is 'From'.
|
32
|
+
|
33
|
+
OPTIONS are:
|
34
|
+
* `break` – Put the citation on a separate line. Ignored if `cite` was not specified.
|
35
|
+
* `by` – Preface the citation with the preposition 'By'. Ignored if `cite` was not specified.
|
36
|
+
* `cite` – Citation text
|
37
|
+
* `class` – Apply additional CSS classes
|
38
|
+
* `noprep` – Do not preface the citation with a preposition. Ignored if `cite` was not specified.
|
39
|
+
* `style` – Apply additional CSS styling
|
40
|
+
* `url` – URL for the citation. Ignored if `cite` was not specified.
|
41
|
+
|
42
|
+
|
43
|
+
## Usage Example
|
44
|
+
```
|
45
|
+
{% quote cite="Blaise Pascal, in Lettres provinciales"
|
46
|
+
url="https://en.wikipedia.org/wiki/Lettres_provinciales"
|
47
|
+
%}
|
48
|
+
I have only made this letter longer because
|
49
|
+
I have not had the time to make it shorter.
|
50
|
+
{% endquote %}
|
51
|
+
```
|
22
52
|
|
23
53
|
|
24
54
|
## Attribution
|
25
55
|
See [`jekyll_plugin_support` for `attribution`](https://github.com/mslinn/jekyll_plugin_support#subclass-attribution)
|
26
56
|
|
27
57
|
|
58
|
+
## Demo
|
59
|
+
A demo / test website is provided in the `demo` directory.
|
60
|
+
It can be used to debug the plugin or to run freely.
|
61
|
+
Please examine the HTML files in the demo to see how the plugin works.
|
62
|
+
|
63
|
+
To run the demo freely from the command line, type:
|
64
|
+
```
|
65
|
+
$ demo/_bin/debug -r
|
66
|
+
```
|
67
|
+
|
28
68
|
## Additional Information
|
29
69
|
More information is available on
|
30
70
|
[Mike Slinn’s website](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html).
|
data/jekyll_quote.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
7
7
|
spec.authors = ['Mike Slinn']
|
8
8
|
spec.email = ['mslinn@mslinn.com']
|
9
9
|
spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
|
10
|
-
spec.homepage = 'https://www.mslinn.com/
|
10
|
+
spec.homepage = 'https://www.mslinn.com/jekyll_plugins/jekyll_quote.html'
|
11
11
|
spec.license = 'MIT'
|
12
12
|
spec.metadata = {
|
13
13
|
'allowed_push_host' => 'https://rubygems.org',
|
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
29
29
|
spec.version = JekyllQuoteVersion::VERSION
|
30
30
|
|
31
31
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
32
|
-
spec.add_dependency 'jekyll_plugin_support', '
|
32
|
+
spec.add_dependency 'jekyll_plugin_support', '>= 0.7.0'
|
33
33
|
end
|
data/lib/jekyll_quote/version.rb
CHANGED
data/lib/jekyll_quote.rb
CHANGED
@@ -27,25 +27,32 @@ module Jekyll
|
|
27
27
|
@break = @helper.parameter_specified? 'break' # enforced by CSS if a list ends the body
|
28
28
|
@by = @helper.parameter_specified? 'by'
|
29
29
|
@cite = @helper.parameter_specified? 'cite'
|
30
|
+
@class = @helper.parameter_specified? 'class'
|
30
31
|
@noprep = @helper.parameter_specified? 'noprep'
|
32
|
+
@style = @helper.parameter_specified? 'style'
|
31
33
|
@url = @helper.parameter_specified? 'url'
|
32
|
-
|
33
34
|
preposition = 'From'
|
34
35
|
preposition = 'By' if @by
|
35
36
|
preposition = '' if @noprep
|
36
37
|
if @cite
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
cite_markup = if @url && !@url.empty?
|
39
|
+
"<a href='#{@url}' rel='nofollow' target='_blank'>#{@cite}</a>"
|
40
|
+
else
|
41
|
+
"#{@cite}\n"
|
42
|
+
end
|
42
43
|
tag = @break ? 'div' : 'span'
|
43
|
-
|
44
|
-
text = "<div class='quoteText clearfix'>#{text}</div>" if @break
|
44
|
+
@cite_markup = "<#{tag} class='quoteAttribution'> – #{preposition} #{cite_markup}</#{tag}>\n"
|
45
45
|
end
|
46
|
+
@text = @break ? "<div class='quoteText clearfix'>#{text}</div>" : text
|
47
|
+
output
|
48
|
+
end
|
49
|
+
|
50
|
+
def output
|
51
|
+
klass = "#{@class} " if @class
|
52
|
+
styling = " style='#{@style}'" if @style
|
46
53
|
<<~END_HERE
|
47
|
-
<div class='quote'>
|
48
|
-
#{text}#{
|
54
|
+
<div class='#{klass}quote'#{styling}>
|
55
|
+
#{@text}#{@cite_markup}
|
49
56
|
#{@helper.attribute if @helper.attribution}
|
50
57
|
</div>
|
51
58
|
END_HERE
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_quote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: jekyll_plugin_support
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.7.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- mslinn@mslinn.com
|
@@ -56,14 +56,14 @@ files:
|
|
56
56
|
- spec/jekyll_quote_spec.rb
|
57
57
|
- spec/spec_helper.rb
|
58
58
|
- spec/status_persistence.txt
|
59
|
-
homepage: https://www.mslinn.com/
|
59
|
+
homepage: https://www.mslinn.com/jekyll_plugins/jekyll_quote.html
|
60
60
|
licenses:
|
61
61
|
- MIT
|
62
62
|
metadata:
|
63
63
|
allowed_push_host: https://rubygems.org
|
64
64
|
bug_tracker_uri: https://github.com/mslinn/jekyll_quote/issues
|
65
65
|
changelog_uri: https://github.com/mslinn/jekyll_quote/CHANGELOG.md
|
66
|
-
homepage_uri: https://www.mslinn.com/
|
66
|
+
homepage_uri: https://www.mslinn.com/jekyll_plugins/jekyll_quote.html
|
67
67
|
source_code_uri: https://github.com/mslinn/jekyll_quote
|
68
68
|
post_install_message: |2+
|
69
69
|
|