Added an optional founder reference to the Organization node in the Infrastructure package.
This commit is contained in:
@@ -66,6 +66,7 @@ public extension StructuredData {
|
||||
/// - email: the address the organization is written to, or `nil` (the default) to omit its property.
|
||||
/// - logo: the absolute URL of the organization's logo, or `nil` (the default) to omit its property.
|
||||
/// - profiles: the absolute URLs of the organization's public profiles, or empty (the default) to omit their property.
|
||||
/// - founder: the `@id` of the `Person` node founding the organization, or `nil` (the default) to omit its property.
|
||||
init(
|
||||
name: String,
|
||||
url: String,
|
||||
@@ -74,7 +75,8 @@ public extension StructuredData {
|
||||
areaServed: String? = nil,
|
||||
email: String? = nil,
|
||||
logo: String? = nil,
|
||||
profiles: [String] = []
|
||||
profiles: [String] = [],
|
||||
founder: String? = nil
|
||||
) {
|
||||
let id = Self.organizationID(forSiteURL: url)
|
||||
|
||||
@@ -110,6 +112,10 @@ public extension StructuredData {
|
||||
))
|
||||
}
|
||||
|
||||
if let founder {
|
||||
organization.append(.init(.founder, value: .reference(founder)))
|
||||
}
|
||||
|
||||
self.init(nodes: [
|
||||
.init(
|
||||
type: .organization,
|
||||
|
||||
+2
@@ -77,6 +77,8 @@ public extension StructuredData.Property.Name {
|
||||
static let description: Self = "description"
|
||||
/// The address the thing a node describes is written to.
|
||||
static let email: Self = "email"
|
||||
/// The person who founded an organization.
|
||||
static let founder: Self = "founder"
|
||||
/// The absolute URL of an organization's logo.
|
||||
static let logo: Self = "logo"
|
||||
/// The name of the thing a node describes.
|
||||
|
||||
Reference in New Issue
Block a user