mirror of
https://github.com/loot/loot.github.io.git
synced 2026-07-27 14:13:30 -07:00
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.
25 lines
1.7 KiB
Markdown
25 lines
1.7 KiB
Markdown
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](https://gohugo.io), and uses [Material Design Lite](https://www.getmdl.io/), [js-yaml](https://github.com/nodeca/js-yaml), [j-toml](https://github.com/LongTengDao/j-toml) and [Octokit.js](https://github.com/octokit/rest.js), which are managed using NPM. The easiest way to build it is to:
|
|
|
|
1. Download and install [Node.js](https://nodejs.org/en/download).
|
|
2. Download a [prebuilt Hugo binary](https://github.com/gohugoio/hugo/releases/latest).
|
|
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.
|