Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display upcoming events to community page #8075

Merged
merged 16 commits into from
Oct 23, 2024

Conversation

nick-mon1
Copy link
Contributor

@nick-mon1 nick-mon1 commented Oct 17, 2024

Summary

Update front matter fields and template to display future events on a communities page.

  1. Individual community page will show upcoming events
  2. Events tagged with multiple communities will display for each respective community

Preview

Link to Preview

Solution

  • ef1137d fixes a variable naming mis-match. Event pages were using cop_events and get-upcomingevents.html referenced events_cop.

  • b8c9ad1 removes old cop_events field.

  • 694ea03 enables displaying one event across multiple communities.

Front Matter Updates

event page

---
event_cop:
  - multilingual
  - communicators
---

community page

event_cop: communicators
Screenshot 2024-10-17 at 10 07 32 AM

How To Test

  1. Future date an event if one does not exist
date: 2024-10-?? 14:00:00 -0500
end_date: 2024-10-?? 15:00:00 -0500
  1. Add event_cop field to future event using value from themes/digital.gov/static/workflow/config.yml
  2. Visit community page to see list of upcoming events

What To Test

  1. Display future events for a community page
  2. Display no future events for a non tagged community page
  3. Display no future events when there are none
  4. Display multiple future events for a community page

Copy link

🔍 Preview in Federalist

@nick-mon1 nick-mon1 self-assigned this Oct 21, 2024
@nick-mon1 nick-mon1 added the Dev: Template Logic Fixes and improvements associated with our static site generator label Oct 21, 2024
@nick-mon1 nick-mon1 changed the title Fix community upcoming events Display upcoming events to community page Oct 22, 2024
@nick-mon1 nick-mon1 marked this pull request as ready for review October 22, 2024 14:17
RileySeaburg added a commit that referenced this pull request Oct 22, 2024
Copy link
Member

@RileySeaburg RileySeaburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nick-mon1

I get an error when testing this
Logs


2024-10-22 19:06:47 INFO [build-hugo] hugo version: $(/tmp/work/hugo version)

2024-10-22 19:06:47 INFO [build-hugo] Building site with hugo

2024-10-22 19:06:47 INFO [build-hugo] Start building sites …

2024-10-22 19:06:47 INFO [build-hugo] hugo v0.133.1-47d00202e7e61769ce4d14691e43b27852c9cce4 linux/amd64 BuildDate=2024-08-26T13:58:46Z VendorInfo=gohugoio

2024-10-22 19:06:58 INFO [build-hugo] Total in 11496 ms

2024-10-22 19:06:58 INFO [build-hugo] Error: error building site: render: failed to render pages: render of "page" failed: "/tmp/work/site_repo/themes/digital.gov/layouts/communities/single.html:61:18": execute of template failed: template: communities/single.html:61:18: executing "content" at <partial "core/get-upcomingevents.html" .>: error calling partial: "/tmp/work/site_repo/themes/digital.gov/layouts/partials/core/get-upcomingevents.html:14:15": execute of template failed: template: partials/core/get-upcomingevents.html:14:15: executing "partials/core/get-upcomingevents.html" at <strings.Contains>: error calling Contains: unable to cast []string{"communicators"} of type []string to string

2024-10-22 19:06:58 ERROR [main] There was a problem running Hugo, see the above logs for details.

@nick-mon1
Copy link
Contributor Author

@RileySeaburg Fixed the previous merge conflicts that were causing the build error.

Copy link
Member

@RileySeaburg RileySeaburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool this works for me.

image

@ToniBonittoGSA I'll let you do the content audit and merge if you feel it's ready.

@ToniBonittoGSA ToniBonittoGSA merged commit a123398 into main Oct 23, 2024
8 checks passed
@ToniBonittoGSA ToniBonittoGSA deleted the nl-update-community-upcoming-events branch October 23, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev: Template Logic Fixes and improvements associated with our static site generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants