Hello all! First post here - I appreciate this community and all the knowledge you’ve put time and effort into. Many solutions I’ve found just looking through here. Thank you!
I’m writing a project showcase or a gallery of projects that are obtained via github links. Images are created by rewriting the github link to a graphql link which gives me an image that I can use as a list of cards. All that is working fine.
But what would be cool is if I could sort those projects based on the last commit date that I obtain using get.json() from latest to the oldest. I’m not able to find information on how to do that - I am familiar with how to sort using the built-in front matter - but so far this been problematic.
I’m looking for any suggestions on how I could to wit:
go through my site pages for projects. Query the github repo from the user defined githublink field I have and then get the last commit date and then display all the projects in order.
I suppose i could do a loop of the front matter variables and put them into a list and then sort it and then do another list to display it?
I appreciate your time and effort on helping me. Thank you!
Oh excellent! Thank you so much - that makes it much clearer. I’ll need to add one more loop to replace that first line to iterate though projects and get their github link. Interestingly with this - the md files I create are more like ‘track this project’ rather than actual content. I’ll report back on what I did. Thank you @razon ! If you have a ko-fi link or some other thing that I can show my appreciation - let me know!
Since it sort by the field returned by GitHub, you can print the updated_at to check if it work as expected, if the updated_at is not the date field you want, you may need to change it with the right field.
You can use other APIs for fetching the right date you need if there isn’t in current API, e.g.