<%- include('../functions') -%>
<%
var menuLinksByOption = {
    Basics: "/rules/basics.html",
    Combat: "/rules/combat.html",
    Adventuring: "/rules/adventuring.html",
    Equipment: "/rules/equipment/fantasy.html",
    Magic: "/rules/magic.html",
    "GM Notes": "/rules/gm-notes.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 Beta-0.20.0 / 2025-03-16
        <!--
        <%=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>
