pvgttm-web/src/layouts/partials/rulesHeader.ejs

56 lines
1.4 KiB
Plaintext

<%- include('../functions') -%>
<%
var menuLinksByOption = {
Basics: "/rules/basics.html",
Combat: "/rules/combat.html",
Adventuring: "/rules/adventuring.html",
Magic: "/rules/magic.html",
"Referees Only": "/rules/referees.html",
};
var title = (page.title ?? '').replace('HOSR ', '');
%>
<h2 class="pageTitle rulesTitle">
<a
class="pageTitle-link"
href="/<%= page.path %>"
>Heroic Old-School Roleplaying</a>
<% if (!page.path.endsWith(`${page.subsection}/index.html`)) { -%>
<br />
<a
class="pageTitle-link pageTitle-sublink"
href="/<%= page.path %>"
id="<%= snakeCase(title) %>"
name="<%= snakeCase(title) %>"
><%= title %></a>
<% } -%>
</h2>
<div class="rulesMenu">
<div class="rulesVersion">
Version 0.12.3 / 2024-02-25
<!--
<%=site.version ?? '0.0.0' %>
<%=site.lastUpdated ?? '0.0.0' %>
<%=JSON.stringify(page, null, 2) %>
-->
</div>
<ul>
<% Object.keys(menuLinksByOption).forEach((key) => { -%>
<li>
<a
class="<%=page.path.endsWith(menuLinksByOption[key]) ? 'isCurrent' : '' %>"
href="<%=menuLinksByOption[key]%>"
><%= key %></a>
</li>
<% }); -%>
</ul>
</div>