mirror of
https://github.com/ivabus/www
synced 2024-11-10 05:45:16 +03:00
Add star count to footer
This commit is contained in:
parent
831305866b
commit
9d019904b8
|
@ -15,7 +15,7 @@
|
|||
<ul class="list-group list-group-flush">
|
||||
<a class="list-group-item" role="button" href="https://twitter.com/teaxyz"><i class="icon-twitter social-icon"></i>Twitter</a>
|
||||
<a class="list-group-item" role="button" href="https://discord.gg/KCZsXfJphn"><i class="icon-discord social-icon"></i>Discord</a>
|
||||
<a class="list-group-item" role="button" href="https://github.com/teaxyz"><i class="icon-github social-icon"></i>GitHub</a>
|
||||
<a class="list-group-item" role="button" href="https://github.com/teaxyz"><i class="icon-github social-icon"></i>GitHub (<span id="starcount"></span>)</a>
|
||||
<a class="list-group-item" role="button" href="https://t.me/tea_xyz"><i class="icon-telegram social-icon"></i>Telegram</a>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -169,3 +169,24 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
|
|||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function getStarcount(repo, resultElement) {
|
||||
var url = 'https://api.github.com/repos/' + repo;
|
||||
axios.get(url)
|
||||
.then(function (response) {
|
||||
resultElement.innerHTML = response.data.stargazers_count;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
function repo() {
|
||||
var repo = 'teaxyz/cli';
|
||||
var starcount = document.getElementById('starcount');
|
||||
getStarcount(repo, starcount);
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', repo());
|
||||
</script>
|
||||
|
|
|
@ -111,5 +111,7 @@
|
|||
|
||||
{{- partial "toast.html" -}}
|
||||
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
|
||||
</head>
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue