Skip to content

Commit

Permalink
Removed federalist path from links
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-mon1 committed Mar 4, 2025
1 parent 0e27cc1 commit a71cdcd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion themes/digital.gov/layouts/partials/api/slug.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"slug" : "{{- . -}}",
{{- end -}}
{{- if .Permalink -}}
"url" : "{{- .RelPermalink -}}"
"url" : "{{- replace .RelPermalink "preview/gsa/digitalgov.gov/nl-json-endpoints/" "" | safeURL -}}"
{{- end -}}
17 changes: 12 additions & 5 deletions themes/digital.gov/layouts/partials/api/topics-metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}} <!-- fallback to external link if internal page not found -->
{ "field_featured_resource_href": "{{ .link }}"{{ if or .title .summary }},{{ end }}
{{- else -}}
<!-- fallback to external link if internal page not found -->
{ "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 }}"
Expand Down

0 comments on commit a71cdcd

Please sign in to comment.