Help us shape the future of Go! Take the 2026 Go Developer Survey

web

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

Web module

modules/web is the public site: what an anonymous visitor sees at the root of a tenant's host. It renders the site settings and the content module's published pages through ui/page and ui/components, with a bar where the admin has a sidebar, no controller of its own and no data of its own — two public routes, / and /{slug}, and nothing to declare. A tenant's theme and primary colour are pinned on the document, and the prose sheet in internal/style.go styles rendered Markdown in the same ui/style steps the components use.

Compose it in the reference application with web.Deps{Site, Content, Theme} and leave it out of an application that has a storefront of its own: the root belongs to one module, and two claiming it fail at boot. It is the smallest complete shell to copy when writing your own. make test TEST_PACKAGES=./modules/web/... needs the development database.

Documentation

Overview

Package web is the public site: what an anonymous visitor sees at the root of a tenant's host. It renders what the site module's settings and the content module's published pages say, and writes nothing of its own — a shell composed from ui/page and ui/components the way the admin is, with a bar where the admin has a sidebar, and no controller of its own: the only script a page may carry is the shared snippet that applies a theme the visitor stored, and a page whose theme the tenant pinned carries none.

It is composed in the reference application and left out of one that has a storefront of its own: the root belongs to one module, and two claiming it is a boot failure rather than a coin toss. The module has no permissions, no events, no jobs and no table; everything it shows is another module's.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(deps Deps) module.Module

Module is the manifest: two public routes and nothing else to declare.

Types

type Deps

type Deps struct {
	Site    sitecontracts.Service
	Content contentcontracts.Service
	Theme   design.Pair
}

Deps is what the site reads: the settings, the published pages, and the palette the stylesheet is composed from. Both services are required.

Directories

Path Synopsis
Package internal is the site's pages: the home, one published page, and the two things a visitor sees when there is nothing to show.
Package internal is the site's pages: the home, one published page, and the two things a visitor sees when there is nothing to show.

Jump to

Keyboard shortcuts

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