jekyll-external-links 1.0.0 → 1.0.1
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 +4 -4
- data/README.md +46 -6
- data/jekyll-external-links.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27e97cf1368bd8f36a07503330f7ffd6913857da8141b3ed730176e16f39e9a2
|
4
|
+
data.tar.gz: 801f606b93bcae54cf3f3f7abfcaa34149acd3ab78fab447f2ff0ba1d3047086
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
28
|
-
|
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
|
-
|
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.
|
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.
|
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.
|
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
|