Documentation ¶
Index ¶
- Variables
- func AbsPathify(workingDir, inPath string) string
- type BaseURL
- type Paths
- func (p *Paths) AbsPathify(inPath string) string
- func (p *Paths) GetBasePath(isRelativeURL bool) string
- func (p *Paths) GetLangSubDir(lang string) string
- func (p *Paths) GetLanguagePrefix() string
- func (p *Paths) GetTargetLanguageBasePath() string
- func (p *Paths) GetURLLanguageBasePath() string
- func (p *Paths) Lang() string
- func (p *Paths) RelPathify(filename string) string
Constants ¶
This section is empty.
Variables ¶
var FilePathSeparator = string(filepath.Separator)
Functions ¶
func AbsPathify ¶
AbsPathify creates an absolute path if given a working dir and a relative path. If already absolute, the path is just cleaned.
Types ¶
type BaseURL ¶
type BaseURL struct {
// contains filtered or unexported fields
}
A BaseURL in Hugo is normally on the form scheme://path, but the form scheme: is also valid (mailto:hugo@rules.com).
func (BaseURL) HostURL ¶ added in v0.45.1
HostURL returns the URL to the host root without any path elements.
type Paths ¶
type Paths struct { Fs *hugofs.Fs Cfg config.Provider BaseURL // If the baseURL contains a base path, e.g. https://example.com/docs, then "/docs" will be the BasePath. BasePath string // Directories // TODO(bep) when we have trimmed down most of the dirs usage outside of this package, make // these into an interface. ThemesDir string WorkingDir string // Directories to store Resource related artifacts. AbsResourcesDir string AbsPublishDir string // pagination path handling PaginatePath string PublishDir string // When in multihost mode, this returns a list of base paths below PublishDir // for each language. MultihostTargetBasePaths []string DisablePathToLower bool RemovePathAccents bool UglyURLs bool CanonifyURLs bool Language *langs.Language Languages langs.Languages LanguagesDefaultFirst langs.Languages DefaultContentLanguage string AllModules modules.Modules ModulesClient *modules.Client // contains filtered or unexported fields }
func (*Paths) AbsPathify ¶
AbsPathify creates an absolute path if given a relative path. If already absolute, the path is just cleaned.
func (*Paths) GetBasePath ¶ added in v0.54.0
GetBasePath returns any path element in baseURL if needed.
func (*Paths) GetLangSubDir ¶
GetLangSubDir returns the given language's subdir if needed.
func (*Paths) GetLanguagePrefix ¶
func (*Paths) GetTargetLanguageBasePath ¶ added in v0.45.1
func (*Paths) GetURLLanguageBasePath ¶ added in v0.45.1
func (*Paths) RelPathify ¶ added in v0.56.0
RelPathify trims any WorkingDir prefix from the given filename. If the filename is not considered to be absolute, the path is just cleaned.