This commit is contained in:
parent
39c8c60b92
commit
acddc1b91c
1 changed files with 7 additions and 13 deletions
|
|
@ -1,15 +1,9 @@
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
var navbar = document.createElement('nav');
|
fetch('/includes/navbar.html')
|
||||||
navbar.className = 'navbar';
|
.then(function (res) { return res.text(); })
|
||||||
navbar.innerHTML =
|
.then(function (html) {
|
||||||
'<div class="nav-container">' +
|
var wrapper = document.createElement('div');
|
||||||
'<a href="/" class="nav-brand">Home</a>' +
|
wrapper.innerHTML = html.trim();
|
||||||
'<ul class="nav-menu">' +
|
document.body.insertBefore(wrapper.firstChild, document.body.firstChild);
|
||||||
'<li><a href="/menu.html/">Menu</a></li>' +
|
});
|
||||||
'<li><a href="/blog/">Blog</a></li>' +
|
|
||||||
'<li><a href="https://forgejo.binning.net" target="_blank">Git</a></li>' +
|
|
||||||
'<li><a href="/resume.html">Resume</a></li>' +
|
|
||||||
'</ul>' +
|
|
||||||
'</div>';
|
|
||||||
document.body.insertBefore(navbar, document.body.firstChild);
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue