1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 18:56:29 +02:00
Files
csslayout/contents/_data/github.js
2022-09-22 13:18:03 +07:00

25 lines
843 B
JavaScript

const EleventyFetch = require("@11ty/eleventy-fetch")
async function fetchGitHubStars(repos) {
let json = await EleventyFetch(`https://api.github.com/repos/${repos}`, {
duration: '1d',
type: 'json'
});
return {
stargazers: json.stargazers_count,
};
}
module.exports = async function() {
return {
'oneloc': await fetchGitHubStars('phuocng/1loc'),
'crossbrowser': await fetchGitHubStars('phuocng/cross-browser'),
'csslayout': await fetchGitHubStars('phuocng/csslayout'),
'frontendtips': await fetchGitHubStars('phuocng/frontend-tips'),
'htmldom': await fetchGitHubStars('phuocng/html-dom'),
'thisvsthat': await fetchGitHubStars('phuocng/this-vs-that'),
'reactpdfviewer': await fetchGitHubStars('react-pdf-viewer/react-pdf-viewer'),
};
};