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

42 lines
1.5 KiB
Plaintext
Raw Normal View History

2023-02-27 07:51:18 +00:00
<%
var titlesBySection = {
// top-level
astral: "Astral Info",
campaign: "Campaign Info",
classes: "Character Classes",
"magic-items": "Magic Items",
2023-04-24 22:13:58 +00:00
planes: "Planar Cosmology",
2023-02-27 07:51:18 +00:00
races: "Character Races",
rules: "House Rules",
// planes
elemental: "Elemental Planes",
material: "Material Planes",
2023-04-24 22:13:58 +00:00
near: "Near Planes",
2023-02-27 07:51:18 +00:00
transcendental: "Transcendental Planes",
2023-03-20 21:41:42 +00:00
},
unlistedSections = ['main'];
2023-02-27 07:51:18 +00:00
%>
<% if (page.subsection && page.path && !page.path.endsWith(`${page.subsection}/index.html`)) { %>
<div class="sectionBackLink-wrapper">
<a href="./index.html" class="sectionBackLink">
2024-02-05 19:27:48 +00:00
&lt; Back to <%= titlesBySection[page.subsection]
?? page.subsection.charAt(0).toUpperCase() + page.subsection.slice(1) %>
2023-02-27 07:51:18 +00:00
</a>
</div>
2024-01-28 05:47:44 +00:00
<% } else if (page.section && page.section === 'licenses' && page.path && !page.path.endsWith(`${page.section}/index.html`)) { -%>
2023-03-20 21:41:42 +00:00
<p>
2024-01-28 05:47:44 +00:00
The latest version of this license can always be found at <a href="/<%=page.path%>"><%=site.uri%>/<%=page.path.replace('/index.html', '/')%></a>.
2023-03-20 21:41:42 +00:00
</p>
<% } else if (page.section && !unlistedSections.includes(page.section) && page.path && !page.path.endsWith(`${page.section}/index.html`)) { -%>
2023-02-27 07:51:18 +00:00
<div class="sectionBackLink-wrapper">
2024-02-05 19:27:48 +00:00
<a href="/<%=page.section%>/index.html" class="sectionBackLink">
2023-02-27 07:51:18 +00:00
&lt; Back to <%= titlesBySection[page.section] ?? page.section.charAt(0).toUpperCase() + page.section.slice(1) %>
</a>
</div>
<% } -%>