Skip to content

Commit 27d5607

Browse files
authored
Dynamically Created Pages for each Program Area Using a Layout (#8437)
* changed program-areas to true * added program-areas to default * renamed citizen-engagement.html and moved to _layouts * made card appear based on page program area * made title reflect the page * renamed _citizen_engagement.scss file and updated import in main.scss
1 parent a83b152 commit 27d5607

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

_config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ collections:
3232
design-system:
3333
output: true
3434
program-areas:
35-
output: false
35+
output: true
3636

3737
# Please refer to the documentation here[https://jekyllrb.com/docs/configuration/front-matter-defaults/] before modifying defaults
3838
# The settings below reads as so
@@ -56,6 +56,11 @@ defaults: # The `defaults` key holds an array of scope/values pairs that define
5656
type: "guide-pages"
5757
values:
5858
layout: "guide-pages"
59+
- scope:
60+
path: "_program-areas"
61+
type: "program-areas"
62+
values:
63+
layout: "program-area-pages"
5964

6065
plugins:
6166
- jekyll-sitemap

_includes/program-area-pages-cards.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- These are the cards found on a program area page, such as the cards on https://www.hackforla.org/citizen-engagement webpage. -->
22

3-
{% assign visible_projects = site.projects | where: "program-area", "Citizen Engagement" | where: "visible", "true" %}
3+
{% assign visible_projects = site.projects | where: "program-area", page["program-area"] | where: "visible", "true" %}
44
{% for item in visible_projects %}
55
{%- if
66
item.problem.size > 0 and
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
22
layout: default
3-
title: Citizen Engagement
4-
permalink: /citizen-engagement
53
---
64
<!-- Header banner -->
75
<div class="header-container flex-container program-header-container">
86
<div class="header-text">
9-
<h1 class="title1">Citizen Engagement</h1>
7+
<h1 class="title1">{{page.name}}</h1>
108
<p>
119
We at Hack for LA are volunteers that believe in building technology
1210
and analyzing data to make it easier to participate effectively in your community.
@@ -48,7 +46,7 @@ <h3>Organizations We Work With</h3>
4846
<div class="organizations-images">
4947
{% assign partners = site.data.internal.partners %}
5048
{% for partner in partners %}
51-
{% if partner.program-area contains "Citizen Engagement" %}
49+
{% if partner["program-area"] contains page["program-area"] %}
5250
<img class="org-img org-img-large" src="{{ partner.image }}" alt="{{ partner.name }}">
5351
{% endif %}
5452
{% endfor %}

_sass/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
@import 'components/donate.scss';
6868
@import 'components/donate-components.scss';
6969
@import 'components/design-system.scss';
70-
@import 'components/citizen_engagement.scss';
70+
@import 'components/program-area-pages.scss';
7171
@import 'components/privacy-policy.scss';
7272
@import 'components/guides.scss';
7373

0 commit comments

Comments
 (0)