Contributing to Open Source Football
A brief guide on how to contribute content.
Preface
The primary goal of Open Source Football is to make football analysis and the code behind it publicly available. To achieve this, we need volunteers who are willing to contribute.
Posts are written with Quarto in R or Python (or any other language Quarto supports). If something in this guide is unclear or wrong, please open an issue.
Overview
- Fork and clone the repository, and create a branch.
- Copy a post template to
posts/YYYY-MM-DD-short-title/. - Write your post.
- Render it locally. This runs your code once and stores the results in
_freeze/. - Commit your post folder and
_freeze/, then open a pull request.
We will review the post, suggest changes if necessary, and publish it by merging the pull request.
1. Fork, clone, and branch
You need Quarto (≥ 1.7), git, and the language you write in: for R, the rmarkdown and knitr packages; for Python, jupyter.
usethis::create_from_github("nflverse/open-source-football")
usethis::pr_init(branch = "my-post-title")The repository has a long history. --filter=blob:none makes the clone much smaller and faster.
gh repo fork nflverse/open-source-football --clone -- --filter=blob:none
cd open-source-football
git switch -c my-post-title2. Copy a template
Copy the R or the Python template and give the folder a date-prefixed, descriptive name:
cp -r _post_template posts/2026-01-15-my-post-title # R
cp -r _post_template_python posts/2026-01-15-my-post-title # Python3. Write your post
Open posts/2026-01-15-my-post-title/index.qmd, fill in the metadata (title, description, author, date, categories), and write. The template shows the basics. Please keep in mind:
- Readers should be able to rerun your code years later. Load data from public sources such as nflreadr or nflreadpy, not from local files. Don’t commit large data files.
- Keep the Session info section at the end of the template. It records the package versions you used. You don’t need renv or a lockfile.
- The first figure becomes the preview image on the home page. To pick a different one, set
image:in the metadata to a file in your post folder. - Use
#| column: pageon cells with wide figures or tables. - The site has a light and a dark mode. Figures with a white background work in both.
4. Render
quarto render posts/2026-01-15-my-post-title/index.qmdThis runs your code and writes the results to _freeze/. The website build reuses these frozen results and never runs your code itself, so your post keeps working even when data or packages change later. If you edit the post afterwards, render it again.
To see the post in the site while you write, use quarto preview with the same path instead.
5. Commit and open a pull request
Commit your post folder and everything new in _freeze/ (your results, plus any JavaScript and CSS of interactive widgets such as plotly in _freeze/site_libs/). Don’t commit the _site/ folder.
git add posts/2026-01-15-my-post-title _freeze
git commit -m "Add post: My post title"usethis::pr_push()git push -u origin my-post-title
gh pr createA check on your pull request builds the whole site. It fails if _freeze/ is missing or older than your post; render again and commit to fix it (you can run the same check locally with _scripts/check-freeze.sh). The rendered site is attached to the check as a downloadable site-preview artifact.
That’s it. Thanks for your contribution!