-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7748 from GSA/Update-Community-Links-Events
- Loading branch information
Showing
2 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
themes/digital.gov/layouts/partials/core/primary-communities.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{/* ====================================== | ||
Displays a vertical list of primary CoP's on the sidebar on event pages. | ||
====================================== | ||
*/}} | ||
{{ $mainCommunities := (where .Site.Pages "Section" "communities") }} | ||
{{ $mainCommunities = (where $mainCommunities ".Params.dg_highlight" "eq" true) }} | ||
{{ $featuredCommunity := (where $mainCommunities ".Params.weight" "eq" 2) }} | ||
{{ $mainCommunities = union $featuredCommunity $mainCommunities }} | ||
{{ $mainCommunities = first 8 ($mainCommunities.ByTitle) }} | ||
|
||
{{/* Check if there are main community pages to display */}} | ||
{{- with $mainCommunities -}} | ||
<article class="dg-promos dg-related-communities"> | ||
<h3 class="dg-promos__heading">Join a Community</h3> | ||
<ul class="dg-promos__list"> | ||
{{- range . -}} | ||
<li class="promo dg-promos__list-item"> | ||
<a | ||
href="{{ .Permalink }}?promo" | ||
title="Visit {{ .Title }} community page" | ||
class="dg-promos__link" | ||
> | ||
{{ .Title }} | ||
</a> | ||
</li> | ||
{{- end -}} | ||
</ul> | ||
<footer class="dg-promos__footer"> | ||
{{ $communityCount := len (where $.Site.RegularPages "Section" "communities") }} | ||
<a | ||
href="{{ "communities" | relURL }}" | ||
class="dg-promos__more-link dg-more-link" | ||
> | ||
<span> See all {{ $communityCount }} communities </span> | ||
<svg | ||
class="usa-icon dg-icon dg-icon--small margin-bottom-05" | ||
aria-hidden="true" | ||
focusable="false" | ||
> | ||
<use | ||
xlink:href="{{ "uswds/img/sprite.svg#arrow_forward" | relURL }}" | ||
></use> | ||
</svg> | ||
</a> | ||
</footer> | ||
</article> | ||
{{- end -}} |