46 lines
2.1 KiB
HTML
46 lines
2.1 KiB
HTML
<header>
|
|
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark flex-column flex-md-row td-navbar">
|
|
<a class="navbar-brand" href="{{ site.baseurl }}/">
|
|
<span class="navbar-logo"></span><img src="https://geysermc.org/android-chrome-512x512.png" /><span class="text-uppercase font-weight-bold">{{ site.title }}</span>
|
|
</a>
|
|
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
|
|
<ul class="navbar-nav mt-2 mt-md-0">
|
|
{% for link in site.data.navigation %}
|
|
<li class="nav-item mr-2 ml-2 mr-md-4 ml-md-0 mb-2 mb-lg-0 text-center">
|
|
<a class="nav-link" href="{% if link.url %}{{ site.baseurl }}/{{ link.url }}{% else %}{{ link.external_url }}{% endif %}" ><span>{{ link.title }}</span></a>
|
|
</li>{% endfor %}
|
|
</ul>
|
|
</div>
|
|
<div class="navbar-nav d-none d-lg-block">
|
|
<input type="search" class="form-control td-search-input" placeholder=" Search this site…" aria-label="Search this site…" autocomplete="off">
|
|
</div>
|
|
|
|
<div class="navbar-nav d-none d-lg-block">
|
|
<a class="gh-source" data-gh-source="github" href="https://github.com/{{ site.github_user }}/{{ site.github_repo }}" title="Go to repository" data-md-state="done">
|
|
<div class="gh-source__repository">
|
|
<i class="fab fa-github fa-2x" style='padding-right:20px; float:left; margin-top:5px'></i>
|
|
{{ site.github_user }}/{{ site.github_repo }}
|
|
<ul class="gh-source__facts"><li class="gh-source__fact" id='stars'></li><li id="forks" class="gh-source__fact"></li></ul></div></a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</nav>
|
|
</header>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
var url = "https://api.github.com/search/repositories?q={{ site.github_user }}/{{ site.github_repo }}";
|
|
fetch(url, {
|
|
headers: {"Accept":"application/vnd.github.v3+json"}
|
|
}).then(function(e) {
|
|
return e.json()
|
|
}).then(function(r) {
|
|
if (r.items[0].full_name !== "{{ site.github_user }}/{{ site.github_repo }}") return
|
|
stars = r.items[0]['stargazers_count']
|
|
forks = r.items[0]['forks_count']
|
|
$('#stars').text(stars + " Stars")
|
|
$('#forks').text(forks + " Forks")
|
|
});
|
|
});
|
|
</script>
|