From a71cdcd623195c34e47652ce70eff4f02fbb2818 Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Tue, 4 Mar 2025 16:05:29 -0500 Subject: [PATCH] Removed federalist path from links --- .../digital.gov/layouts/partials/api/slug.html | 2 +- .../layouts/partials/api/topics-metadata.html | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/themes/digital.gov/layouts/partials/api/slug.html b/themes/digital.gov/layouts/partials/api/slug.html index 63baac401a..622f959913 100644 --- a/themes/digital.gov/layouts/partials/api/slug.html +++ b/themes/digital.gov/layouts/partials/api/slug.html @@ -3,5 +3,5 @@ "slug" : "{{- . -}}", {{- end -}} {{- if .Permalink -}} - "url" : "{{- .RelPermalink -}}" + "url" : "{{- replace .RelPermalink "preview/gsa/digitalgov.gov/nl-json-endpoints/" "" | safeURL -}}" {{- end -}} diff --git a/themes/digital.gov/layouts/partials/api/topics-metadata.html b/themes/digital.gov/layouts/partials/api/topics-metadata.html index 24e7742676..41eb236e18 100644 --- a/themes/digital.gov/layouts/partials/api/topics-metadata.html +++ b/themes/digital.gov/layouts/partials/api/topics-metadata.html @@ -46,17 +46,24 @@ {{- with $e -}} {{- $page := site.GetPage .link -}} {{- if $page -}} - { "field_featured_resource_href": "https://digital.gov{{ $page.RelPermalink }}"{{ if or $page.Title $page.Summary }},{{ end }} + { "field_featured_resource_href": + "https://digital.gov{{ $page.RelPermalink }}"{{ if or $page.Title $page.Summary }} + , + {{ end }} {{- if $page.Title -}} - "field_featured_resource_title": "{{ $page.Title }}"{{ if $page.Summary }},{{ end }} + "field_featured_resource_title": + "{{ $page.Title }}"{{ if $page.Summary }},{{ end }} {{- end -}} {{- if $page.Summary -}} "field_featured_resource_summary": "{{ $page.Summary }}" {{- end -}} - {{- else -}} - { "field_featured_resource_href": "{{ .link }}"{{ if or .title .summary }},{{ end }} + {{- else -}} + + { "field_featured_resource_href": + "{{ .link }}"{{ if or .title .summary }},{{ end }} {{- if .title -}} - "field_featured_resource_title": "{{ .title }}"{{ if .summary }},{{ end }} + "field_featured_resource_title": + "{{ .title }}"{{ if .summary }},{{ end }} {{- end -}} {{- if .summary -}} "field_featured_resource_summary": "{{ .summary }}"