Files
Oliver Hamlet aa66a10fd8 Fetch contributors data at build time
It's currently easy to hit the GitHub API's rate limit just by refreshing the credits page a couple of times. The data doesn't change that frequently, so instead fetch it into a JSON file as part of the build process, have Hugo generate the page using the JSON file and a template, and deploy the site each day at midnight so that the live data is at most 24 hours old.
2026-01-11 22:57:28 +00:00

1.7 KiB

loot.github.io

This repository acts as the main LOOT team repository, and holds all the issues that aren't specific to the code or any one game. In addition to that, it also holds LOOT's static website.

The website is generated using Hugo, and uses Material Design Lite, js-yaml, j-toml and Octokit.js, which are managed using NPM. The easiest way to build it is to:

  1. Download and install Node.js.
  2. Download a prebuilt Hugo binary.
  3. Add the binary to your PATH.
  4. Run npm ci from the root of this repository.
  5. Run hugo from the root of this repository.

Hugo will create the generated site in the public folder.

To view the site locally, run hugo server, the site will then be accessible at http://localhost:1313.

Regenerating contributor data

The contributors data is stored in a JSON file that can be regenerated by running node generate_contributors_json.js.

Fetching the data uses the GitHub REST API to query the loot organization's repositories, and then fetch the contributor data for each, so running the script frequently can hit GitHub's rate limits. A personal access token can be supplied in the GITHUB_TOKEN environment variable to benefit from the higher rate limits used for authenticated API access: only read access to public repositories is needed.

The script is run as part of the website's GitHub Actions deployment workflow, which runs daily at midnight UTC, so https://loot.github.io/credits/ won't show any contributions made in the time since the last deployment.