crowsite/crow_test/webcontent/menu_bar.part

31 lines
1.1 KiB
Plaintext
Raw Normal View History

<ul class="menu_bar">
<li class="left"><a id="home" href="/">Home</a></li>
2023-08-27 19:18:16 -04:00
<li class="left"><a id="blog" href="/blog/">Blog</a></li>
<li class="left"><a id="projects" href="/projects/">Projects</a></li>
<li class="left"><a id="git" href="/git.html">Git</a></li>
<li class="left"><a id='about' href="/about.html">About</a></li>
2023-08-23 15:55:02 -04:00
{{%_logged_in}}
<li class="right"><a href="/logout.html">Logout</a></li>
2023-08-23 15:55:02 -04:00
{{*_logged_in}}
<li class="right"><a id='login' href="/login.html">Login</a></li>
2023-08-23 15:55:02 -04:00
{{/_logged_in}}
{{%_admin}}
<li class="right"><a href="/admin/">Admin</a></li>
{{/_admin}}
</ul>
<script>
const path = window.location.pathname;
const ids = {
"/": "home",
"/index.html": "home",
2023-08-27 19:18:16 -04:00
"/projects/": "projects",
"/projects/index.html": "projects",
"/blog/": "blog",
"/blog/index.html": "blog",
"/git.html": "git",
"/about.html": "about",
"/login.html": "login"
};
var element = document.getElementById(ids[path]);
element.classList += "active";
</script>