p2pu / p2pu-website

The homepage of P2PU
https://www.p2pu.org
6 stars 12 forks source link
education learning

P2PU Website

This is the code for the home of P2PU, you can see it in action at www.p2pu.org. The master branch is deployed to a persistent staging environment at https://www-staging.p2pu.org/en/.

Updating content

Small changes are probably safe to do directly on the master branch, ex. updating the copy for a bio. But for most changes, you should

  1. create a branch of master,
  2. make your changes in that branch and then
  3. submit a PR to merge your branch into master.

This will setup a dynamic staging environment where you can preview your changes.

Site Data

The following content items are stored in YML files in the _data directory: FAQs, facilitator profiles, facilitator resources, funders, partners, people, presentations, projects, and the navigation items.

Facilitator profiles

To change the facilitator profiles, edit the text in the file /_data/facilitators.yml.

The corresponding images are in assets/images/facilitate. The images should have a maximum width of 2160px and a minimum width of 660px.

The number of facilitator profiles available in the rotation should be updated in assets/js/facilitate.js.

Development

All development should happen on a branch forked from master.

For development on your local workstation, you need Docker and docker-compose

Be sure to check out all git submodules

Building the site

Check out the code from GitHub and the submodules

Run the following command to get the needed data from the site:

curl https://learningcircles.p2pu.org/api/teams/ -o ./_data/teams.json
cat _data/teams.json | docker run -i --rm -v `pwd`:/opt/app -w /opt/app python:3-slim python3 _deploy/team_pages.py

Install node deps:

docker-compose run --rm node npm i

Install ruby deps:

mkdir .bundler
chown 1000:1000 .bundler
docker-compose run --rm jekyll bundle install

Start the server and webpack

docker-compose up

docker-compose run --rm node bash -c "cd p2pu-components && npm run transpile"

Overview

This is a static website that uses a few different APIs to provide user interaction with live data.

Dynamic staging environments

Deploying changes to production