jekyll_html_truncatewords 0.1.0 → 0.1.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 +9 -0
- data/Gemfile.lock +11 -12
- data/README.md +14 -15
- data/jekyll_html_truncatewords.gemspec +3 -4
- data/lib/jekyll_html_truncatewords/version.rb +1 -1
- metadata +8 -21
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b5da1dcff65764fbe9e2e0a051f8fff05871e38180984bc6de1f6d05ac1bdc5
|
4
|
+
data.tar.gz: 1e38cf3cee323d413d7c481098df04792e14e697a3046df864d6cef698bc3a90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bad5b78e086de5c05dc1f69033046df3ca288f1be4b933a0de904ed9f5447bac0acbfee8812bfb34dd32dded882c06170d6519aa56877f8ba06a3a0b66622ef
|
7
|
+
data.tar.gz: f93d1b526c5ad192d9885d5818ce9ef5e037ec4137f4a5e0d927efd90dbcf22585d7538153af2ee3a84d6471565753e3047ff62cba525816a101fe684e385f21
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,35 +1,34 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jekyll_html_truncatewords (0.1.
|
4
|
+
jekyll_html_truncatewords (0.1.1)
|
5
5
|
liquid
|
6
|
-
liquid-c
|
7
6
|
nokogiri
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: https://rubygems.org/
|
11
10
|
specs:
|
12
11
|
diff-lcs (1.4.4)
|
13
|
-
liquid (
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
liquid (5.0.0)
|
13
|
+
mini_portile2 (2.5.0)
|
14
|
+
nokogiri (1.11.1)
|
15
|
+
mini_portile2 (~> 2.5.0)
|
16
|
+
racc (~> 1.4)
|
17
|
+
racc (1.5.2)
|
19
18
|
rake (12.3.3)
|
20
19
|
rspec (3.10.0)
|
21
20
|
rspec-core (~> 3.10.0)
|
22
21
|
rspec-expectations (~> 3.10.0)
|
23
22
|
rspec-mocks (~> 3.10.0)
|
24
|
-
rspec-core (3.10.
|
23
|
+
rspec-core (3.10.1)
|
25
24
|
rspec-support (~> 3.10.0)
|
26
|
-
rspec-expectations (3.10.
|
25
|
+
rspec-expectations (3.10.1)
|
27
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
28
27
|
rspec-support (~> 3.10.0)
|
29
|
-
rspec-mocks (3.10.
|
28
|
+
rspec-mocks (3.10.1)
|
30
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
31
30
|
rspec-support (~> 3.10.0)
|
32
|
-
rspec-support (3.10.
|
31
|
+
rspec-support (3.10.1)
|
33
32
|
|
34
33
|
PLATFORMS
|
35
34
|
ruby
|
data/README.md
CHANGED
@@ -2,29 +2,27 @@
|
|
2
2
|
|
3
3
|
**WIP:** This gem is not ready for production use yet.`
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
TODO: Delete this and the text above, and describe your gem
|
5
|
+
A Jekyll filter to truncate HTML to a specified number of words. The Liquid truncatewords filter can't operate on HTML because it isn't aware of tags. But Jekyll blog posts usually contain HTML, so this makes it difficult to, for example, use the first 50 words of a blog post as the preview. jekyll_html_truncatewords solves that problem. It works the same as truncatewords, but it is aware of HTML tags so it counts words correctly within HTML and won't break HTML.
|
8
6
|
|
9
7
|
## Installation
|
10
8
|
|
11
|
-
|
9
|
+
This is a Jekyll plugin, and can be installed using any of the [supported
|
10
|
+
methods](https://jekyllrb.com/docs/plugins/installation/).
|
11
|
+
|
12
|
+
We recommend simply adding the gem to the `:jekyll_plugins` group in your
|
13
|
+
`Gemfile`:
|
12
14
|
|
13
15
|
```ruby
|
14
|
-
|
16
|
+
group :jekyll_plugins do
|
17
|
+
gem 'jekyll_html_truncatewords', '~> 0.1'
|
18
|
+
end
|
15
19
|
```
|
16
20
|
|
17
|
-
And then execute:
|
18
|
-
|
19
|
-
$ bundle install
|
20
|
-
|
21
|
-
Or install it yourself as:
|
22
|
-
|
23
|
-
$ gem install jekyll_html_truncatewords
|
24
|
-
|
25
21
|
## Usage
|
26
22
|
|
27
|
-
|
23
|
+
```
|
24
|
+
{{ post.content | html_truncatewords: 50 }}
|
25
|
+
```
|
28
26
|
|
29
27
|
## Development
|
30
28
|
|
@@ -34,7 +32,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
34
32
|
|
35
33
|
## Contributing
|
36
34
|
|
37
|
-
Bug reports and pull requests are welcome on GitHub at
|
35
|
+
Bug reports and pull requests are welcome on GitHub at
|
36
|
+
https://github.com/mkasberg/jekyll_html_truncatewords.
|
38
37
|
|
39
38
|
|
40
39
|
## License
|
@@ -7,14 +7,14 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ["mike@mikekasberg.com"]
|
8
8
|
|
9
9
|
spec.summary = %q{A Jekyll filter to truncate HTML}
|
10
|
-
spec.description = %q{The Liquid truncatewords filter can't operate on HTML because it isn't aware of tags. But Jekyll blog posts usually contain HTML, so this makes it difficult to, for example, use the first 50 words of a blog post as the preview. jekyll_html_truncatewords solves that problem. It works the same as truncatewords, but it is aware of HTML tags so it counts words correctly within HTML and won't break HTML.}
|
10
|
+
spec.description = %q{A Jekyll filter to truncate HTML to a specified number of words. The Liquid truncatewords filter can't operate on HTML because it isn't aware of tags. But Jekyll blog posts usually contain HTML, so this makes it difficult to, for example, use the first 50 words of a blog post as the preview. jekyll_html_truncatewords solves that problem. It works the same as truncatewords, but it is aware of HTML tags so it counts words correctly within HTML and won't break HTML.}
|
11
11
|
spec.homepage = "https://github.com/mkasberg/jekyll_html_trunctewords"
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
-
spec.metadata["source_code_uri"] =
|
17
|
-
spec.metadata["changelog_uri"] = "https://
|
16
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/mkasberg/jekyll_html_trunctewords/blob/master/CHANGELOG.md"
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -26,6 +26,5 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
spec.add_runtime_dependency 'liquid'
|
29
|
-
spec.add_runtime_dependency 'liquid-c'
|
30
29
|
spec.add_runtime_dependency 'nokogiri'
|
31
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_html_truncatewords
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Kasberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: liquid-c
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: nokogiri
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,9 +38,10 @@ dependencies:
|
|
52
38
|
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
|
-
description:
|
56
|
-
|
57
|
-
|
41
|
+
description: A Jekyll filter to truncate HTML to a specified number of words. The
|
42
|
+
Liquid truncatewords filter can't operate on HTML because it isn't aware of tags.
|
43
|
+
But Jekyll blog posts usually contain HTML, so this makes it difficult to, for example,
|
44
|
+
use the first 50 words of a blog post as the preview. jekyll_html_truncatewords
|
58
45
|
solves that problem. It works the same as truncatewords, but it is aware of HTML
|
59
46
|
tags so it counts words correctly within HTML and won't break HTML.
|
60
47
|
email:
|
@@ -66,7 +53,7 @@ files:
|
|
66
53
|
- ".github/workflows/test.yml"
|
67
54
|
- ".gitignore"
|
68
55
|
- ".rspec"
|
69
|
-
-
|
56
|
+
- CHANGELOG.md
|
70
57
|
- Gemfile
|
71
58
|
- Gemfile.lock
|
72
59
|
- LICENSE.txt
|
@@ -83,7 +70,7 @@ licenses:
|
|
83
70
|
metadata:
|
84
71
|
homepage_uri: https://github.com/mkasberg/jekyll_html_trunctewords
|
85
72
|
source_code_uri: https://github.com/mkasberg/jekyll_html_trunctewords
|
86
|
-
changelog_uri: https://
|
73
|
+
changelog_uri: https://github.com/mkasberg/jekyll_html_trunctewords/blob/master/CHANGELOG.md
|
87
74
|
post_install_message:
|
88
75
|
rdoc_options: []
|
89
76
|
require_paths:
|