hugo: github.com/gohugoio/hugo/publisher Index | Files

package publisher

import "github.com/gohugoio/hugo/publisher"

Index

Package Files

publisher.go

type Descriptor Uses

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 > 0
    LiveReloadPort int

    // 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 Uses

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 Uses

func NewDestinationPublisher(fs afero.Fs, outputFormats output.Formats, mediaTypes media.Types, cfg config.Provider) (pub DestinationPublisher, err error)

NewDestinationPublisher creates a new DestinationPublisher.

func (DestinationPublisher) Publish Uses

func (p DestinationPublisher) Publish(d Descriptor) error

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

type Publisher Uses

type Publisher interface {
    Publish(d Descriptor) error
}

Publisher publishes a result file.

Package publisher imports 14 packages (graph) and is imported by 17 packages. Updated 2020-03-29. Refresh now. Tools for package owners.