Skip to content

Commit 04b8985

Browse files
authored
all: Fix minor typos
1 parent 21fa1e8 commit 04b8985

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+124
-124
lines changed

benchSite.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# allow user to override go executable by running as GOEXE=xxx make ...
44
GOEXE="${GOEXE-go}"
55

6-
# Send in a regexp mathing the benchmarks you want to run, i.e. './benchSite.sh "YAML"'.
6+
# Send in a regexp matching the benchmarks you want to run, i.e. './benchSite.sh "YAML"'.
77
# Note the quotes, which will be needed for more complex expressions.
88
# The above will run all variations, but only for front matter YAML.
99

cache/filecache/filecache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func (c *Cache) GetOrCreateBytes(id string, create func() ([]byte, error)) (Item
221221
return info, b, nil
222222
}
223223

224-
// GetBytes gets the file content with the given id from the cahce, nil if none found.
224+
// GetBytes gets the file content with the given id from the cache, nil if none found.
225225
func (c *Cache) GetBytes(id string) (ItemInfo, []byte, error) {
226226
id = cleanID(id)
227227

cache/namedmemcache/named_cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (c *Cache) Clear() {
5454
// GetOrCreate tries to get the value with the given cache key, if not found
5555
// create will be called and cached.
5656
// This method is thread safe. It also guarantees that the create func for a given
57-
// key is invoced only once for this cache.
57+
// key is invoked only once for this cache.
5858
func (c *Cache) GetOrCreate(key string, create func() (interface{}, error)) (interface{}, error) {
5959
c.mu.RLock()
6060
entry, found := c.cache[key]

codegen/methods.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ func (m Methods) Imports() []string {
365365
}
366366

367367
// ToMarshalJSON creates a MarshalJSON method for these methods. Any method name
368-
// matchin any of the regexps in excludes will be ignored.
368+
// matching any of the regexps in excludes will be ignored.
369369
func (m Methods) ToMarshalJSON(receiver, pkgPath string, excludes ...string) (string, []string) {
370370
var sb strings.Builder
371371

common/hugio/readers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type ReadSeekCloser interface {
3232
}
3333

3434
// ReadSeekerNoOpCloser implements ReadSeekCloser by doing nothing in Close.
35-
// TODO(bep) rename this and simila to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.
35+
// TODO(bep) rename this and similar to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.
3636
type ReadSeekerNoOpCloser struct {
3737
ReadSeeker
3838
}

config/commonConfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var DefaultBuild = Build{
3434
WriteStats: false,
3535
}
3636

37-
// Build holds some build related condfiguration.
37+
// Build holds some build related configuration.
3838
type Build struct {
3939
UseResourceCacheWhen string // never, fallback, always. Default is fallback
4040

helpers/path.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func ishex(c rune) bool {
128128

129129
// UnicodeSanitize sanitizes string to be used in Hugo URL's, allowing only
130130
// a predefined set of special Unicode characters.
131-
// If RemovePathAccents configuration flag is enabled, Uniccode accents
131+
// If RemovePathAccents configuration flag is enabled, Unicode accents
132132
// are also removed.
133133
// Spaces will be replaced with a single hyphen, and sequential hyphens will be reduced to one.
134134
func (p *PathSpec) UnicodeSanitize(s string) string {
@@ -212,12 +212,12 @@ func GetDottedRelativePath(inPath string) string {
212212
return dottedPath
213213
}
214214

215-
// ExtNoDelimiter takes a path and returns the extension, excluding the delmiter, i.e. "md".
215+
// ExtNoDelimiter takes a path and returns the extension, excluding the delimiter, i.e. "md".
216216
func ExtNoDelimiter(in string) string {
217217
return strings.TrimPrefix(Ext(in), ".")
218218
}
219219

220-
// Ext takes a path and returns the extension, including the delmiter, i.e. ".md".
220+
// Ext takes a path and returns the extension, including the delimiter, i.e. ".md".
221221
func Ext(in string) string {
222222
_, ext := fileAndExt(in, fpb)
223223
return ext
@@ -229,13 +229,13 @@ func PathAndExt(in string) (string, string) {
229229
}
230230

231231
// FileAndExt takes a path and returns the file and extension separated,
232-
// the extension including the delmiter, i.e. ".md".
232+
// the extension including the delimiter, i.e. ".md".
233233
func FileAndExt(in string) (string, string) {
234234
return fileAndExt(in, fpb)
235235
}
236236

237237
// FileAndExtNoDelimiter takes a path and returns the file and extension separated,
238-
// the extension excluding the delmiter, e.g "md".
238+
// the extension excluding the delimiter, e.g "md".
239239
func FileAndExtNoDelimiter(in string) (string, string) {
240240
file, ext := fileAndExt(in, fpb)
241241
return file, strings.TrimPrefix(ext, ".")

helpers/pathspec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type PathSpec struct {
3737
Cfg config.Provider
3838
}
3939

40-
// NewPathSpec creats a new PathSpec from the given filesystems and language.
40+
// NewPathSpec creates a new PathSpec from the given filesystems and language.
4141
func NewPathSpec(fs *hugofs.Fs, cfg config.Provider, logger loggers.Logger) (*PathSpec, error) {
4242
return NewPathSpecWithBaseBaseFsProvided(fs, cfg, logger, nil)
4343
}

helpers/url.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (p *PathSpec) URLize(uri string) string {
105105
return p.URLEscape(p.MakePathSanitized(uri))
106106
}
107107

108-
// URLizeFilename creates an URL from a filename by esacaping unicode letters
108+
// URLizeFilename creates an URL from a filename by escaping unicode letters
109109
// and turn any filepath separator into forward slashes.
110110
func (p *PathSpec) URLizeFilename(filename string) string {
111111
return p.URLEscape(filepath.ToSlash(filename))
@@ -280,7 +280,7 @@ func AddContextRoot(baseURL, relativePath string) string {
280280

281281
newPath := path.Join(url.Path, relativePath)
282282

283-
// path strips traling slash, ignore root path.
283+
// path strips trailing slash, ignore root path.
284284
if newPath != "/" && strings.HasSuffix(relativePath, "/") {
285285
newPath += "/"
286286
}

hugofs/filter_fs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func (f *filterDir) Readdirnames(count int) ([]string, error) {
276276
}
277277

278278
// Try to extract the language from the given filename.
279-
// Any valid language identificator in the name will win over the
279+
// Any valid language identifier in the name will win over the
280280
// language set on the file system, e.g. "mypost.en.md".
281281
func langInfoFrom(languages map[string]int, name string) (string, string, string) {
282282
var lang string

hugofs/nosymlink_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func TestNoSymlinkFs(t *testing.T) {
135135
// Check readdir
136136
f, err = fs.Open(workDir)
137137
c.Assert(err, qt.IsNil)
138-
// There is at least one unsported symlink inside workDir
138+
// There is at least one unsupported symlink inside workDir
139139
_, err = f.Readdir(-1)
140140
c.Assert(err, qt.IsNil)
141141
f.Close()

hugofs/rootmapping_fs_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func TestRootMappingFsMount(t *testing.T) {
270270
c.Assert(err, qt.IsNil)
271271
c.Assert(string(b), qt.Equals, "some no content")
272272

273-
// Ambigous
273+
// Ambiguous
274274
_, err = rfs.Stat(filepath.FromSlash("content/singles/p1.md"))
275275
c.Assert(err, qt.Not(qt.IsNil))
276276

hugolib/breaking_changes_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
)
2222

2323
func Test073(t *testing.T) {
24-
asertDisabledTaxonomyAndTerm := func(b *sitesBuilder, taxonomy, term bool) {
24+
assertDisabledTaxonomyAndTerm := func(b *sitesBuilder, taxonomy, term bool) {
2525
b.Assert(b.CheckExists("public/tags/index.html"), qt.Equals, taxonomy)
2626
b.Assert(b.CheckExists("public/tags/tag1/index.html"), qt.Equals, term)
2727
}
@@ -88,15 +88,15 @@ taxonomy = ["JSON"]
8888
`disableKinds = ["taxonomy", "taxonomyTerm"]`,
8989
func(err error, out string, b *sitesBuilder) {
9090
b.Assert(err, qt.IsNil)
91-
asertDisabledTaxonomyAndTerm(b, false, false)
91+
assertDisabledTaxonomyAndTerm(b, false, false)
9292
},
9393
},
9494
{
9595
"Disable only taxonomyTerm",
9696
`disableKinds = ["taxonomyTerm"]`,
9797
func(err error, out string, b *sitesBuilder) {
9898
b.Assert(err, qt.IsNil)
99-
asertDisabledTaxonomyAndTerm(b, false, true)
99+
assertDisabledTaxonomyAndTerm(b, false, true)
100100
},
101101
},
102102
{
@@ -113,7 +113,7 @@ taxonomy = ["JSON"]
113113
ignoreErrors = ["error-disable-taxonomy"]`,
114114
func(err error, out string, b *sitesBuilder) {
115115
b.Assert(err, qt.IsNil)
116-
asertDisabledTaxonomyAndTerm(b, false, true)
116+
assertDisabledTaxonomyAndTerm(b, false, true)
117117
},
118118
},
119119
} {

hugolib/content_map.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const (
5858
cmLeafSeparator = "__hl_"
5959
)
6060

61-
// Used to mark ambigous keys in reverse index lookups.
62-
var ambigousContentNode = &contentNode{}
61+
// Used to mark ambiguous keys in reverse index lookups.
62+
var ambiguousContentNode = &contentNode{}
6363

6464
func newContentMap(cfg contentMapConfig) *contentMap {
6565
m := &contentMap{
@@ -86,8 +86,8 @@ func newContentMap(cfg contentMapConfig) *contentMap {
8686
addToReverseMap := func(k string, n *contentNode, m map[interface{}]*contentNode) {
8787
k = strings.ToLower(k)
8888
existing, found := m[k]
89-
if found && existing != ambigousContentNode {
90-
m[k] = ambigousContentNode
89+
if found && existing != ambiguousContentNode {
90+
m[k] = ambiguousContentNode
9191
} else if !found {
9292
m[k] = n
9393
}

hugolib/content_map_page.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func (m *pageMap) newResource(fim hugofs.FileMetaInfo, owner *pageState) (resour
232232
outputFormats := owner.m.outputFormats()
233233
seen := make(map[string]bool)
234234
var targetBasePaths []string
235-
// Make sure bundled resources are published to all of the ouptput formats'
235+
// Make sure bundled resources are published to all of the output formats'
236236
// sub paths.
237237
for _, f := range outputFormats {
238238
p := f.Path

hugolib/embedded_shortcodes_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func TestShortcodeYoutube(t *testing.T) {
185185
`{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`,
186186
"(?s)\n<div class=\"video\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen title=\"YouTube Video\">.*?</iframe>.*?</div>",
187187
},
188-
// set custom title for accessability)
188+
// set custom title for accessibility)
189189
{
190190
`{{< youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" >}}`,
191191
"(?s)\n<div style=\".*?\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\" style=\".*?\" allowfullscreen title=\"A New Hugo Site in Under Two Minutes\">.*?</iframe>.*?</div>",

hugolib/hugo_modules_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ JS imported in module: |
151151
"devDependencies": {
152152
"postcss-cli": "7.8.0",
153153
"tailwindcss": "1.8.0"
154-
154+
155155
}
156156
}`)
157157

@@ -375,7 +375,7 @@ module github.com/gohugoio/tests/testHugoModules
375375
}
376376

377377
func createChildModMatchers(m *mods.Md, ignoreVendor, vendored bool) []string {
378-
// Child depdendencies are one behind.
378+
// Child dependencies are one behind.
379379
expectMinorVersion := 3
380380

381381
if !ignoreVendor && vendored {
@@ -1078,7 +1078,7 @@ workingDir=%q
10781078
[[module.mounts]]
10791079
source = %q
10801080
target = "content"
1081-
1081+
10821082
`, workDir, absContentDir)
10831083

10841084
defer clean1()

hugolib/page.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ type renderStringOpts struct {
584584
Markup string
585585
}
586586

587-
var defualtRenderStringOpts = renderStringOpts{
587+
var defaultRenderStringOpts = renderStringOpts{
588588
Display: "inline",
589589
Markup: "", // Will inherit the page's value when not set.
590590
}
@@ -595,7 +595,7 @@ func (p *pageState) RenderString(args ...interface{}) (template.HTML, error) {
595595
}
596596

597597
var s string
598-
opts := defualtRenderStringOpts
598+
opts := defaultRenderStringOpts
599599
sidx := 1
600600

601601
if len(args) == 1 {
@@ -978,7 +978,7 @@ func (p *pageState) shiftToOutputFormat(isRenderingSite bool, idx int) error {
978978
//
979979
// For pages that have a source file, it is returns the path to this file as an
980980
// absolute path rooted in this site's content dir.
981-
// For pages that do not (sections witout content page etc.), it returns the
981+
// For pages that do not (sections without content page etc.), it returns the
982982
// virtual path, consistent with where you would add a source file.
983983
func (p *pageState) sourceRef() string {
984984
if !p.File().IsZero() {

hugolib/page__common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type pageCommon struct {
5757
bucket *pagesMapBucket
5858
treeRef *contentTreeRef
5959

60-
// Laziliy initialized dependencies.
60+
// Lazily initialized dependencies.
6161
init *lazy.Init
6262

6363
// All of these represents the common parts of a page.Page

hugolib/pagebundler_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func TestPageBundlerSiteMultilingual(t *testing.T) {
302302
// A bundle in a/b/index.en.md
303303
// a/b/index.en.md => OK
304304
// a/b/index => OK
305-
// index.en.md => ambigous, but OK.
305+
// index.en.md => ambiguous, but OK.
306306
// With bundles, the file name has little meaning, the folder it lives in does. So this should also work:
307307
// a/b
308308
// and probably also just b (aka "my-bundle")
@@ -1250,7 +1250,7 @@ func TestBundleTransformMany(t *testing.T) {
12501250
title: "Page"
12511251
weight: %d
12521252
---
1253-
1253+
12541254
`, i))
12551255
b.WithSourceFile(fmt.Sprintf("content/bundle%d/data.yaml", i), fmt.Sprintf(`data: v%d`, i))
12561256
b.WithSourceFile(fmt.Sprintf("content/bundle%d/data.json", i), fmt.Sprintf(`{ "data": "v%d" }`, i))

hugolib/pagecollections.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func newPageCollections(m *pageMap) *PageCollections {
9898

9999
// This is an adapter func for the old API with Kind as first argument.
100100
// This is invoked when you do .Site.GetPage. We drop the Kind and fails
101-
// if there are more than 2 arguments, which would be ambigous.
101+
// if there are more than 2 arguments, which would be ambiguous.
102102
func (c *PageCollections) getPageOldVersion(ref ...string) (page.Page, error) {
103103
var refs []string
104104
for _, r := range ref {
@@ -291,7 +291,7 @@ func (c *PageCollections) getContentNode(context page.Page, isReflink bool, ref
291291
getByName := func(s string) (*contentNode, error) {
292292
n := m.pageReverseIndex.Get(s)
293293
if n != nil {
294-
if n == ambigousContentNode {
294+
if n == ambiguousContentNode {
295295
return nil, fmt.Errorf("page reference %q is ambiguous", ref)
296296
}
297297
return n, nil

hugolib/pages_capture.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func (c *pagesCollector) addToBundle(info hugofs.FileMetaInfo, btyp bundleDirTyp
278278
if btyp == bundleBranch {
279279
// No special logic for branch bundles.
280280
// Every language needs its own _index.md file.
281-
// Also, we only clone bundle headers for lonsesome, bundled,
281+
// Also, we only clone bundle headers for lonesome, bundled,
282282
// content files.
283283
return c.handleFiles(info)
284284
}

hugolib/paths/paths.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (p *Paths) RelPathify(filename string) string {
268268
return strings.TrimPrefix(strings.TrimPrefix(filename, p.WorkingDir), FilePathSeparator)
269269
}
270270

271-
// AbsPathify creates an absolute path if given a working dir and arelative path.
271+
// AbsPathify creates an absolute path if given a working dir and a relative path.
272272
// If already absolute, the path is just cleaned.
273273
func AbsPathify(workingDir, inPath string) string {
274274
if filepath.IsAbs(inPath) {

hugolib/site.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ func (s *Site) translateFileEvents(events []fsnotify.Event) []fsnotify.Event {
956956
eventMap := make(map[string][]fsnotify.Event)
957957

958958
// We often get a Remove etc. followed by a Create, a Create followed by a Write.
959-
// Remove the superflous events to mage the update logic simpler.
959+
// Remove the superfluous events to mage the update logic simpler.
960960
for _, ev := range events {
961961
eventMap[ev.Name] = append(eventMap[ev.Name], ev)
962962
}
@@ -999,7 +999,7 @@ var (
999999
)
10001000

10011001
// reBuild partially rebuilds a site given the filesystem events.
1002-
// It returns whetever the content source was changed.
1002+
// It returns whatever the content source was changed.
10031003
// TODO(bep) clean up/rewrite this method.
10041004
func (s *Site) processPartial(config *BuildCfg, init func(config *BuildCfg) error, events []fsnotify.Event) error {
10051005
events = s.filterFileEvents(events)
@@ -1513,7 +1513,7 @@ func (s *Site) assembleMenus() {
15131513
}
15141514
}
15151515

1516-
// get any lanaguagecode to prefix the target file path with.
1516+
// get any language code to prefix the target file path with.
15171517
func (s *Site) getLanguageTargetPathLang(alwaysInSubDir bool) string {
15181518
if s.h.IsMultihost() {
15191519
return s.Language().Lang

0 commit comments

Comments
 (0)