site

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigService

type ConfigService interface {
	ConfigParams() map[string]any
	SiteTitle() string
	Menus() map[string][]Menu
}

type ContentService

type ContentService interface {
	WalkPages(langIndex int, walker contenthub.WalkFunc) error
	GetPageSources(page contenthub.Page) ([]contenthub.PageSource, error)
	WalkTaxonomies(langIndex int, walker contenthub.WalkTaxonomyFunc) error
	GlobalPages(langIndex int) contenthub.Pages
	GlobalRegularPages() contenthub.Pages

	SearchPage(ctx context.Context, pages contenthub.Pages, page contenthub.Page) (contenthub.Pages, error)

	GetPageFromPath(langIndex int, path string) (contenthub.Page, error)
	GetPageRef(context contenthub.Page, ref string, home contenthub.Page) (contenthub.Page, error)
}

type ContentSpec

type ContentSpec interface {
	PreparePages() error
	RenderPages(func(kind string, sec []string, dir, name string, buf *bytes.Buffer) error) error
}

type Descriptor

type Descriptor struct {
	// The content to publish.
	Src io.Reader

	// The OutputFormat of this content.
	OutputFormat output.Format

	// Where to publish this content. This is a filesystem-relative path.
	TargetPath string

	// If set, will replace all relative URLs with this one.
	AbsURLPath string
}

Descriptor describes the needed publishing chain for an item.

type FsService

type FsService interface {
	Publish() afero.Fs
	WorkingDir() string
}

type Language

type Language interface {
	Location() *time.Location
	Collator() *collate.Collator
}

type LanguageService

type LanguageService interface {
	DefaultLanguage() string
	LanguageKeys() []string
	GetLanguageIndex(lang string) (int, error)
	GetLanguageName(lang string) string
}
type Menu interface {
	Name() string
	URL() string
	Weight() int
}

type Publisher

type Publisher interface {
	Publish(d Descriptor) error
}

Publisher publishes a result file.

type ResourceService

type ResourceService interface {
	GetResourceWithOpener(pathname string, opener pio.OpenReadSeekCloser) (resources.Resource, error)
}

type Site

type Site interface {
	URL
	Language
}

type SitemapService added in v0.1.6

type SitemapService interface {
	ChangeFreq() string
	Priority() float64
}

type Template

type Template interface {
	MarkReady() error
	LookupLayout(names []string) (template.Preparer, bool, error)
	ExecuteWithContext(ctx context.Context, t template.Preparer, wr io.Writer, data any) error
}

type TranslationService added in v0.1.1

type TranslationService interface {
	Translate(ctx context.Context, lang string, translationID string, templateData any) string
}

type URL

type URL interface {
	AbsURL(in string) string
	RelURL(in string) string
	URLize(uri string) string
}

type URLService

type URLService interface {
	BaseUrl() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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