Skip to content

Commit

Permalink
Merge pull request #891 from GSA/jf/filter-tech-talks
Browse files Browse the repository at this point in the history
Display only Tech Talks from the past two years
  • Loading branch information
jfredrickson authored Apr 26, 2024
2 parents efd9379 + c3206b4 commit 0f8a77a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions content/techtalks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Tech Talks
menu:
primary:
build:
render: always
cascade:
- build:
render: never
---

The GSA CTO team hosts in-depth Tech Talks, where presenters discuss technology topics affecting the agency. Each Tech Talk is a 30-minute informal meeting with an audience of internal GSA members. Demonstrations are often provided along with follow-up Q&A. Registration is limited to internal GSA personnel. To register to attend a Tech Talk event, please contact Joe Novak at [[email protected]](mailto:[email protected]).
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/pagination.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/* Based on: */}}
{{/* https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/pagination.html */}}

{{ $pag := $.Paginator }}
{{ $pag := . }}

{{ if gt $pag.TotalPages 1 -}}
<nav aria-label="Pagination" class="usa-pagination">
Expand Down
9 changes: 6 additions & 3 deletions layouts/techtalks/list.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{{ define "main" }}
{{ $twoYearsAgo := now.AddDate -2 0 0 }}
{{ $recentTechTalks := where .Pages "Date" "ge" $twoYearsAgo }}
{{ $paginator := .Paginate $recentTechTalks }}

<div class="grid-container">

<h1>Tech Talks</h1>

{{ .Content }}

{{ partial "pagination.html" . }}
{{ partial "pagination.html" $paginator }}

<ul class="usa-card-group">
{{ range .Paginator.Pages }}
{{ range $paginator.Pages }}
<li class="tablet:grid-col-12 usa-card">
<div class="usa-card__container">
<header class="usa-card__header">
Expand Down Expand Up @@ -42,7 +45,7 @@ <h3>Who</h3>
{{ end }}
</ul>

{{ partial "pagination.html" . }}
{{ partial "pagination.html" $paginator }}

</div>

Expand Down

0 comments on commit 0f8a77a

Please sign in to comment.