jekyll-relative-urls 0.0.6 → 0.0.7
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
- checksums.yaml.gz.sig +1 -0
- data/lib/jekyll_relative_urls/jekyll/renderer.rb +4 -1
- data/lib/jekyll_relative_urls/jekyll/tags/base.rb +13 -11
- data/lib/jekyll_relative_urls/jekyll/url.rb +3 -1
- data.tar.gz.sig +0 -0
- metadata +33 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75630544090018eeb0df48d9e6fbc53055ec114de6e36c7bce0689ca117c7f17
|
|
4
|
+
data.tar.gz: ead99a6f0606f3e6e90de63a38da38764f1f36c05f7100cd7bf69f0d7189ac2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca6e66dca73b0bcf2e27ca89e7b5c562e1093817d5da2214f09ef26f01e44baef5acbd0cad85a36bbbccef7e6d21bcbed5c27271fd4561b81e9a659c1082ea42
|
|
7
|
+
data.tar.gz: f7548443ae5187ad4e334b8f0336abaa7904fc472bcc7e1d25be4f65885c406342f8988090d62245409f5bd8aebc911fa2c5a1ea86b5b45173155d0da5ae2a0d
|
checksums.yaml.gz.sig
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
%�/O�i��H���n�K��f�
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright (c) 2019 Sutty <hi@sutty.nl>
|
|
2
4
|
#
|
|
3
5
|
# This file is part of jekyll-relative-urls
|
|
@@ -22,6 +24,7 @@ require 'jekyll/renderer'
|
|
|
22
24
|
module Jekyll
|
|
23
25
|
# Redefinir Renderer.render_document()
|
|
24
26
|
class Renderer
|
|
27
|
+
HREF = /(href=["'])#/
|
|
25
28
|
alias original_render_document render_document
|
|
26
29
|
|
|
27
30
|
def render_document
|
|
@@ -35,7 +38,7 @@ module Jekyll
|
|
|
35
38
|
def relativize_anchors_to(input, base)
|
|
36
39
|
return input if base == '/'
|
|
37
40
|
|
|
38
|
-
input.gsub(
|
|
41
|
+
input.gsub(HREF, "\\1#{base}#")
|
|
39
42
|
end
|
|
40
43
|
end
|
|
41
44
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright (c) 2019 Sutty <hi@sutty.nl>
|
|
2
4
|
#
|
|
3
5
|
# This file is part of jekyll-relative-urls
|
|
@@ -22,22 +24,22 @@ module Jekyll
|
|
|
22
24
|
# actual de una URL con respecto a la raíz del sitio.
|
|
23
25
|
class Base < Liquid::Tag
|
|
24
26
|
def render(context)
|
|
25
|
-
|
|
26
|
-
depth = context.registers[:page]['url'].split('/').size
|
|
27
|
-
# La ruta relativa a la raíz del sitio
|
|
28
|
-
base = ''
|
|
27
|
+
@@cache ||= {}
|
|
29
28
|
|
|
29
|
+
url = context.registers[:page]['url']
|
|
30
|
+
# Obtiene la cantidad de directorios en una URL
|
|
31
|
+
depth = url.split('/').size
|
|
30
32
|
# Si la ruta contiene extensión, descontar uno
|
|
31
|
-
depth -= 1 unless
|
|
33
|
+
depth -= 1 unless url.end_with? '/'
|
|
32
34
|
|
|
33
35
|
# Establecer el nivel en el que estamos, subiendo niveles hacia la
|
|
34
36
|
# raíz del sitio
|
|
35
|
-
depth
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
@@cache[depth] ||=
|
|
38
|
+
''.dup.tap do |base|
|
|
39
|
+
depth.times do
|
|
40
|
+
base << '../'
|
|
41
|
+
end
|
|
42
|
+
end
|
|
41
43
|
end
|
|
42
44
|
end
|
|
43
45
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright (c) 2019 Sutty <hi@sutty.nl>
|
|
2
4
|
#
|
|
3
5
|
# This file is part of jekyll-relative-urls
|
|
@@ -26,7 +28,7 @@ module Jekyll
|
|
|
26
28
|
def to_s
|
|
27
29
|
# Igual que en jekyll-4.0.0/lib/jekyll/url.rb
|
|
28
30
|
url = sanitize_url(generated_permalink || generated_url)
|
|
29
|
-
url.
|
|
31
|
+
url.delete_prefix!('/') unless url.size == 1
|
|
30
32
|
|
|
31
33
|
url
|
|
32
34
|
end
|
data.tar.gz.sig
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-relative-urls
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sutty
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
|
-
cert_chain:
|
|
11
|
-
|
|
10
|
+
cert_chain:
|
|
11
|
+
- |
|
|
12
|
+
-----BEGIN CERTIFICATE-----
|
|
13
|
+
MIIEYDCCAsigAwIBAgIBATANBgkqhkiG9w0BAQsFADA7MQ4wDAYDVQQDDAVmYXVu
|
|
14
|
+
bzEVMBMGCgmSJomT8ixkARkWBXN1dHR5MRIwEAYKCZImiZPyLGQBGRYCbmwwHhcN
|
|
15
|
+
MjUwMTA3MTczMTQ1WhcNMjYwMTA3MTczMTQ1WjA7MQ4wDAYDVQQDDAVmYXVubzEV
|
|
16
|
+
MBMGCgmSJomT8ixkARkWBXN1dHR5MRIwEAYKCZImiZPyLGQBGRYCbmwwggGiMA0G
|
|
17
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDqrFZ8PCNQbaW1incHEZp/OZTIt7b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
|
+
zFTjbsKtpWxNN+xWsJbjukggS8uX1400WqyjUCitDxDJknP+xeAg8wt2wT+IC1X1
|
|
33
|
+
zMY8gjxoBfwPum74cBTaZzYMpeGaS1fJ3N4NBU+SHLRDiKaVZzEnoNyJDHnsXXrX
|
|
34
|
+
MvF98+bTUHC9xcklH7RCO5uqUOq7cxIcMjzx3cpR6+AW6zXYQBjWfNB9KfaAstZy
|
|
35
|
+
cpurTQHNJfL/ah+9dYbgDXdG5HAAjRMAsWSvERw95YdN9XzQZCdUk5wUs+A6cNtO
|
|
36
|
+
AZZUMTVYNx8JqUeemxlXBRjsD/s=
|
|
37
|
+
-----END CERTIFICATE-----
|
|
38
|
+
date: 2025-12-28 00:00:00.000000000 Z
|
|
12
39
|
dependencies:
|
|
13
40
|
- !ruby/object:Gem::Dependency
|
|
14
41
|
name: jekyll
|
|
@@ -24,7 +51,7 @@ dependencies:
|
|
|
24
51
|
- - "~>"
|
|
25
52
|
- !ruby/object:Gem::Version
|
|
26
53
|
version: '4'
|
|
27
|
-
description: A
|
|
54
|
+
description: A Jekyll plugin for transportable sites
|
|
28
55
|
email:
|
|
29
56
|
- hi@sutty.nl
|
|
30
57
|
executables: []
|
|
@@ -64,14 +91,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
64
91
|
requirements:
|
|
65
92
|
- - ">="
|
|
66
93
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
94
|
+
version: '3.1'
|
|
68
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
96
|
requirements:
|
|
70
97
|
- - ">="
|
|
71
98
|
- !ruby/object:Gem::Version
|
|
72
99
|
version: '0'
|
|
73
100
|
requirements: []
|
|
74
|
-
rubygems_version: 3.
|
|
101
|
+
rubygems_version: 3.3.27
|
|
75
102
|
signing_key:
|
|
76
103
|
specification_version: 4
|
|
77
104
|
summary: It allows you to generate sites that work without changes even if you put
|
metadata.gz.sig
ADDED
|
Binary file
|