utopia 2.29.0 → 2.30.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: 0d937ad3119c430d7176a16586dfecf3ab19f0cb8d2d70c69f50c18a360b8c37
4
- data.tar.gz: a147415518db0cef9228839be5a175244dd796691ede91018c7db8027d123611
3
+ metadata.gz: fa5fe1e014e5d20ae6c6ffbaa8f726b6cbccf08aa4dd2b1bac371cf9ed7c1930
4
+ data.tar.gz: d8bc0da5c90f121c93f7098251513dc8ced31f2ee256ac469065e5ab248ff591
5
5
  SHA512:
6
- metadata.gz: b519b2fa1b49640fc564de7f8e500e52cf78d469b7989e6a6f697f206f3cdd2f73693db8ea217f15e56aa5811e5062107105bfbc301fbfef4cb1fe64f17229fa
7
- data.tar.gz: 950946fe97760b4763288515a0fb3158f091b0059431fd210fcfc99359d399bed0fe9e9f2a6e73863076d9f5ad000783a405135724c612dc029feef9bef1a4a3
6
+ metadata.gz: 5b2b3b73206fcda92d05233ff47bcae59445110e235c15b95a918344d1123be59816ca2ea39f3a5dd5cb6ca721be9c0ade13e52a281ef1ef9d5aa580518f415d
7
+ data.tar.gz: 6130dfb56637a80fb1a6e5b32bb22aa7cee7a3eaefb50b277ca4118c611c84830af79ee316ef9566720f1c1bd880f2ecf4fcc1b85021189912bceeccbb4a3cf6
checksums.yaml.gz.sig CHANGED
Binary file
@@ -38,6 +38,27 @@ module Utopia
38
38
  super()
39
39
  end
40
40
 
41
+ # @returns [Path] The original request path, if known.
42
+ def request_path
43
+ Path[request.env["REQUEST_PATH"]]
44
+ end
45
+
46
+ protected def current_base_uri_path
47
+ self.current.node.uri_path
48
+ end
49
+
50
+ # Compute the relative path from the curent base uri (e.g. the node being rendered) to the request uri. This path can be used to ensure resources are loaded relative to a given path.
51
+ #
52
+ # | Relative To | Request Path | Base URI |
53
+ # |---------------|------------------------|--------------|
54
+ # | "/page" | "/index" | "" |
55
+ # | "/blog/entry" | "/blog/2025/05/my-cat" | "../.." |
56
+ #
57
+ # @returns [String] the base uri for the current page.
58
+ def base_uri(relative_to = self.current_base_uri_path)
59
+ Path[relative_to].dirname.shortest_path(request_path)
60
+ end
61
+
41
62
  def [] key
42
63
  @attributes[key]
43
64
  end
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2009-2024, by Samuel Williams.
5
5
 
6
6
  module Utopia
7
- VERSION = "2.29.0"
7
+ VERSION = "2.30.0"
8
8
  end
@@ -9,7 +9,7 @@
9
9
  <title>Utopia</title>
10
10
  <?r end ?>
11
11
 
12
- <base href="#{first.node.uri_path}"/>
12
+ <base href="#{document.base_uri}"/>
13
13
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
14
14
 
15
15
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" />
data.tar.gz.sig CHANGED
@@ -1,3 +1 @@
1
- q�׿ćZ�[�^�JH`���Đd)��u�}�݀��i[�]�/>�w�6��_!���R�j�#ּ]�g� �E�{Εc��v�\G��p֓��lu4$�R����uщ,����jR�X����S�x�`���lx1���U��r]sU6IV��?�[���J]S�R p�� 2��Ӫ�%�����OY��4�h��s�Bf�����M�#/���=�3���o0v� ��S�Zw�e��
2
- ��2E��~t�N C*8Z�W�lZ3v��.{d����t)<Z���-;t��Bc��h�����aK�݈lv
3
- �r��>�c�E�o�_AXB%\���F���!z��q‡��f`_���ї��� ��z�qn�Җ�,�
1
+ x�F0��:#?��N3�֚}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.29.0
4
+ version: 2.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -40,7 +40,7 @@ cert_chain:
40
40
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
41
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
42
  -----END CERTIFICATE-----
43
- date: 2025-03-08 00:00:00.000000000 Z
43
+ date: 2025-04-09 00:00:00.000000000 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: bake
metadata.gz.sig CHANGED
Binary file