jekyll-external-links 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5491051e0ca68c8d51fb38d75253c02840b2c48034c0ab32ad2a23458968ad2
4
- data.tar.gz: 262dbe240bd7aa8a2dbfa213d97120da987668edf5a7f29378c3f4eb77345930
3
+ metadata.gz: 27e97cf1368bd8f36a07503330f7ffd6913857da8141b3ed730176e16f39e9a2
4
+ data.tar.gz: 801f606b93bcae54cf3f3f7abfcaa34149acd3ab78fab447f2ff0ba1d3047086
5
5
  SHA512:
6
- metadata.gz: 81f80e33df4b5de6bdc49811aa4069b88ef493994518d62fd172cebabc645ee667074098030111d87cbfa9c32b8a1204a33b515671c53790cd89f0be0fb75f2d
7
- data.tar.gz: d59e34609425a96b7331e1411901f602c83cb2033007ceaa6ac5d19f0fd56ae90082dc1d19b3582e740c0fa416f5cfed5649636cac6d9c14dc7b317ea6c34470
6
+ metadata.gz: 8f27cae5ea6d23d65ea41dab52007b75482927829da34856e945b5dae6452230f33d4cea0f4684009b1fa7816b6e66e1edce21f291b6419b6cd6f281d00cdb08
7
+ data.tar.gz: fa1a376c16fb0790e286355e048758e8ab5c478d98b40ef69302d1e5d5cca72d0f9a7efa35b19849f590b3c5f452e91a09d40effda97eec6eda56c0703bc96c8
data/README.md CHANGED
@@ -1,15 +1,24 @@
1
1
  # Jekyll plugin that marks external links
2
2
 
3
- In each Jekyll document or page content, updates `<a>` elements that point
4
- to external sites as follows:
3
+ In rendered HTML contents of each Jekyll document or page,
4
+ updates `<a>` elements that point to external sites as follows:
5
5
 
6
6
  - Adds `rel="external"` attribute
7
7
  - Adds inner HTML markup with external link icon
8
8
 
9
- You can specify a CSS selector for which links are to be marked,
9
+ You can specify a CSS selector for which links are to be evaluated,
10
10
  and a list of selectors for which links are to be ignored
11
11
  (ignored selectors take precedence).
12
12
 
13
+ ## Which links are considered external
14
+
15
+ A link is considered external if:
16
+
17
+ * Its `href` attribute value starts with “http” or “https”, and
18
+ * The domain name following “http(s)://” is not equal to the
19
+ domain name part from your site URL
20
+ (which you have to specify as `url` in Jekyll configuration).
21
+
13
22
  ## Configuration
14
23
 
15
24
  Example configuration with defaults:
@@ -24,12 +33,43 @@ external_links:
24
33
  marker_html: "<span class='ico-ext'><i class='fas fa-external-link-square-alt'></i></span>"
25
34
  ```
26
35
 
27
- As you can see, by default the Font Awesome’s `fa-external-link-square-alt` icon is used,
28
- which implies that you are using Font Awesome.
36
+ Note the assumptions made by the defaults:
37
+
38
+ * Links you want to be marked as external are always within the `<main>` tag.
39
+
40
+ * You use Font Awesome in your site.
41
+
42
+ * Links containing “travis”, “coverity” and “codecov”
43
+ are only used in badges, and you don’t want to process those.
44
+
45
+ If some of these assumptions don’t apply to your site,
46
+ you can add that structure to your `_config.yml` and customize the values.
47
+
48
+ ### `external_links.selector`
29
49
 
30
- You can set marker_html to empty string and style links with custom CSS rule
50
+ Only links matching this CSS path will be processed.
51
+
52
+ ### `external_links.marker_html`
53
+
54
+ The specified HTML markup will be added inside each `<a>` tag
55
+ that’s detected as external link.
56
+
57
+ By default, the Font Awesome’s `fa-external-link-square-alt` icon is used,
58
+ which requires your site to have Font Awesome initialized.
59
+
60
+ You can set `marker_html` to empty string and style links with a custom CSS rule
31
61
  (e.g., `a[rel=external] { border-bottom-style: dashed; }`), though it’s less flexible.
32
62
 
63
+ ### `external_links.ignored_selectors`
64
+
65
+ Even if a link matches `selector`, it won’t be altered if it also matches any of these
66
+ selectors.
67
+
68
+ ### `url`
69
+
70
+ The `url` option in your configuration file is used when deciding
71
+ whether a given link is external or not.
72
+
33
73
  ## Example site
34
74
 
35
75
  An example site is included in this repo.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'jekyll-external-links'
5
- s.version = '1.0.0'
5
+ s.version = '1.0.1'
6
6
  s.authors = ['Ribose Inc.']
7
7
  s.email = ['open.source@ribose.com']
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-external-links
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.0.3
102
+ rubygems_version: 3.0.6
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Jekyll plugin that marks external links in your site