home

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

templ: version: v0.3.1020

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS

Functions

func GroupCard

func GroupCard(g Group, meta map[string]ToolMetaEntry, loggedIn bool, viewMode string) templ.Component

func IndexPage

func IndexPage(items []tool.Tool, groups []Group, ungrouped []tool.Tool, meta map[string]ToolMetaEntry, user *entity.User, viewMode string) templ.Component

func ToolCardCompact

func ToolCardCompact(t tool.Tool, m ToolMetaEntry, loggedIn bool) templ.Component

func ToolCardDetailed

func ToolCardDetailed(t tool.Tool, m ToolMetaEntry, loggedIn bool) templ.Component

func ViewModeToggle

func ViewModeToggle(current string) templ.Component

Types

type Group

type Group struct {
	Kind        string // "bookmarks" | "tag" | "category"
	Name        string
	Description string
	Tools       []tool.Tool
}

Group represents one section on the home page.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(items []tool.Tool, authSvc *login.Service, tagsSvc *tags.Service, bookmarkSvc *bookmark.Service) *Handler

func (*Handler) APITools

func (h *Handler) APITools(w http.ResponseWriter, r *http.Request)

APITools returns the items the current user can access as JSON.

func (*Handler) BuildGroups

func (h *Handler) BuildGroups(ctx context.Context, user *entity.User, visible []tool.Tool) ([]Group, []tool.Tool)

BuildGroups arranges the visible items into display groups.

func (*Handler) Index

func (h *Handler) Index(w http.ResponseWriter, r *http.Request)

func (*Handler) ItemMeta

func (h *Handler) ItemMeta(ctx context.Context, user *entity.User, visible []tool.Tool) map[string]ToolMetaEntry

ItemMeta returns a map from item path to display metadata.

func (*Handler) VisibleItems

func (h *Handler) VisibleItems(r *http.Request, user *entity.User) []tool.Tool

VisibleItems returns the items the user can see on the home grid.

type ToolMetaEntry

type ToolMetaEntry struct {
	GroupNames []string
	Bookmarked bool
}

ToolMetaEntry holds per-item display metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL