From 4b658502f6b606ff2235cb8a9cdb0b6828d4ead4 Mon Sep 17 00:00:00 2001 From: nlisgo Date: Tue, 4 Oct 2022 15:38:26 +0100 Subject: [PATCH 1/2] Adjust link schema and use in more places --- .../article-download-links-list.yaml | 44 +++---------------- source/non-pattern-schema/link.yaml | 12 +++++ 2 files changed, 19 insertions(+), 37 deletions(-) diff --git a/source/_patterns/01-molecules/components/article-download-links-list.yaml b/source/_patterns/01-molecules/components/article-download-links-list.yaml index 9e0c7ba7f..b1ee9ca6f 100644 --- a/source/_patterns/01-molecules/components/article-download-links-list.yaml +++ b/source/_patterns/01-molecules/components/article-download-links-list.yaml @@ -31,44 +31,14 @@ properties: type: object properties: primary: - type: object - properties: - name: - type: string - minLength: 1 - url: - type: string - minLength: 1 - checkPMC: - type: string - minLength: 1 - attributes: - type: array - items: - type: object - properties: - key: - type: string - minLength: 1 - value: - type: string - required: - - key - required: - - name - - url + allOf: + - $ref: ../../../non-pattern-schema/link.yaml + - properties: + checkPMC: + type: string + minLength: 1 secondary: - type: object - properties: - name: - type: string - minLength: 1 - url: - type: string - minLength: 1 - required: - - name - - url + $ref: ../../../non-pattern-schema/link.yaml required: - primary required: diff --git a/source/non-pattern-schema/link.yaml b/source/non-pattern-schema/link.yaml index fc44369fd..3f72c0e42 100644 --- a/source/non-pattern-schema/link.yaml +++ b/source/non-pattern-schema/link.yaml @@ -7,6 +7,18 @@ properties: url: type: string minLength: 1 + attributes: + type: array + items: + type: object + properties: + key: + type: string + minLength: 1 + value: + type: string + required: + - key required: - name - url From 15c0bb23b98f475b877f0eb0030fd05421e4c456 Mon Sep 17 00:00:00 2001 From: nlisgo Date: Tue, 4 Oct 2022 16:33:01 +0100 Subject: [PATCH 2/2] Change more references --- .../00-atoms/components/breadcrumb.yaml | 15 +++------------ .../00-atoms/components/see-more-link.yaml | 17 +++++------------ .../components/archive-nav-link.yaml | 12 +----------- 3 files changed, 9 insertions(+), 35 deletions(-) diff --git a/source/_patterns/00-atoms/components/breadcrumb.yaml b/source/_patterns/00-atoms/components/breadcrumb.yaml index 90598af30..12cd4f7e5 100644 --- a/source/_patterns/00-atoms/components/breadcrumb.yaml +++ b/source/_patterns/00-atoms/components/breadcrumb.yaml @@ -2,17 +2,8 @@ $schema: http://json-schema.org/draft-04/schema# type: object properties: items: - type: array - properties: - name: - type: string - minLength: 1 - url: - type: string - minLength: 1 - required: - - name - - url - minItems: 1 + allOf: + - $ref: ../../../non-pattern-schema/link.yaml + - minItems: 1 required: - items diff --git a/source/_patterns/00-atoms/components/see-more-link.yaml b/source/_patterns/00-atoms/components/see-more-link.yaml index d67846da4..cc0e6b13f 100644 --- a/source/_patterns/00-atoms/components/see-more-link.yaml +++ b/source/_patterns/00-atoms/components/see-more-link.yaml @@ -1,14 +1,7 @@ $schema: http://json-schema.org/draft-04/schema# type: object -properties: - url: - type: string - minLength: 1 - name: - type: string - minLength: 1 - isInline: - type: boolean -required: - - url - - name +allOf: + - $ref: ../../../non-pattern-schema/link.yaml + - properties: + isInline: + type: boolean diff --git a/source/_patterns/01-molecules/components/archive-nav-link.yaml b/source/_patterns/01-molecules/components/archive-nav-link.yaml index 9e91ac728..398b0fa1a 100644 --- a/source/_patterns/01-molecules/components/archive-nav-link.yaml +++ b/source/_patterns/01-molecules/components/archive-nav-link.yaml @@ -10,17 +10,7 @@ properties: type: array minItems: 1 items: - type: object - properties: - name: - type: string - minLength: 1 - url: - type: string - minLength: 1 - required: - - name - - url + $ref: ../../../non-pattern-schema/link.yaml required: - blockLink dependencies: