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 --- hugolib/breaking_changes_test.go | 8 ++++---- hugolib/content_map.go | 8 ++++---- hugolib/content_map_page.go | 2 +- hugolib/embedded_shortcodes_test.go | 2 +- hugolib/hugo_modules_test.go | 6 +++--- hugolib/page.go | 6 +++--- hugolib/page__common.go | 2 +- hugolib/pagebundler_test.go | 4 ++-- hugolib/pagecollections.go | 4 ++-- hugolib/pages_capture.go | 2 +- hugolib/paths/paths.go | 2 +- hugolib/site.go | 6 +++--- hugolib/taxonomy_test.go | 8 ++++---- hugolib/testhelpers_test.go | 4 ++-- 14 files changed, 32 insertions(+), 32 deletions(-) (limited to 'hugolib') diff --git a/hugolib/breaking_changes_test.go b/hugolib/breaking_changes_test.go index a22bc240f..495baff3e 100644 --- a/hugolib/breaking_changes_test.go +++ b/hugolib/breaking_changes_test.go @@ -21,7 +21,7 @@ import ( ) func Test073(t *testing.T) { - asertDisabledTaxonomyAndTerm := func(b *sitesBuilder, taxonomy, term bool) { + assertDisabledTaxonomyAndTerm := func(b *sitesBuilder, taxonomy, term bool) { b.Assert(b.CheckExists("public/tags/index.html"), qt.Equals, taxonomy) b.Assert(b.CheckExists("public/tags/tag1/index.html"), qt.Equals, term) } @@ -88,7 +88,7 @@ taxonomy = ["JSON"] `disableKinds = ["taxonomy", "taxonomyTerm"]`, func(err error, out string, b *sitesBuilder) { b.Assert(err, qt.IsNil) - asertDisabledTaxonomyAndTerm(b, false, false) + assertDisabledTaxonomyAndTerm(b, false, false) }, }, { @@ -96,7 +96,7 @@ taxonomy = ["JSON"] `disableKinds = ["taxonomyTerm"]`, func(err error, out string, b *sitesBuilder) { b.Assert(err, qt.IsNil) - asertDisabledTaxonomyAndTerm(b, false, true) + assertDisabledTaxonomyAndTerm(b, false, true) }, }, { @@ -113,7 +113,7 @@ taxonomy = ["JSON"] ignoreErrors = ["error-disable-taxonomy"]`, func(err error, out string, b *sitesBuilder) { b.Assert(err, qt.IsNil) - asertDisabledTaxonomyAndTerm(b, false, true) + assertDisabledTaxonomyAndTerm(b, false, true) }, }, } { diff --git a/hugolib/content_map.go b/hugolib/content_map.go index ca2aa3672..3f5ed65c3 100644 --- a/hugolib/content_map.go +++ b/hugolib/content_map.go @@ -58,8 +58,8 @@ const ( cmLeafSeparator = "__hl_" ) -// Used to mark ambigous keys in reverse index lookups. -var ambigousContentNode = &contentNode{} +// Used to mark ambiguous keys in reverse index lookups. +var ambiguousContentNode = &contentNode{} func newContentMap(cfg contentMapConfig) *contentMap { m := &contentMap{ @@ -86,8 +86,8 @@ func newContentMap(cfg contentMapConfig) *contentMap { addToReverseMap := func(k string, n *contentNode, m map[interface{}]*contentNode) { k = strings.ToLower(k) existing, found := m[k] - if found && existing != ambigousContentNode { - m[k] = ambigousContentNode + if found && existing != ambiguousContentNode { + m[k] = ambiguousContentNode } else if !found { m[k] = n } diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go index 296363359..74dd0e029 100644 --- a/hugolib/content_map_page.go +++ b/hugolib/content_map_page.go @@ -232,7 +232,7 @@ func (m *pageMap) newResource(fim hugofs.FileMetaInfo, owner *pageState) (resour outputFormats := owner.m.outputFormats() seen := make(map[string]bool) var targetBasePaths []string - // Make sure bundled resources are published to all of the ouptput formats' + // Make sure bundled resources are published to all of the output formats' // sub paths. for _, f := range outputFormats { p := f.Path diff --git a/hugolib/embedded_shortcodes_test.go b/hugolib/embedded_shortcodes_test.go index 3ea1d8ab0..90f2685af 100644 --- a/hugolib/embedded_shortcodes_test.go +++ b/hugolib/embedded_shortcodes_test.go @@ -185,7 +185,7 @@ func TestShortcodeYoutube(t *testing.T) { `{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`, "(?s)\n
.*?.*?
", }, - // set custom title for accessability) + // set custom title for accessibility) { `{{< youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" >}}`, "(?s)\n
.*?.*?
", diff --git a/hugolib/hugo_modules_test.go b/hugolib/hugo_modules_test.go index f63da5a07..4946d0f59 100644 --- a/hugolib/hugo_modules_test.go +++ b/hugolib/hugo_modules_test.go @@ -151,7 +151,7 @@ JS imported in module: | "devDependencies": { "postcss-cli": "7.8.0", "tailwindcss": "1.8.0" - + } }`) @@ -375,7 +375,7 @@ module github.com/gohugoio/tests/testHugoModules } func createChildModMatchers(m *mods.Md, ignoreVendor, vendored bool) []string { - // Child depdendencies are one behind. + // Child dependencies are one behind. expectMinorVersion := 3 if !ignoreVendor && vendored { @@ -1078,7 +1078,7 @@ workingDir=%q [[module.mounts]] source = %q target = "content" - + `, workDir, absContentDir) defer clean1() diff --git a/hugolib/page.go b/hugolib/page.go index 47aeb6e9a..6c177b687 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -584,7 +584,7 @@ type renderStringOpts struct { Markup string } -var defualtRenderStringOpts = renderStringOpts{ +var defaultRenderStringOpts = renderStringOpts{ Display: "inline", Markup: "", // Will inherit the page's value when not set. } @@ -595,7 +595,7 @@ func (p *pageState) RenderString(args ...interface{}) (template.HTML, error) { } var s string - opts := defualtRenderStringOpts + opts := defaultRenderStringOpts sidx := 1 if len(args) == 1 { @@ -978,7 +978,7 @@ func (p *pageState) shiftToOutputFormat(isRenderingSite bool, idx int) error { // // For pages that have a source file, it is returns the path to this file as an // absolute path rooted in this site's content dir. -// For pages that do not (sections witout content page etc.), it returns the +// For pages that do not (sections without content page etc.), it returns the // virtual path, consistent with where you would add a source file. func (p *pageState) sourceRef() string { if !p.File().IsZero() { diff --git a/hugolib/page__common.go b/hugolib/page__common.go index d1c7ba866..e718721f7 100644 --- a/hugolib/page__common.go +++ b/hugolib/page__common.go @@ -57,7 +57,7 @@ type pageCommon struct { bucket *pagesMapBucket treeRef *contentTreeRef - // Laziliy initialized dependencies. + // Lazily initialized dependencies. init *lazy.Init // All of these represents the common parts of a page.Page diff --git a/hugolib/pagebundler_test.go b/hugolib/pagebundler_test.go index 8f9459564..5589a3e32 100644 --- a/hugolib/pagebundler_test.go +++ b/hugolib/pagebundler_test.go @@ -302,7 +302,7 @@ func TestPageBundlerSiteMultilingual(t *testing.T) { // A bundle in a/b/index.en.md // a/b/index.en.md => OK // a/b/index => OK - // index.en.md => ambigous, but OK. + // index.en.md => ambiguous, but OK. // With bundles, the file name has little meaning, the folder it lives in does. So this should also work: // a/b // and probably also just b (aka "my-bundle") @@ -1250,7 +1250,7 @@ func TestBundleTransformMany(t *testing.T) { title: "Page" weight: %d --- - + `, i)) b.WithSourceFile(fmt.Sprintf("content/bundle%d/data.yaml", i), fmt.Sprintf(`data: v%d`, i)) b.WithSourceFile(fmt.Sprintf("content/bundle%d/data.json", i), fmt.Sprintf(`{ "data": "v%d" }`, i)) diff --git a/hugolib/pagecollections.go b/hugolib/pagecollections.go index c1c9ef88b..2e4287612 100644 --- a/hugolib/pagecollections.go +++ b/hugolib/pagecollections.go @@ -98,7 +98,7 @@ func newPageCollections(m *pageMap) *PageCollections { // This is an adapter func for the old API with Kind as first argument. // This is invoked when you do .Site.GetPage. We drop the Kind and fails -// if there are more than 2 arguments, which would be ambigous. +// if there are more than 2 arguments, which would be ambiguous. func (c *PageCollections) getPageOldVersion(ref ...string) (page.Page, error) { var refs []string for _, r := range ref { @@ -291,7 +291,7 @@ func (c *PageCollections) getContentNode(context page.Page, isReflink bool, ref getByName := func(s string) (*contentNode, error) { n := m.pageReverseIndex.Get(s) if n != nil { - if n == ambigousContentNode { + if n == ambiguousContentNode { return nil, fmt.Errorf("page reference %q is ambiguous", ref) } return n, nil diff --git a/hugolib/pages_capture.go b/hugolib/pages_capture.go index 98e9fda51..c7a42acdc 100644 --- a/hugolib/pages_capture.go +++ b/hugolib/pages_capture.go @@ -278,7 +278,7 @@ func (c *pagesCollector) addToBundle(info hugofs.FileMetaInfo, btyp bundleDirTyp if btyp == bundleBranch { // No special logic for branch bundles. // Every language needs its own _index.md file. - // Also, we only clone bundle headers for lonsesome, bundled, + // Also, we only clone bundle headers for lonesome, bundled, // content files. return c.handleFiles(info) } diff --git a/hugolib/paths/paths.go b/hugolib/paths/paths.go index 8af77b072..bcf01a969 100644 --- a/hugolib/paths/paths.go +++ b/hugolib/paths/paths.go @@ -268,7 +268,7 @@ func (p *Paths) RelPathify(filename string) string { return strings.TrimPrefix(strings.TrimPrefix(filename, p.WorkingDir), FilePathSeparator) } -// AbsPathify creates an absolute path if given a working dir and arelative path. +// 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) { diff --git a/hugolib/site.go b/hugolib/site.go index 4175fecc2..d2a5e68ae 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -956,7 +956,7 @@ func (s *Site) translateFileEvents(events []fsnotify.Event) []fsnotify.Event { eventMap := make(map[string][]fsnotify.Event) // We often get a Remove etc. followed by a Create, a Create followed by a Write. - // Remove the superflous events to mage the update logic simpler. + // Remove the superfluous events to mage the update logic simpler. for _, ev := range events { eventMap[ev.Name] = append(eventMap[ev.Name], ev) } @@ -999,7 +999,7 @@ var ( ) // reBuild partially rebuilds a site given the filesystem events. -// It returns whetever the content source was changed. +// It returns whatever the content source was changed. // TODO(bep) clean up/rewrite this method. func (s *Site) processPartial(config *BuildCfg, init func(config *BuildCfg) error, events []fsnotify.Event) error { events = s.filterFileEvents(events) @@ -1513,7 +1513,7 @@ func (s *Site) assembleMenus() { } } -// get any lanaguagecode to prefix the target file path with. +// get any language code to prefix the target file path with. func (s *Site) getLanguageTargetPathLang(alwaysInSubDir bool) string { if s.h.IsMultihost() { return s.Language().Lang diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index dba4f4856..b26032174 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -316,7 +316,7 @@ categories: ["This is Cool", "And new" ] --- Content. - + `) } @@ -454,7 +454,7 @@ categories: ["funny"] `, "categories/_index.md", "---\ntitle: Categories Page\n---", "categories/data.json", "Category data", - "categories/funny/_index.md", "---\ntitle: Funnny Category\n---", + "categories/funny/_index.md", "---\ntitle: Funny Category\n---", "categories/funny/funnydata.json", "Category funny data", ) @@ -525,7 +525,7 @@ Funny:|/p2/|`) func TestTaxonomiesListPages(t *testing.T) { b := newTestSitesBuilder(t) b.WithTemplates("_default/list.html", ` - + {{ template "print-taxo" "categories.cats" }} {{ template "print-taxo" "categories.funny" }} @@ -560,7 +560,7 @@ categories: ["cats"] b.Build(BuildCfg{}) b.AssertFileContent("public/index.html", ` - + Len categories.cats: 2 categories.cats:|/blog/| categories.cats:|/| diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go index 726930721..78d80bebf 100644 --- a/hugolib/testhelpers_test.go +++ b/hugolib/testhelpers_test.go @@ -928,13 +928,13 @@ func buildSingleSite(t testing.TB, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Sit return buildSingleSiteExpected(t, false, false, depsCfg, buildCfg) } -func buildSingleSiteExpected(t testing.TB, expectSiteInitEror, expectBuildError bool, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site { +func buildSingleSiteExpected(t testing.TB, expectSiteInitError, expectBuildError bool, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site { t.Helper() b := newTestSitesBuilderFromDepsCfg(t, depsCfg).WithNothingAdded() err := b.CreateSitesE() - if expectSiteInitEror { + if expectSiteInitError { b.Assert(err, qt.Not(qt.IsNil)) return nil } else { -- cgit v1.2.3