Skip to content

Create each program area page automatically using a layout #3328

@JessicaLucindaCheng

Description

@JessicaLucindaCheng

Dependencies

Overview

We want each program area page created dynamically so we don't have to manually code each page.

Action Items

For Developer

  • Take a look at the code and familiarize yourself with how the current individual project pages are created. This will give you an idea of how to approach this issue for dynamically creating the program area pages. In the Resources/Instructions section below, see Individual project page files to get started with understanding how layouts work for some files and links. You may need to look at additional code files and other resources to help with your understanding.
  • In _config.yml,
    • Find the collections variable and change the following:

      From:

        program-areas:
          output: false
      

      To:

        program-areas:
          output: true
      
    • Find the defaults variable and add the following:

        - scope:
            path: "_program-areas"
            type: "program-areas"
          values:
            layout: "program-area-pages"
      
  • In the pages directory, make the following changes to the citizen-engagement.html file
    • Rename the file to program-area-pages.html.
    • Move program-area-pages.html to the _layouts directory.
  • Each project's Markdown file (located in the _projects directory) has a program-area field, which indicates what program area(s) a project falls under (e.g., Citizen Engagement, Workforce Development, etc.). A project can have 1 or more program areas. In the program-area-pages.html file, use the current code in that file as a starting point and convert/modify the code so it becomes a reusable layout that will be used to dynamically render all the individual program area pages based on the program-area field in each project's Markdown file. You may need to add or edit other files.
    • In the Resources/Instructions section below, see Program Area files to get started for some files and links.
    • Do not make any changes to the following files: program-area-pages-cards-example.html and citizen-engagement-example.html.
    • Make sure the layout does the following:
      • Each dynamically created webpage's title should match the contents of the name variable in each of the files in _program-areas. For example, in the vote-representation.md file, the contents of the name variable is Vote / Representation, which is what the title should be in the webpage's header section.

      • Note: Currently, the header paragraphs will not make sense for each program area's webpage. This will be changed in a future issue. You will not need to make changes to these header paragraphs, so leave them as is.

        Click here to see the header paragraphs
      • In each project's Markdown file in _projects directory, there is a field called visible. If visible is true, then the project should show up on the program area page(s) it falls under. If visible is false, then the project should not show up.

      • When you check the program area pages that are dynamically generated, you will see some of the project cards show the project's name and the following message: We are currently drafting the Problem, Solution and Impact statements for this project. The message is only shown for the projects that are missing program area info (problem, solution, impact, sdg, card-image-src, sdg-image-src).

        • For example, _projects/100-automations.md has
          program-area:
            - Civic Tech Infrastructure
          
          but doesn't have any information for the program area (problem, solution, impact, sdg, card-image-src, sdg-image-src). Thus, this project's card should show up on the Civic Tech Infrastructure program area page and the card will have the project's name (100 Automations) and the following message: We are currently drafting the Problem, Solution and Impact statements for this project.
      • If a project has multiple program areas, the problem, solution, sdg, etc info will be the same on the cards for each project. The same card/program area info will just show up on multiple program area pages.

        • For example, the Hackforla.org Website project's Markdown file (located in _projects/website.md) has
          program-area:
            - Workforce Development
            - Civic Tech Infrastructure
          
          So, the same card for the Hackforla.org Website project should show up on the Workforce Development program area page and the Civic Tech Infrastructure program area page.
  • Once the program-area-pages.html layout works,
    • In _sass/components, change the filename _citizen_engagement.scss to _program-area-pages.scss
    • Then, in _sass/main.scss change
      @import 'components/citizen_engagement.scss';
      
      to
      @import 'components/program-area-pages.scss';
      
  • Using Docker, check the following:
    • Check the Citizen Engagement example page (note the URL to check it in Docker will be localhost:4000/citizen-engagement-example) still looks the same and all the links work the same as the one on the live website, https://www.hackforla.org/citizen-engagement
    • Check the Citizen Engagement page (note the new URL to check it in Docker will be localhost:4000/program-areas/citizen-engagement) still looks the same and all the links work the same as the one on the live website, https://www.hackforla.org/citizen-engagement
    • Check there is a dynamically generated page for each program area:
      • Citizen Engagement (localhost:4000/program-areas/citizen-engagement)
      • Civic Tech Infrastructure (localhost:4000/program-areas/civic-tech-infrastructure)
      • Diversity, Equity & Inclusion (localhost:4000/program-areas/diversity-equity-inclusion)
      • Environment (localhost:4000/program-areas/environment)
      • Justice (localhost:4000/program-areas/justice)
      • Social Safety Net (localhost:4000/program-areas/social-safety-net)
      • Vote / Representation (localhost:4000/program-areas/vote-representation)
      • Workforce Development (localhost:4000/program-areas/workforce-development)
    • Check that nothing breaks on the website in both desktop, tablet, and mobile views

Resources/Instructions

For QA

When this issue is done,

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In progress (actively working)

Relationships

None yet

Development

No branches or pull requests

Issue actions