Commit fb53ec8
committed
Merge #129: add component to display contributors
8df5b46 change title of defaultContributorsList and remove token (Graeme Byrne)
9841a81 add default values for Contributors.svelte (Graeme Byrne)
158a94e cache requests to github api in store and remove token (Graeme Byrne)
dfe74b3 clean up +page.server.ts (Graeme Byrne)
ec727a9 fix lint error in +page.server.ts (Graeme Byrne)
65913e9 get list of repos from GitHub API (Graeme Byrne)
bc46c91 fix tailwind lint error (Graeme Byrne)
896104f add component to display contributors (Graeme Byrne)
Pull request description:
* in `routes/(home)/+page.server.ts`, fetch contributors data from GitHub API to use in Torrust repos.
* Create a `Contributor` type for data coming from GitHub API and store it in `'$lib/utils/types'` to be imported
* Create an array of repo names and store it in `'$lib/constants/constants'` to be imported and reactively mapped over together with a baseURL
* Create a Personal Access Token, store it in `.env` and store it in `const token = import.meta.env.VITE_GITHUB_TOKEN;` to order to increase GitHub API rate limits.
* Fetch contributor data from multiple GitHub repository URLs concurrently using Promise.all. It sends authenticated GET requests (with a token in the headers) to each URL and parses the JSON response for all the requests.
* Flatten the array of contributor arrays into a single array of all contributors.
* Remove duplicate contributors from the all contributors array.
* Pass array into `routes/(home)/+page.svelte`, which passes it into component `Contributors.svelte` in order to loop over and display each contributor on the home page.
* On each of the `(pages)` routes there wasn't responsiveness to make Table of Contents appear above the text on smaller screens and to the left on wider screens, so I added that to each.
ACKs for top commit:
josecelano:
ACK 8df5b46
Tree-SHA512: 71189d32b15e63b460288da401808c830583d20b0f4e46e04feef3f6ef53cf3e54d95b6132970938944db61f6f3fadb991dfc5626cb014993af7dccff6633e8aFile tree
16 files changed
+502
-93
lines changed- src
- lib
- components/singletons
- constants
- stores
- utils
- routes
- (home)
- (pages)
- about
- community
- self-host
- blog
16 files changed
+502
-93
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | 237 | | |
244 | 238 | | |
245 | 239 | | |
| |||
288 | 282 | | |
289 | 283 | | |
290 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
291 | 296 | | |
292 | 297 | | |
293 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 257 | | |
264 | 258 | | |
265 | 259 | | |
| |||
307 | 301 | | |
308 | 302 | | |
309 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
310 | 315 | | |
311 | 316 | | |
312 | 317 | | |
| |||
0 commit comments