Skip to content

Commit 7314c44

Browse files
committed
feat: add NPCs link to campaign sidebar navigation
Adds an "NPCs" entry with users icon to the sidebar below "All Pages", linking to the NPC gallery at /campaigns/:id/npcs. https://claude.ai/code/session_01PeB1HsjEYNPSY2iqa7sqqR
1 parent 0c6d284 commit 7314c44

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

internal/templates/layouts/app.templ

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,17 @@ templ Sidebar() {
246246
</span>
247247
<span class="flex-1">All Pages</span>
248248
</a>
249+
<a
250+
href={ templ.SafeURL(fmt.Sprintf("/campaigns/%s/npcs", GetCampaignID(ctx))) }
251+
class={ sidebarNavLink,
252+
templ.KV(sidebarNavActive, isPathPrefix(ctx, fmt.Sprintf("/campaigns/%s/npcs", GetCampaignID(ctx)))),
253+
templ.KV(sidebarNavInactive, !isPathPrefix(ctx, fmt.Sprintf("/campaigns/%s/npcs", GetCampaignID(ctx)))) }
254+
>
255+
<span class="w-4 h-4 mr-3 shrink-0 flex items-center justify-center">
256+
<i class="fa-solid fa-users text-xs text-gray-400"></i>
257+
</span>
258+
<span class="flex-1">NPCs</span>
259+
</a>
249260
<!-- Custom sidebar sections and links -->
250261
if len(GetCustomSections(ctx)) > 0 || len(GetCustomLinks(ctx)) > 0 {
251262
for _, link := range GetCustomLinks(ctx) {

0 commit comments

Comments
 (0)