Skip to content

Commit

Permalink
Sort sites in readme by descending number of GitHub stars (#112)
Browse files Browse the repository at this point in the history
* sort sites in readme by descending number of GitHub stars

* define type RawSite

with all fields available prior to fetch-github-metadata.ts

* remove https://studenten-bilden-schueler.de
  • Loading branch information
janosh authored Jul 31, 2023
1 parent cbc550b commit d490749
Show file tree
Hide file tree
Showing 8 changed files with 470 additions and 523 deletions.
909 changes: 449 additions & 460 deletions readme.md

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions site/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ export { default as SiteDetails } from './SiteDetails.svelte'
export { default as SiteList } from './SiteList.svelte'
export { default as SitePreview } from './SitePreview.svelte'

export type Site = {
export type RawSite = {
title: string
url: string
slug: string
description?: string
repo?: string
npm?: string
site_src?: string
repo_stars?: number
contributors: Contributor[]
tags: string[]
uses: string[]
date_added: Date
date_created: Date
last_updated: string
}

export type Site = RawSite & {
slug: string
repo_stars?: number
contributors: Contributor[]
}

export type Contributor = {
Expand Down
34 changes: 0 additions & 34 deletions site/src/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,40 +192,6 @@
name: Markus Hatvan
location: Vienna, Austria
company: null
- title: Studenten bilden Schüler
url: https://studenten-bilden-schueler.de
repo: https://github.com/sbsev/site
description: >-
Student-run nonprofit initiative with chapters located in university towns
all across Germany. Mission is to contribute towards educational equality by
providing free tutoring to children from underprivileged families.
uses:
- Contentful
- Algolia
- GraphQL
- Netlify
- MapBox
- svelte-multiselect
- Playwright
- Vitest
tags:
- education
- equality
- non-profit
- open source
- volunteering
date_created: 2020-12-12T00:00:00.000Z
date_added: 2021-06-09T00:00:00.000Z
slug: studenten-bilden-schüler
repo_stars: 11
contributors:
- github: janosh
twitter: jrib_
url: https://janosh.dev
avatar: https://avatars.githubusercontent.com/u/30958850?v=4
name: Janosh Riebesell
location: Materials Project
company: Cambridge University
- title: Guess The Year
url: https://guess-the-year.davjhan.com
repo: https://github.com/davjhan/guess-the-year-game
Expand Down
16 changes: 13 additions & 3 deletions site/src/tasks/update-readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@

import fs from 'fs'
import yaml from 'js-yaml'
import type { RawSite, Site } from '../lib'

export function update_readme() {
const readme_path = `../readme.md`
const sites_yaml_path = `../sites.yml`
const raw_sites_path = `../sites.yml`
const sites_path = `src/sites.yml`

const readme = fs.readFileSync(readme_path, `utf8`)
const sites = yaml.load(fs.readFileSync(sites_yaml_path))
const raw_sites = yaml.load(fs.readFileSync(raw_sites_path)) as RawSite[]
const sites = yaml.load(fs.readFileSync(sites_path)) as Site[]

const new_line = `\n `

const new_sites = sites
const new_sites = raw_sites
.sort((site_1, site_2) => {
const stars1 = sites.find((site) => site.title === site_2.title)
?.repo_stars
const stars2 = sites.find((site) => site.title === site_1.title)
?.repo_stars
return (stars2 ?? 0) - (stars1 ?? 0)
})
.map((site) => {
const { title, repo, uses, description, url, site_src } = site

Expand Down
Binary file not shown.
Binary file not shown.
20 changes: 0 additions & 20 deletions sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,6 @@
date_created: 2020-08-21
date_added: 2021-05-25

- title: Studenten bilden Schüler
url: https://studenten-bilden-schueler.de
repo: https://github.com/sbsev/site
description:
Student-run nonprofit initiative with chapters located in university towns all across Germany.
Mission is to contribute towards educational equality by providing free tutoring to children
from underprivileged families.
uses:
- Contentful
- Algolia
- GraphQL
- Netlify
- MapBox
- svelte-multiselect
- Playwright
- Vitest
tags: [non-profit, volunteering, education, equality]
date_created: 2020-12-12
date_added: 2021-06-09

- title: Guess The Year
url: https://guess-the-year.davjhan.com
repo: https://github.com/davjhan/guess-the-year-game
Expand Down
1 change: 0 additions & 1 deletion tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ cloudflare: https://cloudflare.com
cloudinary: https://cloudinary.com
codemirror: https://codemirror.net
commitlint: https://github.com/conventional-changelog/commitlint
contentful: https://contentful.com
cssnano: https://cssnano.co
cypress: https://cypress.io
cytoscape.js: https://js.cytoscape.org
Expand Down

0 comments on commit d490749

Please sign in to comment.