paths

package
v0.125.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilePathSeparator = string(filepath.Separator)

Functions

This section is empty.

Types

type Paths

type Paths struct {
	Fs  *hugofs.Fs
	Cfg config.AllProvider

	// Directories to store Resource related artifacts.
	AbsResourcesDir string

	AbsPublishDir string

	// When in multihost mode, this returns a list of base paths below PublishDir
	// for each language.
	MultihostTargetBasePaths []string
}

func New

func New(fs *hugofs.Fs, cfg config.AllProvider) (*Paths, error)

func (*Paths) AbsPathify

func (p *Paths) AbsPathify(inPath string) string

AbsPathify creates an absolute path if given a relative path. If already absolute, the path is just cleaned.

func (*Paths) AllModules added in v0.56.0

func (p *Paths) AllModules() modules.Modules

func (*Paths) GetBasePath added in v0.54.0

func (p *Paths) GetBasePath(isRelativeURL bool) string

GetBasePath returns any path element in baseURL if needed. The path returned will have a leading, but no trailing slash.

func (*Paths) GetLanguagePrefix

func (p *Paths) GetLanguagePrefix() string

func (*Paths) GetTargetLanguageBasePath added in v0.45.1

func (p *Paths) GetTargetLanguageBasePath() string

func (*Paths) Lang

func (p *Paths) Lang() string

func (*Paths) RelPathify added in v0.56.0

func (p *Paths) RelPathify(filename string) string

RelPathify trims any WorkingDir prefix from the given filename. If the filename is not considered to be absolute, the path is just cleaned.

Jump to

Keyboard shortcuts

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