diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-21 09:35:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-04-08 13:26:17 +0200 |
commit | d070bdf10f14d233288f7318a4e9f7555f070a65 (patch) | |
tree | fff8d59f98bdab3027bb45c4e10ca88594332872 /common | |
parent | b08193971a821fc27e549a73120c15e5e5186775 (diff) |
Rework the Destination filesystem to make --renderStaticToDisk work
See #9626
Diffstat (limited to 'common')
-rw-r--r-- | common/paths/path.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/paths/path.go b/common/paths/path.go index 63e831ff6..3a7f3e790 100644 --- a/common/paths/path.go +++ b/common/paths/path.go @@ -63,6 +63,15 @@ func (filepathBridge) Separator() string { var fpb filepathBridge +// AbsPathify creates an absolute path if given a working dir and a relative path. +// If already absolute, the path is just cleaned. +func AbsPathify(workingDir, inPath string) string { + if filepath.IsAbs(inPath) { + return filepath.Clean(inPath) + } + return filepath.Join(workingDir, inPath) +} + // MakeTitle converts the path given to a suitable title, trimming whitespace // and replacing hyphens with whitespace. func MakeTitle(inpath string) string { |