package paths

import "github.com/gohugoio/hugo/hugolib/paths"

Index

Variables

var FilePathSeparator = string(filepath.Separator)

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

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

func (*Paths) GetBasePath

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

GetBasePath returns any path element in baseURL if needed.

func (*Paths) GetLangSubDir

func (p *Paths) GetLangSubDir(lang string) string

GetLangSubDir returns the given language's subdir if needed.

func (*Paths) GetLanguagePrefix

func (p *Paths) GetLanguagePrefix() string

func (*Paths) GetTargetLanguageBasePath

func (p *Paths) GetTargetLanguageBasePath() string

func (*Paths) GetURLLanguageBasePath

func (p *Paths) GetURLLanguageBasePath() string

func (*Paths) Lang

func (p *Paths) Lang() string

func (*Paths) RelPathify

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.

Source Files

paths.go

Version
v0.114.0
Published
Jun 19, 2023
Platform
windows/amd64
Imports
6 packages
Last checked
43 minutes ago

Tools for package owners.