template

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapMap

func MapMap[T any](ts map[string]T, cb func(k string, v T) g.Node) []g.Node

MapMap creates nodes from a map

func MapMapSorted

func MapMapSorted[T any](ts map[string]T, cb func(k string, v T) g.Node) []g.Node

MapMapSorted creates nodes from a map with keys sorted alphabetically

func RenderEmbeddingProgressContent

func RenderEmbeddingProgressContent(data EmbeddingProgressData) g.Node

RenderEmbeddingProgressContent renders the inner content that gets swapped by SSE This is used both for initial render and SSE updates

func RenderEmbeddingProgressIndicator

func RenderEmbeddingProgressIndicator() g.Node

RenderEmbeddingProgressIndicator renders the complete embedding progress indicator for initial page load

func RenderSemanticResultsHTML

func RenderSemanticResultsHTML(rs Resource, notes []model.Note) string

RenderSemanticResultsHTML renders semantic search results as HTML for SSE streaming Returns individual note cards to be appended to the combined results grid

Types

type EmbeddingProgressData

type EmbeddingProgressData struct {
	Embedded    int
	Total       int
	IsEmbedding bool
}

EmbeddingProgressData holds the data for rendering embedding progress

type Resource

type Resource struct {
}

func (Resource) Layout

func (rs Resource) Layout(note *model.Note, node ...g.Node) g.Node

func (Resource) NoteWithList

func (rs Resource) NoteWithList(notesService *engine.NotesService, note *model.Note, searchQuery string) (g.Node, error)

NoteWithList displays a note with the list of all notes on the left side

func (Resource) SearchChatResults

func (rs Resource) SearchChatResults(notesService *engine.NotesService, query string, results []model.Note, aiResponse string) (g.Node, error)

SearchChatResults displays semantic search results with AI-generated summary

func (Resource) SearchLiveChatResults

func (rs Resource) SearchLiveChatResults(notesService *engine.NotesService, query string) (g.Node, error)

SearchLiveChatResults displays the live chat search page

func (Resource) SearchResults

func (rs Resource) SearchResults(notesService *engine.NotesService, query string, results []model.Note) (g.Node, error)

SearchResults displays semantic search results

func (Resource) TagList

func (rs Resource) TagList(notesService *engine.NotesService, tag string, notes []model.Note) (g.Node, error)

TagList displays all notes that contain a specific tag

func (Resource) UnifiedSearchResults

func (rs Resource) UnifiedSearchResults(
	notesService *engine.NotesService,
	query string,
	titleMatches []model.Note,
	headingMatches []engine.HeadingMatch,
	seenSlugs []string,
) (g.Node, error)

UnifiedSearchResults renders the unified search page with all result types

type SEOData

type SEOData struct {
	PageTitle    string
	Description  string
	CanonicalURL string
	OGType       string
	Keywords     []string
	AuthorMeta   interface{}
	DateMeta     interface{}
	ModifiedMeta interface{}
}

SEOData contains all the computed SEO properties for a page

func ComputeSEOData

func ComputeSEOData(note *model.Note, baseSiteTitle, baseSiteDescription string) SEOData

ComputeSEOData extracts and computes SEO properties from a note and site configuration

type TOCItem

type TOCItem struct {
	ID    string
	Text  string
	Level int
}

TOCItem represents a table of contents item

Jump to

Keyboard shortcuts

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