publisher

package
v0.104.3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 24 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Descriptor

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

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

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

	// Counter for the end build summary.
	StatCounter *uint64

	// Configuration that trigger pre-processing.
	// LiveReload script will be injected if this is != nil
	LiveReloadBaseURL *url.URL

	// Enable to inject the Hugo generated tag in the header. Is currently only
	// injected on the home page for HTML type of output formats.
	AddHugoGeneratorTag bool

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

	// Enable to minify the output using the OutputFormat defined above to
	// pick the correct minifier configuration.
	Minify bool
}

Descriptor describes the needed publishing chain for an item.

type DestinationPublisher

type DestinationPublisher struct {
	// contains filtered or unexported fields
}

DestinationPublisher is the default and currently only publisher in Hugo. This publisher prepares and publishes an item to the defined destination, e.g. /public.

func NewDestinationPublisher

func NewDestinationPublisher(rs *resources.Spec, outputFormats output.Formats, mediaTypes media.Types) (pub DestinationPublisher, err error)

NewDestinationPublisher creates a new DestinationPublisher.

func (DestinationPublisher) Publish

func (p DestinationPublisher) Publish(d Descriptor) error

Publish applies any relevant transformations and writes the file to its destination, e.g. /public.

func (DestinationPublisher) PublishStats added in v0.69.0

func (p DestinationPublisher) PublishStats() PublishStats

type HTMLElements added in v0.69.0

type HTMLElements struct {
	Tags    []string `json:"tags"`
	Classes []string `json:"classes"`
	IDs     []string `json:"ids"`
}

HTMLElements holds lists of tags and attribute values for classes and id.

func (*HTMLElements) Merge added in v0.69.0

func (h *HTMLElements) Merge(other HTMLElements)

func (*HTMLElements) Sort added in v0.69.0

func (h *HTMLElements) Sort()

type PublishStats added in v0.69.0

type PublishStats struct {
	HTMLElements HTMLElements `json:"htmlElements"`
}

type Publisher

type Publisher interface {
	Publish(d Descriptor) error
	PublishStats() PublishStats
}

Publisher publishes a result file.

Jump to

Keyboard shortcuts

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