jekyll-external-link-accessibility 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 849fc21433dad344657c4a178cdde53743b725dc9c469c8de7cab31b17f9109c
4
- data.tar.gz: afab990efcde48e427a61e210ac525181dfe97cee3c994a1e4e06de4585f7747
3
+ metadata.gz: dd0a1ab030ca0e956affa6c40ce632c105c192a55751ce9b3025e819e57b92c2
4
+ data.tar.gz: dcc1bc1067f3342715e2b3c529735cc9350cc82c38751709b848d74dbc45a02f
5
5
  SHA512:
6
- metadata.gz: d1d54d9b739f5e0e9bc702142c191287001e4e391a01b866697358a629c6cd04c319ee6c44a0c12b060ef1fd786849b87886acb63560614219525228d0b8cd2c
7
- data.tar.gz: c5023bb2b680dc49821a78c235e99e7a114db56e55e4dbc785f5fba28b3d1829d49f41e504b5d37934f1b224c1bb83ca8987c5a85d2a07c3dda4dd3de372b518
6
+ metadata.gz: 62abc5f0455e2965c68bc0dbdc4369ea555d1a2815cb8463d4ecceffd24e5c9c6ddb6d5ed274aafed58d6cac0b5972a6b8312d6439d3a145506bf734b0248c05
7
+ data.tar.gz: e2d74c01e66a0031a7dd42898e70b5c42c3fe2c7db8421ba1e4916c031a23df176075525d54bb313f7e69d396844bc6611f0845be911c7126f3454208ad61142
data/CHANGELOG.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # main [(unreleased)](https://github.com/fastruby/jekyll-external-link-accessibility/compare/v0.2.0...main)
2
2
 
3
- - Your changes/patches go here.
3
+ - [FEATURE: Treat subdomains of the site host as internal links, so they keep their link equity](https://github.com/fastruby/jekyll-external-link-accessibility/pull/7)
4
+ - [CHORE: Add an RSpec test suite and CI matrix running Ruby 2.7 through 4.0](https://github.com/fastruby/jekyll-external-link-accessibility/pull/6)
4
5
 
5
6
  # v0.2.0 / 2026-07-15 [(commits)](https://github.com/fastruby/jekyll-external-link-accessibility/compare/v0.1.0...v0.2.0)
6
7
 
data/README.md CHANGED
@@ -19,7 +19,7 @@ This plugin makes every link in your blog posts open in a new tab accessibly (`t
19
19
  The plugin edits every link in a post, internal and external:
20
20
 
21
21
  - All links open in a new tab so readers don't lose their place, with a `title`, a new-tab icon, and a screen-reader-only "opens a new window" note. Skip a specific link by adding `data-no-external="true"`, e.g. `<a href="...." data-no-external="true">...</a>`.
22
- - External links (pointing to a host other than your site's `url` in `_config.yml`) also get a `rel` attribute (`external nofollow noopener noreferrer` by default, see Configuration). The `nofollow` keeps them from passing your link equity off-site, so internal links are left without a `rel`. The `www.` prefix and host casing are ignored when comparing hosts.
22
+ - External links (pointing to a host other than your site's `url` in `_config.yml`) also get a `rel` attribute (`external nofollow noopener noreferrer` by default, see Configuration). The `nofollow` keeps them from passing your link equity off-site, so internal links are left without a `rel`. The `www.` prefix and host casing are ignored when comparing hosts, and subdomains of your site's host (e.g. `docs.example.com` when your `url` is `https://example.com`) count as internal.
23
23
 
24
24
  ### Configuration
25
25
  You can override the default configuration by adding the following section to your Jekyll site's `_config.yml`:
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  class ExternalLinkAccessibility
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -40,13 +40,14 @@ module Jekyll
40
40
  end
41
41
 
42
42
  # A link is external only when it points to a different host than the site.
43
- # Relative links ("/blog/...") and absolute links to our own domain are internal,
44
- # so they keep their link equity (no nofollow).
43
+ # Relative links ("/blog/..."), absolute links to our own domain and links to a
44
+ # subdomain of it are internal, so they keep their link equity (no nofollow).
45
45
  def self.external_link?(href, site_host)
46
46
  return false unless href.start_with?(*EXTERNAL_SCHEMES)
47
47
 
48
48
  link_host = host_for(href)
49
49
  return true if link_host.nil?
50
+ return false if site_host && link_host.end_with?(".#{site_host}")
50
51
 
51
52
  link_host != site_host
52
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-external-link-accessibility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kudakwashe Siziva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-16 00:00:00.000000000 Z
11
+ date: 2026-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -34,22 +34,50 @@ dependencies:
34
34
  name: nokogiri
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.8'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
- version: 1.8.5
39
+ version: 1.12.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.0'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 1.12.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: rspec
55
+ requirement: !ruby/object:Gem::Requirement
46
56
  requirements:
47
57
  - - "~>"
48
58
  - !ruby/object:Gem::Version
49
- version: '1.8'
50
- - - ">="
59
+ version: '3.0'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3.0'
67
+ - !ruby/object:Gem::Dependency
68
+ name: rake
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '13.0'
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
51
79
  - !ruby/object:Gem::Version
52
- version: 1.8.5
80
+ version: '13.0'
53
81
  description: Knows how to target external `a` tags and accessibility attributes
54
82
  email:
55
83
  - kudakwashe@ombulabs.com