knowledge-hub
knowledge-hub copied to clipboard
Your one-stop shop in the fight against climate change, containing important climate resources you wish you knew about yesterday.
Update: A maintainer has gone on break. Will be back July 2024 ๐ค
The "behind the scenes" of the ClimateTown Knowledge Hub, your "one-stop shop" for important online resources in the fight against climate change!
How to suggest a resource
- Create an issue and select "โจResource Suggestion".
- Fill out the form. Please adhere to the instructions.
- Get the resource approved (or discuss it further in the issue).
- Once approved, resource is then onboarded onto the website. Resource onboarding happens at least once a month (on the first Sunday)!
Contributing
TLDR: Create an issue, or edit the content directly and make a pull request.
All contributions welcome! We embrace:
- suggestions
- fixing typos
- writing content
- helping with website development, and
- discussing content on the Hub (check out the channels on Discord for this!)
The following sections go through how you can make different contributions. These will require you having a GitHub account.
For any discussion or questions about the Knowledge Hub, join us in the #๐ฌknowledge-hub-discussion
channel in the Climate Town Discord.
Small edits/typos
Resources data (titles, URLs, descriptions, and tags) are stored in the data/resources.yml
file, which is then used to populate the resource on the website. To make small edits, you can directly edit this file or you can create an issue.
To suggest changes anywhere else in the site, you can use GitHub's search functionality to find the exact file in which to suggest them.
Resource suggestions
We're always looking to publicise awesome climate resources. Got a resource to share? The easiest way is to create an issue, filling out the "resource suggestion" form. This will create a discussion around the resource, and if it's a good fit for the Knowledge Hub, we'll add it to the site.
Site improvements
This website is powered by coders from the community. If you want to contribute to the website, please follow the following guidelines:
- Create suggestions as issues in the repository. Discuss suggestions before submitting a pull request (unless the improvement is objectively good; e.g. performance, accessibility).
- If you want to work on an issue, drop a comment on it (this helps prevent unnecessary doubling up of work). If someone working on an issue hasn't updated the issue in a few weeks, feel free to drop a comment of your own if you want to try it out.
Development setup
The site is primarily built using Svelte and SvelteKit, using Python for some additional tools in the codebase (eg. YouTube API, JSON schema validation). The following sections go through two options for installation, how to add Python dependencies, and setting up the YouTube API key.
โกQUICK SETUPโก
TLDR; simply click this badge to spin up a Codespaces cloud environment ๐บ
For local development, this repo provides a dev container to streamline installation (assuming you're familiar with Docker and have it installed). Building and running this container will install all dependencies for the project, and run the development server in the background piping the output to nohup.out
.
Manual installation
Alternatively, you can install all project dependencies manually in the OS of your choice.
Node and npm (for Svelte and SvelteKit)
- install Node and npm
-
git clone https://github.com/ClimateTown/knowledge-hub.git
-
cd
into the cloned directory -
npm install
-
npm run dev
OPTIONAL: Python
As mentioned above, Python is only responsible for some tooling in the codebase. For most changes to the site, Python is not required.
- install Python if you haven't already (minimum version 3.7)
- create a virtual environment, then activate it (optional, but recommended)
-
python -m venv venv
- activate the environment using either:
-
source venv/bin/activate
(Linux/MacOS) -
venv\Scripts\activate.bat
(Windows)
-
-
-
pip install -r requirements.txt
OPTIONAL: Pre-commit
This codebase uses pre-commit and pre-commit CI to run linting on code, format Python code, and generally have help with code quality.
To set up pre-commit locally:
- install the Python environment (which includes pre-commit)
-
pre-commit install
to install the hooks
To run pre-commit manually (without making a commit), use pre-commit run --all-files
. If you want to stop using pre-commit locally, just do pre-commit uninstall
.
Adding Python dependencies
This codebase uses pip-tools
to manage dependencies. If you add a new dependency, you can add it to requirements.in
and run pip-compile
to update requirements.txt
. To update your environment run pip-sync
.
YouTube API Keys
To set up the YouTube API (important for working on scripts with YouTube video scraping):
- Follow the python installation steps above
- Go to https://console.cloud.google.com and create account
- Go to https://console.cloud.google.com/apis/credential
- Make an API Key: Create Credentials > API Key
- Enable Youtube API v3 https://console.cloud.google.com/marketplace/product/google/youtube.googleapis.com
- Make a .env file in root folder (where this file is)
- Add YOUTUBE_API_KEY=YourApiKeyHere
- Run
python scripts/youtube.py
โจContributors
Thanks go to these wonderful people (emoji key):
Vecko ๐ป ๐ ๐ค ๐ง ๐ |
Danielle Bastien ๏ธ๏ธ๏ธ๏ธโฟ๏ธ ๐ป ๐ง ๐ |
azebramoomoo ๐ ๐จ |
Jacob John Jeevan ๐ป |
Chris King ๐ป |
Jarrod Baniqued ๐ ๐ |
Nick Tutterow ๐ป ๐ |
GBT7 ๐ |
Billy Taggart ๐ค |
Micahg05 ๐ป |
Forrest Cinelli ๐ |
Jordan Manley ๐ป |
![]() cpufreak101 ๐จ |
Paweล Andrys ๐ป |
Matthew Caughman ๐ |
LaserCar ๐ |
Isidro Molina ๐ป |
Christina Loiacono ๐ป |
River Mizell ๐ |
monedula ๐ |
Sourav Singh ๐ป |
Tommi Alajoki ๐ป |
Stephen Tanner ๐ |
This project follows the all-contributors specification. Contributions of any kind are, again, welcome!
Acknowledgements
- Bootstrap Icons for icons via svelte-bootstrap-icons
- Twemoji for emoji support