From aa66a10fd81167cb21b8b9dbc4528e61d7bdca18 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 11 Jan 2026 22:57:28 +0000 Subject: [PATCH] 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. --- .github/workflows/hugo.yml | 7 + README.md | 8 + content/credits/contributors.json | 1198 +++++++++++++++++ content/credits/index.html | 5 +- ...redits.js => generate_contributors_json.js | 62 +- layouts/credits.html | 22 + 6 files changed, 1246 insertions(+), 56 deletions(-) create mode 100644 content/credits/contributors.json rename content/credits/credits.js => generate_contributors_json.js (79%) create mode 100644 layouts/credits.html diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index b109f05..cc80c6e 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -4,6 +4,8 @@ on: push: branches: - master + schedule: + - cron: 0 0 * * * workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages @@ -50,6 +52,11 @@ jobs: - name: Install Node.js dependencies run: npm ci + - name: Fetch contributors data + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: node generate_contributors_json.js + - name: Build with Hugo env: HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache diff --git a/README.md b/README.md index 44cdb7f..266f687 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,11 @@ The website is generated using [Hugo](https://gohugo.io), and uses [Material Des 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 . + +## 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 won't show any contributions made in the time since the last deployment. diff --git a/content/credits/contributors.json b/content/credits/contributors.json new file mode 100644 index 0000000..a98b54b --- /dev/null +++ b/content/credits/contributors.json @@ -0,0 +1,1198 @@ +[ + { + "contributions": 7813, + "name": "Ortham", + "avatar_url": "https://avatars.githubusercontent.com/u/2430738?v=4", + "html_url": "https://github.com/Ortham" + }, + { + "contributions": 3720, + "name": "MacSplody", + "avatar_url": "https://avatars.githubusercontent.com/u/1944639?v=4", + "html_url": "https://github.com/MacSplody" + }, + { + "contributions": 1764, + "name": "sibir-ine", + "avatar_url": "https://avatars.githubusercontent.com/u/69141501?v=4", + "html_url": "https://github.com/sibir-ine" + }, + { + "contributions": 1250, + "name": "Sabre142", + "avatar_url": "https://avatars.githubusercontent.com/u/26516348?v=4", + "html_url": "https://github.com/Sabre142" + }, + { + "contributions": 982, + "name": "pStyl3", + "html_url": "mailto:qp-game@gmx.de" + }, + { + "contributions": 679, + "name": "Freso", + "avatar_url": "https://avatars.githubusercontent.com/u/177659?v=4", + "html_url": "https://github.com/Freso" + }, + { + "contributions": 400, + "name": "kymckay", + "avatar_url": "https://avatars.githubusercontent.com/u/5459452?v=4", + "html_url": "https://github.com/kymckay" + }, + { + "contributions": 375, + "name": "Sharlikran", + "avatar_url": "https://avatars.githubusercontent.com/u/1912426?v=4", + "html_url": "https://github.com/Sharlikran" + }, + { + "contributions": 371, + "name": "unknown", + "html_url": "mailto:qp-game@gmx.de" + }, + { + "contributions": 364, + "name": "dependabot[bot]", + "avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4", + "html_url": "https://github.com/apps/dependabot" + }, + { + "contributions": 262, + "name": "ProbablyManuel", + "avatar_url": "https://avatars.githubusercontent.com/u/25909324?v=4", + "html_url": "https://github.com/ProbablyManuel" + }, + { + "contributions": 178, + "name": "egocarib", + "avatar_url": "https://avatars.githubusercontent.com/u/3429497?v=4", + "html_url": "https://github.com/egocarib" + }, + { + "contributions": 159, + "name": "IllusiveMan196", + "avatar_url": "https://avatars.githubusercontent.com/u/29149835?v=4", + "html_url": "https://github.com/IllusiveMan196" + }, + { + "contributions": 126, + "name": "Infernio", + "avatar_url": "https://avatars.githubusercontent.com/u/2845240?v=4", + "html_url": "https://github.com/Infernio" + }, + { + "contributions": 108, + "name": "ddbb07", + "avatar_url": "https://avatars.githubusercontent.com/u/50288525?v=4", + "html_url": "https://github.com/ddbb07" + }, + { + "contributions": 99, + "name": "Superfly Johnson", + "html_url": "mailto:superfly.johnson@outlook.com" + }, + { + "contributions": 95, + "name": "WilliamImm", + "avatar_url": "https://avatars.githubusercontent.com/u/1304819?v=4", + "html_url": "https://github.com/WilliamImm" + }, + { + "contributions": 70, + "name": "TokcDK", + "avatar_url": "https://avatars.githubusercontent.com/u/5264340?v=4", + "html_url": "https://github.com/TokcDK" + }, + { + "contributions": 66, + "name": "sean-kang", + "avatar_url": "https://avatars.githubusercontent.com/u/2367370?v=4", + "html_url": "https://github.com/sean-kang" + }, + { + "contributions": 65, + "name": "RacerBG", + "avatar_url": "https://avatars.githubusercontent.com/u/68707872?v=4", + "html_url": "https://github.com/RacerBG" + }, + { + "contributions": 61, + "name": "weblate", + "avatar_url": "https://avatars.githubusercontent.com/u/1607653?v=4", + "html_url": "https://github.com/weblate" + }, + { + "contributions": 40, + "name": "DoubleYouC", + "avatar_url": "https://avatars.githubusercontent.com/u/66910033?v=4", + "html_url": "https://github.com/DoubleYouC" + }, + { + "contributions": 39, + "name": "DaCoolX", + "avatar_url": "https://avatars.githubusercontent.com/u/2771553?v=4", + "html_url": "https://github.com/DaCoolX" + }, + { + "contributions": 34, + "name": "MaddBomber83", + "html_url": "mailto:maddbomber83+github@gmail.com" + }, + { + "contributions": 34, + "name": "robertgk2017", + "avatar_url": "https://avatars.githubusercontent.com/u/20867977?v=4", + "html_url": "https://github.com/robertgk2017" + }, + { + "contributions": 28, + "name": "cecell", + "avatar_url": "https://avatars.githubusercontent.com/u/1248121?v=4", + "html_url": "https://github.com/cecell" + }, + { + "contributions": 27, + "name": "omniguous", + "avatar_url": "https://avatars.githubusercontent.com/u/82130105?v=4", + "html_url": "https://github.com/omniguous" + }, + { + "contributions": 25, + "name": "3ventic", + "avatar_url": "https://avatars.githubusercontent.com/u/3998628?v=4", + "html_url": "https://github.com/3ventic" + }, + { + "contributions": 24, + "name": "markekraus", + "avatar_url": "https://avatars.githubusercontent.com/u/6509955?v=4", + "html_url": "https://github.com/markekraus" + }, + { + "contributions": 24, + "name": "wxMichael", + "avatar_url": "https://avatars.githubusercontent.com/u/10516759?v=4", + "html_url": "https://github.com/wxMichael" + }, + { + "contributions": 23, + "name": "loicreynier", + "avatar_url": "https://avatars.githubusercontent.com/u/88983487?v=4", + "html_url": "https://github.com/loicreynier" + }, + { + "contributions": 22, + "name": "darthbdaman", + "html_url": "mailto:stevenefranklin@gmail.com" + }, + { + "contributions": 22, + "name": "Trollmen", + "avatar_url": "https://avatars.githubusercontent.com/u/5051915?v=4", + "html_url": "https://github.com/Trollmen" + }, + { + "contributions": 20, + "name": "kuroko137", + "avatar_url": "https://avatars.githubusercontent.com/u/31824990?v=4", + "html_url": "https://github.com/kuroko137" + }, + { + "contributions": 20, + "name": "silentdark", + "avatar_url": "https://avatars.githubusercontent.com/u/10727853?v=4", + "html_url": "https://github.com/silentdark" + }, + { + "contributions": 18, + "name": "github-actions[bot]", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "html_url": "https://github.com/apps/github-actions" + }, + { + "contributions": 17, + "name": "quincyjo", + "avatar_url": "https://avatars.githubusercontent.com/u/7012390?v=4", + "html_url": "https://github.com/quincyjo" + }, + { + "contributions": 17, + "name": "RuiNtD", + "avatar_url": "https://avatars.githubusercontent.com/u/1149870?v=4", + "html_url": "https://github.com/RuiNtD" + }, + { + "contributions": 16, + "name": "tygyh", + "avatar_url": "https://avatars.githubusercontent.com/u/32486062?v=4", + "html_url": "https://github.com/tygyh" + }, + { + "contributions": 16, + "name": "xsSplater", + "avatar_url": "https://avatars.githubusercontent.com/u/21146468?v=4", + "html_url": "https://github.com/xsSplater" + }, + { + "contributions": 14, + "name": "themayor897", + "avatar_url": "https://avatars.githubusercontent.com/u/72107566?v=4", + "html_url": "https://github.com/themayor897" + }, + { + "contributions": 13, + "name": "BellCubeDev", + "avatar_url": "https://avatars.githubusercontent.com/u/33764825?v=4", + "html_url": "https://github.com/BellCubeDev" + }, + { + "contributions": 13, + "name": "charabaruk", + "avatar_url": "https://avatars.githubusercontent.com/u/130681?v=4", + "html_url": "https://github.com/charabaruk" + }, + { + "contributions": 13, + "name": "EssArrBee", + "avatar_url": "https://avatars.githubusercontent.com/u/5921976?v=4", + "html_url": "https://github.com/EssArrBee" + }, + { + "contributions": 13, + "name": "MothHeart", + "html_url": "mailto:kristianityofficial+4@gmail.com" + }, + { + "contributions": 12, + "name": "dm703", + "avatar_url": "https://avatars.githubusercontent.com/u/103306564?v=4", + "html_url": "https://github.com/dm703" + }, + { + "contributions": 12, + "name": "garthand", + "avatar_url": "https://avatars.githubusercontent.com/u/8093079?v=4", + "html_url": "https://github.com/garthand" + }, + { + "contributions": 12, + "name": "lpradel", + "avatar_url": "https://avatars.githubusercontent.com/u/582842?v=4", + "html_url": "https://github.com/lpradel" + }, + { + "contributions": 12, + "name": "RowanSkie", + "avatar_url": "https://avatars.githubusercontent.com/u/11764533?v=4", + "html_url": "https://github.com/RowanSkie" + }, + { + "contributions": 12, + "name": "Yinsolaya", + "avatar_url": "https://avatars.githubusercontent.com/u/63832536?v=4", + "html_url": "https://github.com/Yinsolaya" + }, + { + "contributions": 11, + "name": "Kyo-70", + "avatar_url": "https://avatars.githubusercontent.com/u/80365066?v=4", + "html_url": "https://github.com/Kyo-70" + }, + { + "contributions": 11, + "name": "YanJunSunYJS", + "avatar_url": "https://avatars.githubusercontent.com/u/34938411?v=4", + "html_url": "https://github.com/YanJunSunYJS" + }, + { + "contributions": 9, + "name": "Arthmoor", + "avatar_url": "https://avatars.githubusercontent.com/u/1762652?v=4", + "html_url": "https://github.com/Arthmoor" + }, + { + "contributions": 9, + "name": "greenkeeper[bot]", + "avatar_url": "https://avatars.githubusercontent.com/in/505?v=4", + "html_url": "https://github.com/apps/greenkeeper" + }, + { + "contributions": 9, + "name": "steamb23", + "avatar_url": "https://avatars.githubusercontent.com/u/6805899?v=4", + "html_url": "https://github.com/steamb23" + }, + { + "contributions": 8, + "name": "Graybark", + "avatar_url": "https://avatars.githubusercontent.com/u/24878945?v=4", + "html_url": "https://github.com/Graybark" + }, + { + "contributions": 8, + "name": "LuthienKess", + "html_url": "mailto:luthien_kess@yahoo.com" + }, + { + "contributions": 8, + "name": "Ravernstal", + "avatar_url": "https://avatars.githubusercontent.com/u/110842049?v=4", + "html_url": "https://github.com/Ravernstal" + }, + { + "contributions": 8, + "name": "shadowslasher410", + "avatar_url": "https://avatars.githubusercontent.com/u/13404137?v=4", + "html_url": "https://github.com/shadowslasher410" + }, + { + "contributions": 8, + "name": "Xahtax", + "avatar_url": "https://avatars.githubusercontent.com/u/52102338?v=4", + "html_url": "https://github.com/Xahtax" + }, + { + "contributions": 7, + "name": "ElArGee", + "avatar_url": "https://avatars.githubusercontent.com/u/6357112?v=4", + "html_url": "https://github.com/ElArGee" + }, + { + "contributions": 7, + "name": "flatwhatson", + "avatar_url": "https://avatars.githubusercontent.com/u/24718616?v=4", + "html_url": "https://github.com/flatwhatson" + }, + { + "contributions": 7, + "name": "fwdekker", + "avatar_url": "https://avatars.githubusercontent.com/u/13442533?v=4", + "html_url": "https://github.com/fwdekker" + }, + { + "contributions": 6, + "name": "BraniganMatthew", + "avatar_url": "https://avatars.githubusercontent.com/u/73545060?v=4", + "html_url": "https://github.com/BraniganMatthew" + }, + { + "contributions": 6, + "name": "cpasmoi", + "avatar_url": "https://avatars.githubusercontent.com/u/39828699?v=4", + "html_url": "https://github.com/cpasmoi" + }, + { + "contributions": 6, + "name": "David Tan", + "html_url": "mailto:d.p.tan.tech@gmail.com" + }, + { + "contributions": 6, + "name": "ExE-Boss", + "avatar_url": "https://avatars.githubusercontent.com/u/3889017?v=4", + "html_url": "https://github.com/ExE-Boss" + }, + { + "contributions": 6, + "name": "ikonomov", + "html_url": "mailto:pikonomov@yahoo.com" + }, + { + "contributions": 6, + "name": "jb29", + "avatar_url": "https://avatars.githubusercontent.com/u/13062631?v=4", + "html_url": "https://github.com/jb29" + }, + { + "contributions": 6, + "name": "megapatato", + "avatar_url": "https://avatars.githubusercontent.com/u/60947952?v=4", + "html_url": "https://github.com/megapatato" + }, + { + "contributions": 6, + "name": "niveuseverto", + "avatar_url": "https://avatars.githubusercontent.com/u/449253?v=4", + "html_url": "https://github.com/niveuseverto" + }, + { + "contributions": 6, + "name": "SantosSi", + "avatar_url": "https://avatars.githubusercontent.com/u/31543615?v=4", + "html_url": "https://github.com/SantosSi" + }, + { + "contributions": 6, + "name": "such-dev", + "avatar_url": "https://avatars.githubusercontent.com/u/79712355?v=4", + "html_url": "https://github.com/such-dev" + }, + { + "contributions": 6, + "name": "தமிழ்நேரம்", + "html_url": "mailto:anishprabu.t@gmail.com" + }, + { + "contributions": 5, + "name": "Aimdru", + "avatar_url": "https://avatars.githubusercontent.com/u/93000551?v=4", + "html_url": "https://github.com/Aimdru" + }, + { + "contributions": 5, + "name": "Dasinhoo", + "avatar_url": "https://avatars.githubusercontent.com/u/41702374?v=4", + "html_url": "https://github.com/Dasinhoo" + }, + { + "contributions": 5, + "name": "HyliosSykes", + "avatar_url": "https://avatars.githubusercontent.com/u/127651086?v=4", + "html_url": "https://github.com/HyliosSykes" + }, + { + "contributions": 5, + "name": "ironmagician", + "avatar_url": "https://avatars.githubusercontent.com/u/21960774?v=4", + "html_url": "https://github.com/ironmagician" + }, + { + "contributions": 5, + "name": "unforbidable", + "avatar_url": "https://avatars.githubusercontent.com/u/14938119?v=4", + "html_url": "https://github.com/unforbidable" + }, + { + "contributions": 5, + "name": "WrinklyRobot", + "html_url": "mailto:oliver.hamlet+wrinklyrobot@gmail.com" + }, + { + "contributions": 5, + "name": "YokiHotsumi", + "avatar_url": "https://avatars.githubusercontent.com/u/32414930?v=4", + "html_url": "https://github.com/YokiHotsumi" + }, + { + "contributions": 4, + "name": "bpipher0225", + "html_url": "mailto:40877658+bpipher0225@users.noreply.github.com" + }, + { + "contributions": 4, + "name": "C0rn3j", + "avatar_url": "https://avatars.githubusercontent.com/u/1641362?v=4", + "html_url": "https://github.com/C0rn3j" + }, + { + "contributions": 4, + "name": "icopp", + "avatar_url": "https://avatars.githubusercontent.com/u/1162876?v=4", + "html_url": "https://github.com/icopp" + }, + { + "contributions": 4, + "name": "maksim2005UKR", + "avatar_url": "https://avatars.githubusercontent.com/u/233082001?v=4", + "html_url": "https://github.com/maksim2005UKR" + }, + { + "contributions": 4, + "name": "poperigby", + "avatar_url": "https://avatars.githubusercontent.com/u/20866468?v=4", + "html_url": "https://github.com/poperigby" + }, + { + "contributions": 4, + "name": "Qwinn1", + "avatar_url": "https://avatars.githubusercontent.com/u/35168918?v=4", + "html_url": "https://github.com/Qwinn1" + }, + { + "contributions": 4, + "name": "SkyLover264", + "avatar_url": "https://avatars.githubusercontent.com/u/76188763?v=4", + "html_url": "https://github.com/SkyLover264" + }, + { + "contributions": 3, + "name": "DJLegends1011", + "avatar_url": "https://avatars.githubusercontent.com/u/70036572?v=4", + "html_url": "https://github.com/DJLegends1011" + }, + { + "contributions": 3, + "name": "DomT602", + "avatar_url": "https://avatars.githubusercontent.com/u/32492434?v=4", + "html_url": "https://github.com/DomT602" + }, + { + "contributions": 3, + "name": "FenghuangZero", + "avatar_url": "https://avatars.githubusercontent.com/u/17545518?v=4", + "html_url": "https://github.com/FenghuangZero" + }, + { + "contributions": 3, + "name": "ghostsquad", + "avatar_url": "https://avatars.githubusercontent.com/u/903488?v=4", + "html_url": "https://github.com/ghostsquad" + }, + { + "contributions": 3, + "name": "LostDragonist", + "avatar_url": "https://avatars.githubusercontent.com/u/7862539?v=4", + "html_url": "https://github.com/LostDragonist" + }, + { + "contributions": 3, + "name": "nnmrts", + "avatar_url": "https://avatars.githubusercontent.com/u/20396367?v=4", + "html_url": "https://github.com/nnmrts" + }, + { + "contributions": 3, + "name": "noxwyll", + "html_url": "mailto:wyll@live.de" + }, + { + "contributions": 3, + "name": "Ricky-Tigg", + "avatar_url": "https://avatars.githubusercontent.com/u/26058215?v=4", + "html_url": "https://github.com/Ricky-Tigg" + }, + { + "contributions": 3, + "name": "simoneddeland", + "avatar_url": "https://avatars.githubusercontent.com/u/12908966?v=4", + "html_url": "https://github.com/simoneddeland" + }, + { + "contributions": 3, + "name": "simpleshawn", + "avatar_url": "https://avatars.githubusercontent.com/u/79335438?v=4", + "html_url": "https://github.com/simpleshawn" + }, + { + "contributions": 3, + "name": "spaceoden", + "html_url": "mailto:spaceoden@pm.me" + }, + { + "contributions": 3, + "name": "voidei", + "avatar_url": "https://avatars.githubusercontent.com/u/8062954?v=4", + "html_url": "https://github.com/voidei" + }, + { + "contributions": 3, + "name": "wim95", + "avatar_url": "https://avatars.githubusercontent.com/u/43253875?v=4", + "html_url": "https://github.com/wim95" + }, + { + "contributions": 3, + "name": "Yoosk", + "avatar_url": "https://avatars.githubusercontent.com/u/4502802?v=4", + "html_url": "https://github.com/Yoosk" + }, + { + "contributions": 3, + "name": "ZyPA", + "avatar_url": "https://avatars.githubusercontent.com/u/24624771?v=4", + "html_url": "https://github.com/ZyPA" + }, + { + "contributions": 2, + "name": "375gnu", + "avatar_url": "https://avatars.githubusercontent.com/u/1612688?v=4", + "html_url": "https://github.com/375gnu" + }, + { + "contributions": 2, + "name": "BeermotorWB", + "avatar_url": "https://avatars.githubusercontent.com/u/30019823?v=4", + "html_url": "https://github.com/BeermotorWB" + }, + { + "contributions": 2, + "name": "Chaossama", + "html_url": "mailto:swsurveychaos@gmail.com" + }, + { + "contributions": 2, + "name": "Dcycore", + "avatar_url": "https://avatars.githubusercontent.com/u/152696700?v=4", + "html_url": "https://github.com/Dcycore" + }, + { + "contributions": 2, + "name": "Deka-O", + "html_url": "mailto:33992669+deka-o@users.noreply.github.com" + }, + { + "contributions": 2, + "name": "FelesNoctis", + "avatar_url": "https://avatars.githubusercontent.com/u/16215725?v=4", + "html_url": "https://github.com/FelesNoctis" + }, + { + "contributions": 2, + "name": "hakasapl", + "avatar_url": "https://avatars.githubusercontent.com/u/40907639?v=4", + "html_url": "https://github.com/hakasapl" + }, + { + "contributions": 2, + "name": "IDCs", + "avatar_url": "https://avatars.githubusercontent.com/u/8960252?v=4", + "html_url": "https://github.com/IDCs" + }, + { + "contributions": 2, + "name": "ilker-binzet", + "avatar_url": "https://avatars.githubusercontent.com/u/19547599?v=4", + "html_url": "https://github.com/ilker-binzet" + }, + { + "contributions": 2, + "name": "jgostling", + "avatar_url": "https://avatars.githubusercontent.com/u/64228571?v=4", + "html_url": "https://github.com/jgostling" + }, + { + "contributions": 2, + "name": "kassane", + "avatar_url": "https://avatars.githubusercontent.com/u/6756180?v=4", + "html_url": "https://github.com/kassane" + }, + { + "contributions": 2, + "name": "Kinaga", + "avatar_url": "https://avatars.githubusercontent.com/u/16615375?v=4", + "html_url": "https://github.com/Kinaga" + }, + { + "contributions": 2, + "name": "Matthew Branigan", + "html_url": "mailto:braniganmatthew@ufl.edu" + }, + { + "contributions": 2, + "name": "mrudat", + "avatar_url": "https://avatars.githubusercontent.com/u/1089775?v=4", + "html_url": "https://github.com/mrudat" + }, + { + "contributions": 2, + "name": "Nawor3565", + "avatar_url": "https://avatars.githubusercontent.com/u/19783632?v=4", + "html_url": "https://github.com/Nawor3565" + }, + { + "contributions": 2, + "name": "Nebulous112", + "html_url": "mailto:montgomery.moore@gmail.com" + }, + { + "contributions": 2, + "name": "nuiva", + "avatar_url": "https://avatars.githubusercontent.com/u/34218315?v=4", + "html_url": "https://github.com/nuiva" + }, + { + "contributions": 2, + "name": "olmokramer", + "avatar_url": "https://avatars.githubusercontent.com/u/3612514?v=4", + "html_url": "https://github.com/olmokramer" + }, + { + "contributions": 2, + "name": "Riwaha", + "avatar_url": "https://avatars.githubusercontent.com/u/35466177?v=4", + "html_url": "https://github.com/Riwaha" + }, + { + "contributions": 2, + "name": "rux616", + "avatar_url": "https://avatars.githubusercontent.com/u/5643061?v=4", + "html_url": "https://github.com/rux616" + }, + { + "contributions": 2, + "name": "RyanLangston", + "avatar_url": "https://avatars.githubusercontent.com/u/68302450?v=4", + "html_url": "https://github.com/RyanLangston" + }, + { + "contributions": 2, + "name": "SierraKomodo", + "avatar_url": "https://avatars.githubusercontent.com/u/11140088?v=4", + "html_url": "https://github.com/SierraKomodo" + }, + { + "contributions": 2, + "name": "striezel", + "avatar_url": "https://avatars.githubusercontent.com/u/20865852?v=4", + "html_url": "https://github.com/striezel" + }, + { + "contributions": 2, + "name": "TateTaylorOH", + "avatar_url": "https://avatars.githubusercontent.com/u/60482452?v=4", + "html_url": "https://github.com/TateTaylorOH" + }, + { + "contributions": 2, + "name": "TGS", + "html_url": "mailto:mcsgcontact@gmail.com" + }, + { + "contributions": 2, + "name": "tomtesoro", + "avatar_url": "https://avatars.githubusercontent.com/u/44628791?v=4", + "html_url": "https://github.com/tomtesoro" + }, + { + "contributions": 2, + "name": "Tyler799", + "html_url": "mailto:tylerofshellberg@aol.com" + }, + { + "contributions": 2, + "name": "ubeogesh", + "avatar_url": "https://avatars.githubusercontent.com/u/16091685?v=4", + "html_url": "https://github.com/ubeogesh" + }, + { + "contributions": 2, + "name": "wvmtman", + "avatar_url": "https://avatars.githubusercontent.com/u/9808230?v=4", + "html_url": "https://github.com/wvmtman" + }, + { + "contributions": 2, + "name": "yetihairball", + "avatar_url": "https://avatars.githubusercontent.com/u/17912979?v=4", + "html_url": "https://github.com/yetihairball" + }, + { + "contributions": 2, + "name": "z929669", + "avatar_url": "https://avatars.githubusercontent.com/u/1461913?v=4", + "html_url": "https://github.com/z929669" + }, + { + "contributions": 2, + "name": "zyf2008Neptune", + "avatar_url": "https://avatars.githubusercontent.com/u/16064492?v=4", + "html_url": "https://github.com/zyf2008Neptune" + }, + { + "contributions": 1, + "name": "abiel0530", + "avatar_url": "https://avatars.githubusercontent.com/u/38668028?v=4", + "html_url": "https://github.com/abiel0530" + }, + { + "contributions": 1, + "name": "Aellis-BOSS", + "avatar_url": "https://avatars.githubusercontent.com/u/5513932?v=4", + "html_url": "https://github.com/Aellis-BOSS" + }, + { + "contributions": 1, + "name": "ann4belle", + "avatar_url": "https://avatars.githubusercontent.com/u/18199611?v=4", + "html_url": "https://github.com/ann4belle" + }, + { + "contributions": 1, + "name": "Artorp", + "avatar_url": "https://avatars.githubusercontent.com/u/147366?v=4", + "html_url": "https://github.com/Artorp" + }, + { + "contributions": 1, + "name": "asorly", + "avatar_url": "https://avatars.githubusercontent.com/u/86767691?v=4", + "html_url": "https://github.com/asorly" + }, + { + "contributions": 1, + "name": "Bl4ckread", + "avatar_url": "https://avatars.githubusercontent.com/u/47789310?v=4", + "html_url": "https://github.com/Bl4ckread" + }, + { + "contributions": 1, + "name": "boss-developers", + "html_url": "mailto:null" + }, + { + "contributions": 1, + "name": "BrainBlasted", + "avatar_url": "https://avatars.githubusercontent.com/u/29347290?v=4", + "html_url": "https://github.com/BrainBlasted" + }, + { + "contributions": 1, + "name": "Chef0000", + "avatar_url": "https://avatars.githubusercontent.com/u/42050020?v=4", + "html_url": "https://github.com/Chef0000" + }, + { + "contributions": 1, + "name": "ChrRubin", + "avatar_url": "https://avatars.githubusercontent.com/u/20059164?v=4", + "html_url": "https://github.com/ChrRubin" + }, + { + "contributions": 1, + "name": "coco9515", + "avatar_url": "https://avatars.githubusercontent.com/u/42412909?v=4", + "html_url": "https://github.com/coco9515" + }, + { + "contributions": 1, + "name": "comradekingu", + "avatar_url": "https://avatars.githubusercontent.com/u/13802408?v=4", + "html_url": "https://github.com/comradekingu" + }, + { + "contributions": 1, + "name": "cram42", + "avatar_url": "https://avatars.githubusercontent.com/u/5396871?v=4", + "html_url": "https://github.com/cram42" + }, + { + "contributions": 1, + "name": "crowbardoctor", + "avatar_url": "https://avatars.githubusercontent.com/u/42645295?v=4", + "html_url": "https://github.com/crowbardoctor" + }, + { + "contributions": 1, + "name": "Daniel Hofheinz", + "html_url": "mailto:daniel.hofheinz@outlook.com" + }, + { + "contributions": 1, + "name": "DeusGladiorum", + "html_url": "mailto:deusgladiorum@users.noreply.github.com" + }, + { + "contributions": 1, + "name": "dh-nunes", + "avatar_url": "https://avatars.githubusercontent.com/u/10326223?v=4", + "html_url": "https://github.com/dh-nunes" + }, + { + "contributions": 1, + "name": "DiglidiDudeNG", + "html_url": "mailto:diglididude.ng@gmail.com" + }, + { + "contributions": 1, + "name": "einstienfan", + "avatar_url": "https://avatars.githubusercontent.com/u/29163508?v=4", + "html_url": "https://github.com/einstienfan" + }, + { + "contributions": 1, + "name": "FATelarico", + "avatar_url": "https://avatars.githubusercontent.com/u/100512813?v=4", + "html_url": "https://github.com/FATelarico" + }, + { + "contributions": 1, + "name": "Felerius", + "avatar_url": "https://avatars.githubusercontent.com/u/9287484?v=4", + "html_url": "https://github.com/Felerius" + }, + { + "contributions": 1, + "name": "Gavvers", + "avatar_url": "https://avatars.githubusercontent.com/u/7991024?v=4", + "html_url": "https://github.com/Gavvers" + }, + { + "contributions": 1, + "name": "Ghos71y", + "avatar_url": "https://avatars.githubusercontent.com/u/123373672?v=4", + "html_url": "https://github.com/Ghos71y" + }, + { + "contributions": 1, + "name": "glimmp", + "avatar_url": "https://avatars.githubusercontent.com/u/125333336?v=4", + "html_url": "https://github.com/glimmp" + }, + { + "contributions": 1, + "name": "Glitchfinder", + "avatar_url": "https://avatars.githubusercontent.com/u/1045146?v=4", + "html_url": "https://github.com/Glitchfinder" + }, + { + "contributions": 1, + "name": "GonDragon", + "avatar_url": "https://avatars.githubusercontent.com/u/7538144?v=4", + "html_url": "https://github.com/GonDragon" + }, + { + "contributions": 1, + "name": "IHateMyKite", + "avatar_url": "https://avatars.githubusercontent.com/u/103142567?v=4", + "html_url": "https://github.com/IHateMyKite" + }, + { + "contributions": 1, + "name": "jaens", + "avatar_url": "https://avatars.githubusercontent.com/u/639345?v=4", + "html_url": "https://github.com/jaens" + }, + { + "contributions": 1, + "name": "jakubrejmak", + "avatar_url": "https://avatars.githubusercontent.com/u/78252585?v=4", + "html_url": "https://github.com/jakubrejmak" + }, + { + "contributions": 1, + "name": "jaredschlicht", + "avatar_url": "https://avatars.githubusercontent.com/u/639815?v=4", + "html_url": "https://github.com/jaredschlicht" + }, + { + "contributions": 1, + "name": "JDCalvert", + "avatar_url": "https://avatars.githubusercontent.com/u/38069151?v=4", + "html_url": "https://github.com/JDCalvert" + }, + { + "contributions": 1, + "name": "jdm", + "html_url": "mailto:ltfullert@gmail.com" + }, + { + "contributions": 1, + "name": "jmarsh411", + "avatar_url": "https://avatars.githubusercontent.com/u/10360503?v=4", + "html_url": "https://github.com/jmarsh411" + }, + { + "contributions": 1, + "name": "jobobby04", + "avatar_url": "https://avatars.githubusercontent.com/u/17078382?v=4", + "html_url": "https://github.com/jobobby04" + }, + { + "contributions": 1, + "name": "jordanbtucker", + "avatar_url": "https://avatars.githubusercontent.com/u/468153?v=4", + "html_url": "https://github.com/jordanbtucker" + }, + { + "contributions": 1, + "name": "Lakrits", + "avatar_url": "https://avatars.githubusercontent.com/u/1184718?v=4", + "html_url": "https://github.com/Lakrits" + }, + { + "contributions": 1, + "name": "langfod", + "avatar_url": "https://avatars.githubusercontent.com/u/3871654?v=4", + "html_url": "https://github.com/langfod" + }, + { + "contributions": 1, + "name": "Linext23", + "avatar_url": "https://avatars.githubusercontent.com/u/26930675?v=4", + "html_url": "https://github.com/Linext23" + }, + { + "contributions": 1, + "name": "lucible", + "avatar_url": "https://avatars.githubusercontent.com/u/45129600?v=4", + "html_url": "https://github.com/lucible" + }, + { + "contributions": 1, + "name": "Mikanoshi", + "avatar_url": "https://avatars.githubusercontent.com/u/5113439?v=4", + "html_url": "https://github.com/Mikanoshi" + }, + { + "contributions": 1, + "name": "minjasmin", + "avatar_url": "https://avatars.githubusercontent.com/u/62545993?v=4", + "html_url": "https://github.com/minjasmin" + }, + { + "contributions": 1, + "name": "nateious", + "avatar_url": "https://avatars.githubusercontent.com/u/49969587?v=4", + "html_url": "https://github.com/nateious" + }, + { + "contributions": 1, + "name": "NicBOMB", + "avatar_url": "https://avatars.githubusercontent.com/u/19939315?v=4", + "html_url": "https://github.com/NicBOMB" + }, + { + "contributions": 1, + "name": "Nightcaper", + "avatar_url": "https://avatars.githubusercontent.com/u/12568805?v=4", + "html_url": "https://github.com/Nightcaper" + }, + { + "contributions": 1, + "name": "NocturnalNerd13", + "avatar_url": "https://avatars.githubusercontent.com/u/41306138?v=4", + "html_url": "https://github.com/NocturnalNerd13" + }, + { + "contributions": 1, + "name": "OddDrifter", + "avatar_url": "https://avatars.githubusercontent.com/u/65688322?v=4", + "html_url": "https://github.com/OddDrifter" + }, + { + "contributions": 1, + "name": "PenguinMancer", + "avatar_url": "https://avatars.githubusercontent.com/u/4700058?v=4", + "html_url": "https://github.com/PenguinMancer" + }, + { + "contributions": 1, + "name": "pncampbell", + "avatar_url": "https://avatars.githubusercontent.com/u/919626?v=4", + "html_url": "https://github.com/pncampbell" + }, + { + "contributions": 1, + "name": "pragasette", + "avatar_url": "https://avatars.githubusercontent.com/u/34663739?v=4", + "html_url": "https://github.com/pragasette" + }, + { + "contributions": 1, + "name": "prisyum", + "avatar_url": "https://avatars.githubusercontent.com/u/164987308?v=4", + "html_url": "https://github.com/prisyum" + }, + { + "contributions": 1, + "name": "raehik", + "avatar_url": "https://avatars.githubusercontent.com/u/3764592?v=4", + "html_url": "https://github.com/raehik" + }, + { + "contributions": 1, + "name": "RiderSystems", + "avatar_url": "https://avatars.githubusercontent.com/u/27054897?v=4", + "html_url": "https://github.com/RiderSystems" + }, + { + "contributions": 1, + "name": "Sctumsempra", + "avatar_url": "https://avatars.githubusercontent.com/u/9376970?v=4", + "html_url": "https://github.com/Sctumsempra" + }, + { + "contributions": 1, + "name": "sehraf", + "avatar_url": "https://avatars.githubusercontent.com/u/2230104?v=4", + "html_url": "https://github.com/sehraf" + }, + { + "contributions": 1, + "name": "Serrobii", + "avatar_url": "https://avatars.githubusercontent.com/u/25062300?v=4", + "html_url": "https://github.com/Serrobii" + }, + { + "contributions": 1, + "name": "slowpard", + "avatar_url": "https://avatars.githubusercontent.com/u/23074267?v=4", + "html_url": "https://github.com/slowpard" + }, + { + "contributions": 1, + "name": "soyasoya5", + "avatar_url": "https://avatars.githubusercontent.com/u/18715978?v=4", + "html_url": "https://github.com/soyasoya5" + }, + { + "contributions": 1, + "name": "Spiess", + "avatar_url": "https://avatars.githubusercontent.com/u/9721543?v=4", + "html_url": "https://github.com/Spiess" + }, + { + "contributions": 1, + "name": "Targuinia", + "avatar_url": "https://avatars.githubusercontent.com/u/9700425?v=4", + "html_url": "https://github.com/Targuinia" + }, + { + "contributions": 1, + "name": "ThePotatoChronicler", + "avatar_url": "https://avatars.githubusercontent.com/u/45178972?v=4", + "html_url": "https://github.com/ThePotatoChronicler" + }, + { + "contributions": 1, + "name": "Thomas Winwood", + "html_url": "mailto:twwinwood@7storm.org" + }, + { + "contributions": 1, + "name": "thurask", + "avatar_url": "https://avatars.githubusercontent.com/u/7698858?v=4", + "html_url": "https://github.com/thurask" + }, + { + "contributions": 1, + "name": "tktk11", + "avatar_url": "https://avatars.githubusercontent.com/u/13784014?v=4", + "html_url": "https://github.com/tktk11" + }, + { + "contributions": 1, + "name": "TsunaMoo", + "avatar_url": "https://avatars.githubusercontent.com/u/5482183?v=4", + "html_url": "https://github.com/TsunaMoo" + }, + { + "contributions": 1, + "name": "umbertomarotta", + "avatar_url": "https://avatars.githubusercontent.com/u/3079597?v=4", + "html_url": "https://github.com/umbertomarotta" + }, + { + "contributions": 1, + "name": "viralarchitect", + "avatar_url": "https://avatars.githubusercontent.com/u/449071?v=4", + "html_url": "https://github.com/viralarchitect" + }, + { + "contributions": 1, + "name": "Willian Tomaz Nieckarz", + "html_url": "mailto:nieckarz@users.noreply.github.com" + }, + { + "contributions": 1, + "name": "yggdrasil75", + "avatar_url": "https://avatars.githubusercontent.com/u/17131496?v=4", + "html_url": "https://github.com/yggdrasil75" + }, + { + "contributions": 1, + "name": "Zack Layton", + "html_url": "mailto:synstack@users.noreply.github.com" + } +] \ No newline at end of file diff --git a/content/credits/index.html b/content/credits/index.html index ef9cf56..206639e 100644 --- a/content/credits/index.html +++ b/content/credits/index.html @@ -1,9 +1,6 @@ --- -layout: page +layout: credits title: Credits ---

LOOT relies on the submission of information by users to improve. We can't list everyone who has posted in LOOT's forum threads, but the people who have contributed on GitHub are listed below. -

-
-
diff --git a/content/credits/credits.js b/generate_contributors_json.js similarity index 79% rename from content/credits/credits.js rename to generate_contributors_json.js index d36c958..c953b43 100644 --- a/content/credits/credits.js +++ b/generate_contributors_json.js @@ -1,4 +1,5 @@ -import { Octokit } from '/js/octokit.js'; +import { Octokit } from './assets/js/octokit.js'; +import { writeFile } from 'fs/promises'; // Commit 37e464f6001d440ae532516f40fe19162537475a and earlier are common // between the loot and libloot repositories, so are double-counted by GitHub. @@ -122,42 +123,6 @@ const contributorMapping = new Map([ ['David Tan', ['Velgus', 'David']], ]); -function addToList(listElement, person) { - const a = document.createElement('a'); - const avatar = document.createElement('div'); - const text = document.createElement('div'); - const name = document.createElement('div'); - const contributions = document.createElement('div'); - - a.classList.add('loot-contributor', 'mdl-shadow--2dp'); - - avatar.className = 'loot-contributor__avatar'; - text.className = 'loot-contributor__text'; - name.className = 'loot-contributor__name'; - contributions.className = 'loot-contributor__contributions'; - - a.href = person.html_url; - name.textContent = person.name; - contributions.textContent = person.contributions + ' contributions'; - - if (person.avatar_url) { - const img = document.createElement('img'); - img.src = person.avatar_url; - avatar.appendChild(img); - } else { - const icon = document.createElement('i'); - icon.className = 'material-icons'; - icon.textContent = 'face'; - avatar.appendChild(icon); - } - - a.appendChild(avatar); - a.appendChild(text); - text.appendChild(name); - text.appendChild(contributions); - listElement.appendChild(a); -} - function sortContributors(a,b) { if (a.contributions != b.contributions) { return b.contributions - a.contributions; @@ -186,17 +151,6 @@ function statsReducer(previous, current) { return previous; } -function displayContributorsStats(contributorsStats) { - contributorsStats.sort(sortContributors); - - const contrib = document.getElementById('contrib'); - contrib.removeChild(contrib.firstElementChild); - - for (const contributor of contributorsStats) { - addToList(contrib, contributor); - } -} - function getContributorsStats(contributors) { return contributors .map(getStats) @@ -241,7 +195,7 @@ function fixStats(contributorsStats) { } async function getContributors() { - const octokit = new Octokit(); + const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); const repos = await octokit.paginate(octokit.rest.repos.listForOrg, { org: 'loot' @@ -258,14 +212,18 @@ async function getContributors() { return Promise.all(promises).then(results => results.flat()); } -async function getAndDisplayContributorsStats() { +async function main() { const contributors = await getContributors(); const stats = getContributorsStats(contributors); const fixedStats = fixStats(stats); - displayContributorsStats(fixedStats); + fixedStats.sort(sortContributors); + + const json = JSON.stringify(fixedStats, null, 2); + + await writeFile('./content/credits/contributors.json', json); } -getAndDisplayContributorsStats(); +await main(); diff --git a/layouts/credits.html b/layouts/credits.html new file mode 100644 index 0000000..529648e --- /dev/null +++ b/layouts/credits.html @@ -0,0 +1,22 @@ +{{ define "main" }} + {{ .Content }} + +
+ {{ $contributors := .Resources.Get "contributors.json" | transform.Unmarshal }} + {{ range $contributors }} + +
+ {{- if .avatar_url }} + + {{- else }} + face + {{- end }} +
+
+
{{ .name }}
+
{{ .contributions }} contributions
+
+
+ {{ end }} +
+{{ end }}