page_structured_data 1.0.10 → 1.0.11
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/CHANGELOG.md +4 -0
- data/README.md +10 -1
- data/app/src/page_structured_data/page_types/organization.rb +14 -2
- data/lib/page_structured_data/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ffd04020a9a4ba900bb7d4bbdac9dd827d48535073a30c657865469df9e1988
|
|
4
|
+
data.tar.gz: 4b560fee8a434599acd2ae619fdc7e4a0973f29aa77f8b95191a270047767931
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08329eddfdf9f7e3682a6016ca84d25b1867e4ce8ebca4c4e7654536b4dff59b8d825351b4489b69342c42d2cc52ab41d96bba1f3cc8adf5a1f8180330d660ba'
|
|
7
|
+
data.tar.gz: 270c98e7c0071b9e09e75482a5d766ec685f8a7da103c3ddb15f4df03e895b98fcc52d57e50b93cbfddd992de7d0fbdf6d5de9542b07fec52d0eab977da2903f
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 1.0.11 - 2026-05-06
|
|
8
|
+
|
|
9
|
+
- Add optional `description` and `founder` support to organization page types.
|
|
10
|
+
|
|
7
11
|
## 1.0.10 - 2026-05-06
|
|
8
12
|
|
|
9
13
|
- Add JSON-LD escaping coverage for organization page types.
|
data/README.md
CHANGED
|
@@ -179,8 +179,14 @@ Use `Organization` when the current page represents an organization:
|
|
|
179
179
|
organization_page_type = PageStructuredData::PageTypes::Organization.new(
|
|
180
180
|
name: "RocketApex",
|
|
181
181
|
url: "https://rocketapex.com",
|
|
182
|
+
description: "Open source projects from RocketApex",
|
|
182
183
|
logo: "https://rocketapex.com/logo.png",
|
|
183
184
|
same_as: ["https://github.com/RocketApex"],
|
|
185
|
+
founder: {
|
|
186
|
+
"@type": "Person",
|
|
187
|
+
name: "Jane Doe",
|
|
188
|
+
url: "https://example.com/jane"
|
|
189
|
+
},
|
|
184
190
|
parent_organization: {
|
|
185
191
|
name: "Parent Org",
|
|
186
192
|
url: "https://parent.example"
|
|
@@ -293,13 +299,16 @@ Important methods:
|
|
|
293
299
|
PageStructuredData::PageTypes::Organization.new(
|
|
294
300
|
name:,
|
|
295
301
|
url:,
|
|
302
|
+
description: nil,
|
|
296
303
|
logo: nil,
|
|
297
304
|
same_as: [],
|
|
298
|
-
parent_organization: nil
|
|
305
|
+
parent_organization: nil,
|
|
306
|
+
founder: nil
|
|
299
307
|
)
|
|
300
308
|
```
|
|
301
309
|
|
|
302
310
|
`parent_organization` should be a hash with `:name` and `:url` keys.
|
|
311
|
+
`founder` should be a hash or another object that responds to `to_h`.
|
|
303
312
|
|
|
304
313
|
Important methods:
|
|
305
314
|
|
|
@@ -4,14 +4,16 @@ module PageStructuredData
|
|
|
4
4
|
module PageTypes
|
|
5
5
|
# Organization structured data for a page
|
|
6
6
|
class Organization
|
|
7
|
-
attr_reader :name, :url, :logo, :same_as, :parent_organization
|
|
7
|
+
attr_reader :name, :url, :description, :logo, :same_as, :parent_organization, :founder
|
|
8
8
|
|
|
9
|
-
def initialize(name:, url:, logo: nil, same_as: [], parent_organization: nil)
|
|
9
|
+
def initialize(name:, url:, description: nil, logo: nil, same_as: [], parent_organization: nil, founder: nil)
|
|
10
10
|
@name = name
|
|
11
11
|
@url = url
|
|
12
|
+
@description = description
|
|
12
13
|
@logo = logo
|
|
13
14
|
@same_as = same_as
|
|
14
15
|
@parent_organization = parent_organization
|
|
16
|
+
@founder = founder
|
|
15
17
|
end
|
|
16
18
|
|
|
17
19
|
def to_h # rubocop:disable Metrics/MethodLength
|
|
@@ -22,8 +24,10 @@ module PageStructuredData
|
|
|
22
24
|
|
|
23
25
|
node[:name] = name
|
|
24
26
|
node[:url] = url
|
|
27
|
+
node[:description] = description if description.present?
|
|
25
28
|
node[:logo] = logo if logo.present?
|
|
26
29
|
node[:sameAs] = same_as if same_as.present?
|
|
30
|
+
node[:founder] = founder_to_h if founder.present?
|
|
27
31
|
|
|
28
32
|
if parent_organization.present?
|
|
29
33
|
node[:parentOrganization] = {
|
|
@@ -43,6 +47,14 @@ module PageStructuredData
|
|
|
43
47
|
</script>
|
|
44
48
|
)
|
|
45
49
|
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
53
|
+
def founder_to_h
|
|
54
|
+
return founder.to_h if founder.respond_to?(:to_h)
|
|
55
|
+
|
|
56
|
+
founder
|
|
57
|
+
end
|
|
46
58
|
end
|
|
47
59
|
end
|
|
48
60
|
end
|