jekyll-extlinks 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/License +21 -0
- data/README.md +42 -0
- data/jekyll-extlinks.gemspec +17 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 116bb7fbd00da52cb62948ca5081c8b3c7ed34ee
|
4
|
+
data.tar.gz: e496a360b3f844dbd55ee2850484c16ad50d5071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a33c96adcc5d38ae222ae23ddb2fc28afe557a93a248d714f63bf9d513b42cfaa07e27213a5a845362153b6c6c402ac54c7352995faa241964385a5227c328b0
|
7
|
+
data.tar.gz: 6482b7169d46e5ae6aa7d09eb87e1cf072a13896a73e00f3f3589ae67b249626972028b27b7f33b1ac6f8f59bb1f18094f4631ee12c50d8572e609cb47a1c297
|
data/Gemfile
ADDED
data/License
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 Dmitry Ogarkov
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Jekyll ExtLinks
|
2
|
+
This Jekyll plugin adds custom attributes (`rel="nofollow"`, `target="_blank"`, etc.) to external links in your content.
|
3
|
+
|
4
|
+
## Description
|
5
|
+
This Jekyll plugin adds custom attributes to external links in your content. For example, you can add `rel="nofollow"` to all external links by default (with exceptions if you need them), or something like `class="external"`. You can also use it to add `target="_blank"` to external links, but generally it is not recommended as it leads to bad user experience. Multiple attributes are allowed.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
1. Install the gem from RubyGems: `gem install jekyll-extlinks`. The Nokogiri gem is required. If you experience any problems installing Nokogiri (*"ERROR: Failed to build gem native extension"*, etc.), run `gem update --system` and try again.
|
9
|
+
|
10
|
+
2. Add this to your project's `Gemfile`:
|
11
|
+
```ruby
|
12
|
+
gem 'jekyll-extlinks'
|
13
|
+
```
|
14
|
+
|
15
|
+
3. Add this to your project's `_config.yml`:
|
16
|
+
```yml
|
17
|
+
gems:
|
18
|
+
- jekyll-extlinks
|
19
|
+
```
|
20
|
+
|
21
|
+
## Configuration
|
22
|
+
Configure the plugin in your `_config.yml`. Notice the indentation matters. Example:
|
23
|
+
|
24
|
+
```yml
|
25
|
+
extlinks:
|
26
|
+
attributes: {rel: nofollow, target: _blank}
|
27
|
+
rel_exclude: ['host1.com', 'host2.net']
|
28
|
+
```
|
29
|
+
|
30
|
+
* `attributes` are required - at least one of them; `rel_exclude` is optional
|
31
|
+
* Links to hosts listed in `rel_exclude` will not have the `rel` attribute set
|
32
|
+
* Links which have the `rel` attribute already will keep it unchanged, like this one in Markdown: `[Link text](http://someurl.com){:rel="dofollow"}`
|
33
|
+
* Relative links will not be processed
|
34
|
+
* Don't forget to actually use the plugin (see below)
|
35
|
+
|
36
|
+
## Usage
|
37
|
+
Use the plugin in your Jekyll layouts: `{{ content | extlinks }}`
|
38
|
+
|
39
|
+
## Notes
|
40
|
+
Developed by Dmitry Ogarkov - http://ogarkov.com/jekyll/plugins/extlinks/
|
41
|
+
|
42
|
+
Based on http://dev.mensfeld.pl/2014/12/rackrails-middleware-that-will-ensure-relnofollow-for-all-your-links/
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "jekyll-extlinks"
|
3
|
+
s.version = "0.0.3"
|
4
|
+
s.date = "2017-02-26"
|
5
|
+
s.summary = "Jekyll ExtLinks Plugin"
|
6
|
+
s.description = <<-EOF
|
7
|
+
Adds custom attributes to external links (rel="nofollow", target="_blank", etc.)
|
8
|
+
EOF
|
9
|
+
s.authors = ["Dmitry Ogarkov"]
|
10
|
+
s.email = "dima@ogarkov.com"
|
11
|
+
s.files = ["lib/jekyll-extlinks.rb", "Gemfile", "jekyll-extlinks.gemspec", "License", "README.md"]
|
12
|
+
s.homepage = "http://ogarkov.com/jekyll/plugins/extlinks/"
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
s.add_runtime_dependency "jekyll", "~> 3.0"
|
16
|
+
s.add_runtime_dependency "nokogiri", "~> 1.6"
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-extlinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Ogarkov
|
@@ -45,6 +45,10 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- Gemfile
|
49
|
+
- License
|
50
|
+
- README.md
|
51
|
+
- jekyll-extlinks.gemspec
|
48
52
|
- lib/jekyll-extlinks.rb
|
49
53
|
homepage: http://ogarkov.com/jekyll/plugins/extlinks/
|
50
54
|
licenses:
|