From 04b89857e104ac7dcbf9fc65d8d4f1a1178123e6 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 16 Dec 2020 16:56:32 +0545 Subject: all: Fix minor typos --- helpers/path.go | 10 +++++----- helpers/pathspec.go | 2 +- helpers/url.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'helpers') 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 += "/" } -- cgit v1.2.3