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 you 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, start with
CONTRIBUTING.md β local setup, website development,
and how to add a multi-page documentation book (layout: docs) on the Hugo
site.
For organization-wide norms, see pyOpenSci's organization-wide contributing guide.
This site is built with Hugo. Source lives at the repository
root (content/, data/, themes/clean-hugo/).
- Hugo Extended
0.139.4(matches Netlify and CI) - Node.js
24(Active LTS) and npm (PostCSS / autoprefixer for the theme CSS pipeline). An.nvmrcis in the repo root β runnvm useif you use nvm.
-
Fork and clone this repository.
-
From the repo root, install Node dependencies:
npm ci
-
Start the Hugo development server:
hugo server --disableFastRender
Use
--disableFastRenderwhile editing layouts or CSS so changes rebuild reliably. -
Open http://localhost:1313/ in your browser.
Test your changes locally before opening a pull request. CI runs the same Hugo
build as Netlify (see .github/workflows/build-site.yml).
npm ci
hugo --gc --minifyOutput is written to public/. Do not commit public/, resources/, or
.hugo_build.lock β they are gitignored.
buildFuture = true is set in hugo.toml, so posts with a future date in front
matter are included in local builds and production deploys without extra flags.
| Path | Purpose |
|---|---|
content/ |
Pages, blog posts (content/blog/), events (content/events/) |
data/ |
YAML data (packages.yml, contributors.yml, etc.) |
themes/clean-hugo/ |
Site theme (layouts, SCSS, shortcodes) |
static/ |
Images, favicons, Netlify _redirects |
hugo.toml |
Site config, navigation, theme parameters |
For CSS architecture, SCSS partials, and Netlify build details, see DEVELOPMENT.md. For contributor workflows and the docs book layout, see CONTRIBUTING.md.
We try to keep image file sizes as small as practical. To convert PNG images to WebP:
macOS:
brew install webpLinux:
sudo apt-get install webpConvert every PNG in a directory:
for file in *.png; do cwebp "$file" -o "${file%.*}.webp"; doneOr convert a single image:
cwebp input-image.png -o output-image.webpExample figure markup that supports both WebP and PNG (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>Store site images under static/images/ (published as /images/...).
We have a bash script that updates the last_modified field in YAML for blog posts
that already include a last_modified: key in front matter:
chmod +x scripts/date-updated.sh
./scripts/date-updated.shThe script scans content/blog/ for posts that include a last_modified: key
in front matter.
Update a contributor's name on the Our Community page in data/contributors.yml.
Important: Do not update contributor names in data/packages.yml. Changes there can be overwritten by automated workflows.
contributors.yml is the source of truth for people metadata; names are gathered
from contributor files using each person's GitHub username.
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-maintainers-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-maintainers-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!