mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
all: Fix minor typos
This commit is contained in:
@@ -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, ".")
|
||||
|
@@ -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)
|
||||
}
|
||||
|
@@ -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 += "/"
|
||||
}
|
||||
|
Reference in New Issue
Block a user