internal/models/models.go

package models

import "html/template"

type FileNode struct {
	Name        string
	Path        string // Relative path within the project
	Link        string // URL to the rendered page
	IsDir       bool
	Children    []*FileNode
	ContentType string
	Icon        string
}

type Project struct {
	Name        string // Slug/Folder name
	Title       string
	Description string
	Date        string
	Link        string // URL to project index
	ContentDir  string
	TempDir     string
	ZipLink     string
}

type TemplateData struct {
	Title          string
	Content        template.HTML
	FileTree       *FileNode
	CurrentProject *Project
	Projects       []Project // All projects for sidebar
	BaseURL        string
	CurrentPath    string // Current relative path for sidebar highlighting
	IsIndex        bool
	Extra          map[string]any // For any extra data like OverviewContent
}