diff options
Diffstat (limited to 'hugolib/paths/paths.go')
-rw-r--r-- | hugolib/paths/paths.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/hugolib/paths/paths.go b/hugolib/paths/paths.go index 501665676..e80215b92 100644 --- a/hugolib/paths/paths.go +++ b/hugolib/paths/paths.go @@ -34,6 +34,8 @@ type Paths struct { Cfg config.Provider BaseURL + BaseURLString string + BaseURLNoPathString string // If the baseURL contains a base path, e.g. https://example.com/docs, then "/docs" will be the BasePath. BasePath string @@ -145,10 +147,17 @@ func New(fs *hugofs.Fs, cfg config.Provider) (*Paths, error) { } } + var baseURLString = baseURL.String() + var baseURLNoPath = baseURL.URL() + baseURLNoPath.Path = "" + var baseURLNoPathString = baseURLNoPath.String() + p := &Paths{ - Fs: fs, - Cfg: cfg, - BaseURL: baseURL, + Fs: fs, + Cfg: cfg, + BaseURL: baseURL, + BaseURLString: baseURLString, + BaseURLNoPathString: baseURLNoPathString, DisablePathToLower: cfg.GetBool("disablePathToLower"), RemovePathAccents: cfg.GetBool("removePathAccents"), |