summaryrefslogtreecommitdiffstats
path: root/helpers
diff options
context:
space:
mode:
authorPhil Davis <phil@jankaritech.com>2020-12-16 16:56:32 +0545
committerGitHub <noreply@github.com>2020-12-16 12:11:32 +0100
commit04b89857e104ac7dcbf9fc65d8d4f1a1178123e6 (patch)
tree585bf761f0a1cfc69dffcd8afd22e94ca9da7c07 /helpers
parent21fa1e86f2aa929fb0983a0cc3dc4e271ea1cc54 (diff)
all: Fix minor typos
Diffstat (limited to 'helpers')
-rw-r--r--helpers/path.go10
-rw-r--r--helpers/pathspec.go2
-rw-r--r--helpers/url.go4
3 files changed, 8 insertions, 8 deletions
diff --git a/helpers/path.go b/helpers/path.go
index abc73d081..17a513cec 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -128,7 +128,7 @@ func ishex(c rune) bool {
// UnicodeSanitize sanitizes string to be used in Hugo URL's, allowing only
// a predefined set of special Unicode characters.
-// If RemovePathAccents configuration flag is enabled, Uniccode accents
+// If RemovePathAccents configuration flag is enabled, Unicode accents
// are also removed.
// Spaces will be replaced with a single hyphen, and sequential hyphens will be reduced to one.
func (p *PathSpec) UnicodeSanitize(s string) string {
@@ -212,12 +212,12 @@ func GetDottedRelativePath(inPath string) string {
return dottedPath
}
-// ExtNoDelimiter takes a path and returns the extension, excluding the delmiter, i.e. "md".
+// ExtNoDelimiter takes a path and returns the extension, excluding the delimiter, i.e. "md".
func ExtNoDelimiter(in string) string {
return strings.TrimPrefix(Ext(in), ".")
}
-// Ext takes a path and returns the extension, including the delmiter, i.e. ".md".
+// Ext takes a path and returns the extension, including the delimiter, i.e. ".md".
func Ext(in string) string {
_, ext := fileAndExt(in, fpb)
return ext
@@ -229,13 +229,13 @@ func PathAndExt(in string) (string, string) {
}
// FileAndExt takes a path and returns the file and extension separated,
-// the extension including the delmiter, i.e. ".md".
+// the extension including the delimiter, i.e. ".md".
func FileAndExt(in string) (string, string) {
return fileAndExt(in, fpb)
}
// FileAndExtNoDelimiter takes a path and returns the file and extension separated,
-// the extension excluding the delmiter, e.g "md".
+// the extension excluding the delimiter, e.g "md".
func FileAndExtNoDelimiter(in string) (string, string) {
file, ext := fileAndExt(in, fpb)
return file, strings.TrimPrefix(ext, ".")
diff --git a/helpers/pathspec.go b/helpers/pathspec.go
index 5400249eb..49fd9a71c 100644
--- a/helpers/pathspec.go
+++ b/helpers/pathspec.go
@@ -37,7 +37,7 @@ type PathSpec struct {
Cfg config.Provider
}
-// NewPathSpec creats a new PathSpec from the given filesystems and language.
+// NewPathSpec creates a new PathSpec from the given filesystems and language.
func NewPathSpec(fs *hugofs.Fs, cfg config.Provider, logger loggers.Logger) (*PathSpec, error) {
return NewPathSpecWithBaseBaseFsProvided(fs, cfg, logger, nil)
}
diff --git a/helpers/url.go b/helpers/url.go
index 6f4242b09..8c39bc4fa 100644
--- a/helpers/url.go
+++ b/helpers/url.go
@@ -105,7 +105,7 @@ func (p *PathSpec) URLize(uri string) string {
return p.URLEscape(p.MakePathSanitized(uri))
}
-// URLizeFilename creates an URL from a filename by esacaping unicode letters
+// URLizeFilename creates an URL from a filename by escaping unicode letters
// and turn any filepath separator into forward slashes.
func (p *PathSpec) URLizeFilename(filename string) string {
return p.URLEscape(filepath.ToSlash(filename))
@@ -280,7 +280,7 @@ func AddContextRoot(baseURL, relativePath string) string {
newPath := path.Join(url.Path, relativePath)
- // path strips traling slash, ignore root path.
+ // path strips trailing slash, ignore root path.
if newPath != "/" && strings.HasSuffix(relativePath, "/") {
newPath += "/"
}