mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 09:46:57 +01:00
grab latest release stuff from GitHub API too
This commit is contained in:
parent
20d4ff375b
commit
6c095a14a6
@ -30,9 +30,6 @@ address:
|
||||
city: Berlin
|
||||
country: Germany
|
||||
|
||||
release:
|
||||
version: "0.10"
|
||||
post: https://blog.bigchaindb.com/bigchaindb-version-0-10-released-9684fdb2a8ff
|
||||
|
||||
# Track all the things
|
||||
# --------------------
|
||||
|
@ -1,21 +1,32 @@
|
||||
(function() {
|
||||
|
||||
var s = document.createElement('script'),
|
||||
const s = document.createElement('script'),
|
||||
t = document.createElement('script'),
|
||||
githubApiUrl = 'https://api.github.com/repos/',
|
||||
owner = 'bigchaindb',
|
||||
repo = 'bigchaindb';
|
||||
|
||||
s.type = 'text/javascript';
|
||||
s.async = true;
|
||||
s.src = githubApiUrl + owner + '/' + repo + '?callback=' + owner + '.getGitHubRepoInfo';
|
||||
|
||||
t.async = true;
|
||||
t.src = githubApiUrl + owner + '/' + repo + '/releases/latest?callback=' + owner + '.getGitHubReleaseInfo';
|
||||
|
||||
window[owner] = window[owner] || {};
|
||||
window[owner].getGitHubRepoInfo = function(response) {
|
||||
window[owner].getGitHubRepoInfo = (response) => {
|
||||
|
||||
var stargazers = response.data.stargazers_count;
|
||||
|
||||
document.getElementById('stargazers').innerText = stargazers;
|
||||
};
|
||||
|
||||
window[owner].getGitHubReleaseInfo = (response) => {
|
||||
|
||||
var version = response.data.tag_name;
|
||||
|
||||
document.getElementById('version').innerText = version;
|
||||
};
|
||||
|
||||
document.getElementsByTagName('HEAD')[0].appendChild(s);
|
||||
document.getElementsByTagName('HEAD')[0].appendChild(t);
|
||||
}());
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<aside class="hero__community">
|
||||
<div class="row">
|
||||
<a class="btn btn-text btn-sm" href="{{ site.release.post }}" rel="external">Latest release: {{ site.release.version }}</a>
|
||||
<a class="btn btn-text btn-sm" href="https://github.com/{{ site.github.org }}/{{ site.github.repo }}/releases/latest" rel="external">Latest release: <span id="version"></span></a>
|
||||
|
||||
<a class="social-link btn btn-text btn-sm js-social-link" href="https://github.com/{{ site.github.org }}/{{ site.github.repo }}" title="Star {{ site.github.org }}/{{ site.github.repo }} on GitHub">
|
||||
<svg class="icon icon--social icon--github" aria-labelledby="title">
|
||||
|
Loading…
Reference in New Issue
Block a user