theme

package
v1.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateThemeMarketSource

func CreateThemeMarketSource(c *gin.Context)

func DeleteTheme

func DeleteTheme(c *gin.Context)

DeleteTheme 删除主题

func DeleteThemeMarketSource

func DeleteThemeMarketSource(c *gin.Context)

func ImportTheme

func ImportTheme(c *gin.Context)

ImportTheme 导入远程主题 支持preview查询参数:preview=true时仅返回主题信息,否则下载安装 请求body: {"url": "https://..."} URL支持GitHub仓库地址(自动取latest release)和直接ZIP下载链接

func InstallThemeFromMarket

func InstallThemeFromMarket(c *gin.Context)

func InstallZip

func InstallZip(zipPath string) (models.Theme, error)

InstallZip 解压并验证主题

func ListThemeMarketCatalog

func ListThemeMarketCatalog(c *gin.Context)

func ListThemeMarketSources

func ListThemeMarketSources(c *gin.Context)

func ListThemes

func ListThemes(c *gin.Context)

ListThemes 列出所有主题

func RegisterRoutes

func RegisterRoutes(g *gin.RouterGroup)

RegisterRoutes binds the theme feature's admin routes under g (typically /api/admin). Theme installation goes through the shared chunked-upload endpoint; everything else here is a plain REST handler.

func SetTheme

func SetTheme(c *gin.Context)

SetTheme 设置主题

func UpdateTheme

func UpdateTheme(c *gin.Context)

UpdateTheme 更新主题 支持四种更新方式: 1. 使用主题原有URL下载更新 2. 提供新的直接下载URL进行更新 3. 提供GitHub仓库信息,从最新release下载更新 4. 如果主题URL是GitHub仓库地址,自动获取最新release

func UpdateThemeMarketSource

func UpdateThemeMarketSource(c *gin.Context)

func UpdateThemeSettings

func UpdateThemeSettings(c *gin.Context)

Types

type ThemeMarketSource

type ThemeMarketSource struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	URL     string `json:"url"`
	Enabled bool   `json:"enabled"`
}

type ThemeMarketTheme

type ThemeMarketTheme struct {
	Name        any    `json:"name"`
	Short       string `json:"short"`
	Description any    `json:"description"`
	Version     string `json:"version"`
	Author      any    `json:"author"`
	URL         string `json:"url"`
	Preview     string `json:"preview"`
	Download    string `json:"download"`
	SHA256      string `json:"sha256"`
	Installable bool   `json:"installable"`
	SourceID    string `json:"source_id,omitempty"`
	SourceName  string `json:"source_name,omitempty"`
}

Jump to

Keyboard shortcuts

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