templates

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APITemplate

type APITemplate struct{}

APITemplate is an API-first template with HTMX

func (*APITemplate) Description

func (t *APITemplate) Description() string

func (*APITemplate) Generate

func (t *APITemplate) Generate(dir, projectName, modulePath string) error

func (*APITemplate) Name

func (t *APITemplate) Name() string

type BasicComponentTemplate

type BasicComponentTemplate struct{}

BasicComponentTemplate is a simple functional component

func (*BasicComponentTemplate) Generate

func (t *BasicComponentTemplate) Generate(dir string, opts ComponentOptions) error

type BlogTemplate

type BlogTemplate struct{}

BlogTemplate is a blog template with posts and tags

func (*BlogTemplate) Description

func (t *BlogTemplate) Description() string

func (*BlogTemplate) Generate

func (t *BlogTemplate) Generate(dir, projectName, modulePath string) error

func (*BlogTemplate) Name

func (t *BlogTemplate) Name() string

type ComponentOptions

type ComponentOptions struct {
	Name         string
	Package      string
	WithVariants bool
	WithProps    bool
	WithTest     bool
}

ComponentOptions holds component generation options

type ComponentTemplate

type ComponentTemplate interface {
	Generate(dir string, opts ComponentOptions) error
}

ComponentTemplate defines a component template

func GetComponentTemplate

func GetComponentTemplate(componentType string) (ComponentTemplate, error)

GetComponentTemplate returns a component template by type

type CompoundComponentTemplate

type CompoundComponentTemplate struct{}

CompoundComponentTemplate is a compound component

func (*CompoundComponentTemplate) Generate

func (t *CompoundComponentTemplate) Generate(dir string, opts ComponentOptions) error

type DashboardTemplate

type DashboardTemplate struct{}

DashboardTemplate is an admin dashboard template

func (*DashboardTemplate) Description

func (t *DashboardTemplate) Description() string

func (*DashboardTemplate) Generate

func (t *DashboardTemplate) Generate(dir, projectName, modulePath string) error

func (*DashboardTemplate) Name

func (t *DashboardTemplate) Name() string

type DataComponentTemplate

type DataComponentTemplate struct{}

DataComponentTemplate is a data display component

func (*DataComponentTemplate) Generate

func (t *DataComponentTemplate) Generate(dir string, opts ComponentOptions) error

type DetailPageTemplate

type DetailPageTemplate struct{}

DetailPageTemplate is a detail page with params

func (*DetailPageTemplate) Generate

func (t *DetailPageTemplate) Generate(filePath string, opts PageOptions) error

type DynamicPageTemplate

type DynamicPageTemplate struct{}

DynamicPageTemplate is a page with data loading

func (*DynamicPageTemplate) Generate

func (t *DynamicPageTemplate) Generate(filePath string, opts PageOptions) error

type FormComponentTemplate

type FormComponentTemplate struct{}

FormComponentTemplate is a form component

func (*FormComponentTemplate) Generate

func (t *FormComponentTemplate) Generate(dir string, opts ComponentOptions) error

type FormPageTemplate

type FormPageTemplate struct{}

FormPageTemplate is a page with a form

func (*FormPageTemplate) Generate

func (t *FormPageTemplate) Generate(filePath string, opts PageOptions) error

type LayoutComponentTemplate

type LayoutComponentTemplate struct{}

LayoutComponentTemplate is a layout component

func (*LayoutComponentTemplate) Generate

func (t *LayoutComponentTemplate) Generate(dir string, opts ComponentOptions) error

type ListPageTemplate

type ListPageTemplate struct{}

ListPageTemplate is a list page with items

func (*ListPageTemplate) Generate

func (t *ListPageTemplate) Generate(filePath string, opts PageOptions) error

type MinimalTemplate

type MinimalTemplate struct{}

MinimalTemplate is a minimal project template

func (*MinimalTemplate) Description

func (t *MinimalTemplate) Description() string

func (*MinimalTemplate) Generate

func (t *MinimalTemplate) Generate(dir, projectName, modulePath string) error

func (*MinimalTemplate) Name

func (t *MinimalTemplate) Name() string

type PageOptions

type PageOptions struct {
	Name       string
	Package    string
	Path       string
	WithLoader bool
	WithMeta   bool
}

PageOptions holds page generation options

type PageTemplate

type PageTemplate interface {
	Generate(filePath string, opts PageOptions) error
}

PageTemplate defines a page template

func GetPageTemplate

func GetPageTemplate(pageType string) (PageTemplate, error)

GetPageTemplate returns a page template by type

type ProjectTemplate

type ProjectTemplate interface {
	// Name returns the template name
	Name() string

	// Description returns the template description
	Description() string

	// Generate generates the template in the given directory
	Generate(dir, projectName, modulePath string) error
}

ProjectTemplate defines a project template

func GetProjectTemplate

func GetProjectTemplate(name string) (ProjectTemplate, error)

GetProjectTemplate returns a project template by name

type SimplePageTemplate

type SimplePageTemplate struct{}

SimplePageTemplate is a static page

func (*SimplePageTemplate) Generate

func (t *SimplePageTemplate) Generate(filePath string, opts PageOptions) error

type StandardTemplate

type StandardTemplate struct{}

StandardTemplate is a standard project template with router and components

func (*StandardTemplate) Description

func (t *StandardTemplate) Description() string

func (*StandardTemplate) Generate

func (t *StandardTemplate) Generate(dir, projectName, modulePath string) error

func (*StandardTemplate) Name

func (t *StandardTemplate) Name() string

Jump to

Keyboard shortcuts

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