Skip to content

Commit

Permalink
Merge pull request GSA#8348 from GSA/nl-update-join-community-template
Browse files Browse the repository at this point in the history
IA: Link to DG CoPs only in the "Join a Community" column
  • Loading branch information
ToniBonittoGSA authored Jan 22, 2025
2 parents 5d3d769 + 16372f8 commit 3aa91ed
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions themes/digital.gov/layouts/partials/core/get_related.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,15 @@
======================================
*/}}

{{/* Communities ====================== */}}

{{/* gets all pages in the site that are related */}}
{{- $related_pages := .Site.Pages.Related . -}}

{{/* gets only the related community pages */}}
{{- $.Scratch.Set "communities" (where $related_pages "Section" "communities") -}}

{{/* Now conditionally shuffle the community pages and pick the first 5 */}}
{{ if (gt (len ($.Scratch.Get "communities")) 5) }}
{{- $.Scratch.Set "communities" (first 5 ($.Scratch.Get "communities") | shuffle) -}}
{{ end }}
{{ $communities := ($.Scratch.Get "communities") }}
{{ $featured_communities := (where (where .Site.Pages "Section" "communities").ByTitle ".Params.dg_highlight" "eq" true) }}

{{/* If there are community pages... */}}
{{- with $communities -}}
{{- with $featured_communities -}}
<article class="dg-promos dg-related-communities">
<h3 class="dg-promos__heading">Join a Community</h3>

<ul class="dg-promos__list">
{{- range $communities -}}
{{- range $featured_communities -}}
<li class="promo dg-promos__list-item">
<a
href="{{ .Permalink }}?promo"
Expand All @@ -39,7 +27,6 @@ <h3 class="dg-promos__heading">Join a Community</h3>
<footer class="dg-promos__footer">
{{ $communityCount := len (where $.Site.RegularPages "Section" "communities") }}


<a
href="{{ "communities" | relURL }}"
class="dg-promos__more-link dg-more-link"
Expand Down

0 comments on commit 3aa91ed

Please sign in to comment.