This repo contains the source code for the pyOpenSci.org website. Contributions are welcome. Thank you pyOpenSci contributors!!
Please explore the site and let us know what your think. If you find a bug or have a suggestion for a new feature, open an issue.
If you are interested in contributing to pyOpenSci, please read about how we work in pyOpenSci's organization-wide contributing guide. This repo's CONTRIBUTING.md file provides more information about contributing to our website, our Python Packaging Guide and our Peer Review Guide.
Have you decided to contribute? We use the Jekyll framework for creating this site. To set up a development environment and run the site locally, follow these steps:
- Install ruby and bundler on your machine. See the Jekyll docs for instructions.
- Fork and clone this repository.
- Run
bundle install
in the root of the cloned repository directory. This will install the gems needed to run the site locally. - Run
bundle exec jekyll serve
to start the jekyll web server. NOTE: if you want the page to automatically reload, use:bundle exec jekyll serve --live reload.
This requires Jekyll 3.7 or higher. - Open your browser and navigate to
http://127.0.0.1:4000/
.
Please test your changes locally prior to submitting a pull request (PR).
If you are publishing a blog post with a date that is in the future, you can build the site locally using the --future
option to view it as follows:
bundle exec jekyll serve --future
.
We try to keep the image size of our graphics as small/compressed as possible. To enable webp on your system, you first need to install it:
For MAC:
brew install webp
Linux:
sudo apt-get install imagemagick
You can convert a directory of .png
images associated with a
blog post that you write using the following bash command:
for file in *.png; do cwebp "$file" -o "${file%.*}.webp"; done
or you can convert a single image:
cwebp input-image.png -o output-image.webp
Below is an example of how to add figure to a post that supports both .webp
and .png
formats. Providing both allows the website to be backwards-compatible with older browsers.
<figure>
<picture>
<source srcset="/images/image-name.webp" type="image/webp">
<img src="/images/image-name.png" alt="Alt text here" />
</picture>
</figure>
We have a bash script that will automatically update the last_updated
field in the YAML for all of our blog posts. To run it use:
./scripts/date-updated.sh
There are a few automated CI tasks in this repository to keep the website data up to date. In order for us to have visibility into when these jobs fail, we have automated a Slack bot to send a message to the #pyos-infrastructure
channel on Slack using the rtCamp/action-slack-notify GitHub Action step. This action can be used within any repository in the PyOpenSci GitHub organization (as SLACK_NOTIFICATIONS_BOT_TOKEN
is an org-wide secret) via:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: failure()
env:
SLACK_CHANNEL: pyos-infrastructure
SLACK_COLOR: '#db540b'
SLACK_LINK_NAMES: true
SLACKIFY_MARKDOWN: true
SLACK_MESSAGE: "Notification from GitHub Actions"
SLACK_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!