hugosites

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindPage = "page"

	KindHome    = "home"
	KindSection = "section"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentProvider

type ContentProvider interface {
	Content() (any, error)
}

ContentProvider provides the content related values for a Page.

type Descriptor

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

	// The OutputFormat of this content.
	OutputFormat valueobject.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 File

type File interface {
	FileWithoutOverlap
	// contains filtered or unexported methods
}

File represents a source file. This is a temporary construct until we resolve page.Page conflicts. TODO(bep) remove this construct once we have resolved page deprecations

type FileProvider

type FileProvider interface {
	File() File
}

FileProvider provides the source file.

type FileWithoutOverlap

type FileWithoutOverlap interface {

	// Filename gets the full path and filename to the file.
	Filename() string

	// Dir gets the name of the directory that contains this file.
	// The directory is relative to the content root.
	Dir() string

	// Extension is an alias to Ext().
	// Deprecated: Use Ext instead.
	Extension() string

	// Ext gets the file extension, i.e "myblogpost.md" will return "md".
	Ext() string

	// LogicalName is filename and extension of the file.
	LogicalName() string

	// BaseFileName is a filename without extension.
	BaseFileName() string

	// TranslationBaseName is a filename with no extension,
	// not even the optional language extension part.
	TranslationBaseName() string

	// ContentBaseName is a either TranslationBaseName or name of containing folder
	// if file is a leaf bundle.
	ContentBaseName() string

	// UniqueID is the MD5 hash of the file's path and is for most practical applications,
	// Hugo content files being one of them, considered to be unique.
	UniqueID() string

	FileInfo() fsVO.FileMetaInfo
}

type OutputFormatsProvider

type OutputFormatsProvider interface {
	OutputFormats() valueobject.OutputFormats
}

OutputFormatsProvider provides the OutputFormats of a Page.

type Page

type Page interface {
	ContentProvider
	PageWithoutContent
}

Page is the core interface in Hugo.

type PageMetaProvider

type PageMetaProvider interface {

	// Kind The Page Kind. One of page, home, section, taxonomy, term.
	Kind() string

	// SectionsEntries Returns a slice of sections (directories if it's a file) to this
	// Page.
	SectionsEntries() []string

	// Layout The configured layout to use to render this page. Typically set in front matter.
	Layout() string

	// Type is a discriminator used to select layouts etc. It is typically set
	// in front matter, but will fall back to the root section.
	Type() string
}

PageMetaProvider provides page metadata, typically provided via front matter.

type PagePerOutputProviders

type PagePerOutputProviders interface {
	TargetPather
	ResourceLinksProvider
}

PagePerOutputProviders will be shifted out when rendering a given output format.

type PageWithoutContent

type PageWithoutContent interface {
	// FileProvider For pages backed by a file.
	FileProvider

	PageMetaProvider
}

PageWithoutContent is the Page without any of the content methods.

type Publisher

type Publisher interface {
	Publish(d Descriptor) error
}

Publisher publishes a result file.

type ResourceLinksProvider

type ResourceLinksProvider interface {
	// Permalink represents the absolute link to this resource.
	Permalink() string

	// RelPermalink represents the host relative link to this resource.
	RelPermalink() string
}

type SitesProvider

type SitesProvider interface {
	Site() site.Site
	Sites() site.Sites
}

SitesProvider provide accessors to get sites.

type TargetPather

type TargetPather interface {
	TargetPaths() valueobject.TargetPaths
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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