pkg

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(path string) error

Init creates a new Shifu project directory structure in given directory.

func Version

func Version() string

Version returns the Shifu version number.

Types

type Server added in v0.5.0

type Server struct {
	// Content is the CMS content.
	Content *cms.CMS

	// Sitemap is the sitemap generated from the content.
	Sitemap *sitemap.Sitemap
	// contains filtered or unexported fields
}

Server is the Shifu server.

func NewServer added in v0.5.0

func NewServer(dir string, options ServerOptions) (*Server, error)

NewServer creates a new Shifu server for given directory. The second argument is an optional template.FuncMap that will be merged with Shifu's funcmap.

func (*Server) Start added in v0.5.0

func (server *Server) Start(cancel context.CancelFunc) error

Start starts the Shifu server. The context.CancelFunc is optional and will be called on server shutdown or error if set.

type ServerOptions added in v0.5.0

type ServerOptions struct {
	// Router is the router used by the server. If set, it will be used to attach the Shifu handlers.
	// Otherwise, a new router will be created.
	Router chi.Router

	// FuncMap will be merged with the default Shifu template function map.
	FuncMap template.FuncMap
}

ServerOptions are the options for the Shifu Server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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