awesomeWM / awesome-www

Website of AwesomeWM
https://awesomewm.org/
56 stars 34 forks source link

Update screenshots.mdwn #162

Closed mipmip closed 3 years ago

mipmip commented 3 years ago
Elv13 commented 3 years ago

Do you think the gallery could be integrated directly in AwesomeWM website?

actionless commented 3 years ago

@Elv13 as i understood from https://github.com/awesomeWM/awesome/issues/3417 , the current version could be, but sorting would require pre-rendering using Github Actions

sclu1034 commented 3 years ago

Sorting should be doable client-side. As far as I can tell, that website fetches JSON and then creates a DOM structure based on the content. To sort the elements, you'd just need to sort the JSON before creating the DOM.

And if you keep the raw data around, you can add a button to change sorting and re-arrange the DOM without reload.

mipmip commented 3 years ago

Sorting should be doable client-side. As far as I can tell, that website fetches JSON and then creates a DOM structure based on the content. To sort the elements, you'd just need to sort the JSON before creating the DOM.

And if you keep the raw data around, you can add a button to change sorting and re-arrange the DOM without reload.

Problem is you can not get all comments from the API at once. You need to get page for page and the Github API has requests limits per hour for every ip address. Its far more simpler to cache the json requests to files. There seems to be a on: issue_comment to create new caches when someone submits a new screenshot.

actionless commented 3 years ago

so, any objections on the current diff of this PR?