themestorefront

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 6 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

modules/theme-storefront

Official Lesstruct module: the storefront theme artifact — embedded layouts, static assets, template funcs, and the standalone commerce pages (cart, checkout, order tracking) consumed by the site-ssr engine. The eCommerce edition registers it in place of theme-default.

Layout (module template)

module.go            # kernel.Module + ThemeProvider + ThemePageProvider (single registry-facing file)
files.go             # embedded pages/ + static/ artifact + Files() accessor
pages/               # embedded *.gohtml layouts, including the commerce shells
static/              # embedded CSS/JS assets (storefront.js, minified from storefront.src.js via `make js`, and base.css/style.css, minified from their `.src.css` sources via `make css`; together they style and hydrate the commerce pages)
admin/               # admin-shell manifest (empty: themes ship no admin UI)
testutil/            # kernel fixture for module tests

Files

The artifact mirrors the theme-default layout: pages/<name>.gohtml and static/<name> are resolved by the engine with THEME_DIR overrides layered on top, so a child theme can shadow any page or asset by name.

The commerce pages are declared through ThemePages() — cart, checkout, and orders/track — and render at /cart, /checkout, and /orders/track through the shared layout with StandalonePageData (every layout field plus the page key). storefront.js hydrates them client-side from the public catalog, cart, checkout, order, and payment APIs; prices format with zero decimals for IDR/JPY/KRW/VND and two decimals elsewhere. The readable source is static/storefront.src.js — edit it, then run make js to regenerate the minified static/storefront.js browsers receive.

Content posts keep the shared comment section: post.gohtml renders existing comments and, when AllowComments is true, loads comments.js page-scoped. The public search box, KaTeX math, and highlight.js syntax highlighting stay default-theme-only.

ThemeFuncs() contributes lines, which splits a newline-separated custom-field value into a trimmed list (used for gallery-style fields).

Documentation

Overview

Package themestorefront is the official storefront theme module: the embedded layouts, static assets, template funcs, and standalone commerce pages (cart, checkout, order tracking) the site-ssr engine consumes. The commerce edition registers it in place of the default blog theme.

Index

Constants

View Source
const (
	// Name is the registry key for this module.
	Name = "theme-storefront"

	// Version is the module version reported via Module.Version.
	Version = "0.1.0"
)

Variables

This section is empty.

Functions

func Files

func Files() fs.FS

Files returns the storefront artifact filesystem, rooted at the directories above (paths like "pages/product.gohtml" and "static/storefront.js"). Core installs it once at startup via the template package's setter.

Types

type Module

type Module struct{}

Module is the theme-storefront kernel module.

func New

func New() *Module

New builds the module. The theme artifact is static; construction takes no options.

func (*Module) AdminManifest

func (m *Module) AdminManifest() kernel.AdminExtensionManifest

AdminManifest declares this module's admin-shell extensions. A theme ships no admin UI of its own, so the manifest is empty.

func (*Module) Init

func (m *Module) Init(_ kernel.Kernel) error

Init wires the module. There is nothing to wire beyond the embedded files.

func (*Module) Name

func (m *Module) Name() string

Name returns the registry key.

func (*Module) Optional

func (m *Module) Optional() []string

Optional lists soft dependencies. None.

func (*Module) Requires

func (m *Module) Requires() []string

Requires lists hard dependencies. The theme is a leaf artifact consumed by the site-ssr engine, so nothing is required.

func (*Module) Shutdown

func (m *Module) Shutdown() error

Shutdown releases module resources. There are none beyond memory.

func (*Module) ThemeFiles

func (m *Module) ThemeFiles() fs.FS

ThemeFiles returns the storefront artifact filesystem (layouts under pages/, static assets under static/). The site-ssr engine resolves THEME_DIR overrides over it.

func (*Module) ThemeFuncs

func (m *Module) ThemeFuncs() template.FuncMap

ThemeFuncs returns the template funcs this theme contributes beyond the engine's own. lines() turns a gallery field — legacy newline-separated or canonical gallery array — into a URL list without pushing parsing into templates.

func (*Module) ThemePages

func (m *Module) ThemePages() []string

ThemePages declares the standalone commerce shells this theme ships. The engine renders them through the shared layout at the matching public paths and falls through to content/404 when a template is missing.

func (*Module) Version

func (m *Module) Version() string

Version returns the module version.

Directories

Path Synopsis
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for the storefront theme.
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for the storefront theme.
Package testutil provides the kernel fixture module tests run against.
Package testutil provides the kernel fixture module tests run against.

Jump to

Keyboard shortcuts

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