]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Correct typos in Go comments
authorOleksandr Redko <oleksandr.red+github@gmail.com>
Sat, 18 Feb 2023 20:47:35 +0000 (22:47 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 2 Mar 2023 15:32:32 +0000 (16:32 +0100)
26 files changed:
cache/filecache/filecache.go
commands/commands_test.go
commands/server.go
commands/server_test.go
common/para/para.go
config/security/whitelist.go
helpers/pathspec.go
hugofs/glob/glob.go
hugolib/content_map.go
hugolib/filesystems/basefs.go
hugolib/hugo_sites.go
hugolib/pagecollections.go
hugolib/site.go
langs/language.go
markup/goldmark/autoid.go
markup/internal/attributes/attributes.go
media/mediaType.go
parser/metadecoders/format.go
resources/page/page_kinds.go
resources/page/pages_prev_next.go
resources/page/site.go
resources/resource_transformers/js/options.go
source/fileInfo.go
source/filesystem.go
tpl/internal/go_templates/texttemplate/hugo_template.go
tpl/tplimpl/template.go

index 8723c4bdcd26c83bad878d2ed3ef903227e88cb5..88a466218819eb6ec9d48a98b3139d46f317835c 100644 (file)
@@ -248,7 +248,7 @@ func (c *Cache) GetBytes(id string) (ItemInfo, []byte, error) {
        return info, nil, nil
 }
 
-// Get gets the file with the given id from the cahce, nil if none found.
+// Get gets the file with the given id from the cache, nil if none found.
 func (c *Cache) Get(id string) (ItemInfo, io.ReadCloser, error) {
        id = cleanID(id)
 
index 03b59e19e98f9c2f5713e2755865737f2751e040..35621854f7627c0d3e2159ea846f54d480d6eed7 100644 (file)
@@ -229,7 +229,7 @@ func TestFlags(t *testing.T) {
                                if cmd.getCommand() == nil {
                                        continue
                                }
-                               // We are only intereseted in the flag handling here.
+                               // We are only interested in the flag handling here.
                                cmd.getCommand().RunE = noOpRunE
                        }
                        rootCmd := root.getCommand()
index 4f7d4db8f768ec77a519b1808dbab9e20f5e8fbd..121a649d4dd6d89234bade9046853bfb19f91354 100644 (file)
@@ -505,7 +505,7 @@ func removeErrorPrefixFromLog(content string) string {
 }
 
 var logReplacer = strings.NewReplacer(
-       "can't", "can’t", // Chroma lexer does'nt do well with "can't"
+       "can't", "can’t", // Chroma lexer doesn't do well with "can't"
        "*hugolib.pageState", "page.Page", // Page is the public interface.
        "Rebuild failed:", "",
 )
@@ -547,7 +547,7 @@ func (c *commandeer) serve(s *serverCmd) error {
                roots = []string{""}
        }
 
-       // Cache it here. The HugoSites object may be unavaialble later on due to intermitent configuration errors.
+       // Cache it here. The HugoSites object may be unavailable later on due to intermittent configuration errors.
        // To allow the en user to change the error template while the server is running, we use
        // the freshest template we can provide.
        var (
index 2840cdf20c2c09aec12f1678baba5df33fa54c6a..cf790c3fc917423b2bd11a7ee17dc0798073e27f 100644 (file)
@@ -211,7 +211,7 @@ func TestServerBugs(t *testing.T) {
                        c.Assert(r.err, qt.IsNil)
                        c.Assert(r.homesContent[0], qt.Contains, "PostProcess: /foo.min.css")
                }},
-               // Isue 9901
+               // Issue 9901
                {"Multihost", `
 defaultContentLanguage = 'en'
 [languages]
index 69bfc205b8b720bd4115a3c638f0ee1174edafb9..c323a3073a4f9bee129570c87fe04ce15822fc55 100644 (file)
@@ -27,7 +27,7 @@ type Workers struct {
 
 // Runner wraps the lifecycle methods of a new task set.
 //
-// Run wil block until a worker is available or the context is cancelled,
+// Run will block until a worker is available or the context is cancelled,
 // and then run the given func in a new goroutine.
 // Wait will wait for all the running goroutines to finish.
 type Runner interface {
index 4aff9e9c479d3b80c12b1a90594c2d343d8df0bb..ee1025d3bd8ecca1b28c525d07baba0c88812ce4 100644 (file)
@@ -44,7 +44,7 @@ func (w Whitelist) MarshalJSON() ([]byte, error) {
 
 // NewWhitelist creates a new Whitelist from zero or more patterns.
 // An empty patterns list or a pattern with the value 'none' will create
-// a whitelist that will Accept noone.
+// a whitelist that will Accept none.
 func NewWhitelist(patterns ...string) Whitelist {
        if len(patterns) == 0 {
                return Whitelist{acceptNone: true}
index 49fd9a71cfaefe48705384e34cdffe349a3d6093..28b5f71c32c9a401a686dc83f37af538da9f28c8 100644 (file)
@@ -42,7 +42,7 @@ func NewPathSpec(fs *hugofs.Fs, cfg config.Provider, logger loggers.Logger) (*Pa
        return NewPathSpecWithBaseBaseFsProvided(fs, cfg, logger, nil)
 }
 
-// NewPathSpecWithBaseBaseFsProvided creats a new PathSpec from the given filesystems and language.
+// NewPathSpecWithBaseBaseFsProvided creates a new PathSpec from the given filesystems and language.
 // If an existing BaseFs is provided, parts of that is reused.
 func NewPathSpecWithBaseBaseFsProvided(fs *hugofs.Fs, cfg config.Provider, logger loggers.Logger, baseBaseFs *filesystems.BaseFs) (*PathSpec, error) {
        p, err := paths.New(fs, cfg)
index 841824bcc3ba932fe22f4f07cf5d1c211d2d0c92..ec9b2c7e16346fca03590e087a552ffc23d32262 100644 (file)
@@ -82,7 +82,7 @@ func (gc *globCache) GetGlob(pattern string) (glob.Glob, error) {
 
 type globDecorator struct {
        // On Windows we may get filenames with Windows slashes to match,
-       // which wee need to normalize.
+       // which we need to normalize.
        isWindows bool
 
        g glob.Glob
index 6849998b6f5f30ac2c5e90c379495a62499f5bae..bf77e7f1ba8126deef7f0727c54e42dc2241ec25 100644 (file)
@@ -43,7 +43,7 @@ import (
 //
 // For bundled pages (/mybundle/index.md), we use the folder name.
 //
-// An exmple of a full page key would be "/blog/__hb_page1__hl_"
+// An example of a full page key would be "/blog/__hb_page1__hl_"
 //
 // Bundled resources are stored in the `resources` having their path prefixed
 // with the bundle they belong to, e.g.
@@ -317,7 +317,7 @@ type contentMap struct {
        // There are currently two cases where this is used:
        // 1. Short name lookups in ref/relRef, e.g. using only "mypage.md" without a path.
        // 2. Links resolved from a remounted content directory. These are restricted to the same module.
-       // Both of the above cases can  result in ambigous lookup errors.
+       // Both of the above cases can  result in ambiguous lookup errors.
        pageReverseIndex *contentTreeReverseIndex
 
        // Section nodes.
index 5a98be47ee24b4bdc13d9e26e9ddea6ecf000586..377428325b4d8e8e52e54833c0794f41d30d2bd9 100644 (file)
@@ -297,7 +297,7 @@ func (s SourceFilesystems) StaticFs(lang string) afero.Fs {
 // StatResource looks for a resource in these filesystems in order: static, assets and finally content.
 // If found in any of them, it returns FileInfo and the relevant filesystem.
 // Any non herrors.IsNotExist error will be returned.
-// An herrors.IsNotExist error wil be returned only if all filesystems return such an error.
+// An herrors.IsNotExist error will be returned only if all filesystems return such an error.
 // Note that if we only wanted to find the file, we could create a composite Afero fs,
 // but we also need to know which filesystem root it lives in.
 func (s SourceFilesystems) StatResource(lang, filename string) (fi os.FileInfo, fs afero.Fs, err error) {
index 65cc23971db9ffec4c4df2b5103b87364e4be54c..edb925de5aef4621f18b31b035ce809b7aa712f2 100644 (file)
@@ -723,7 +723,7 @@ type BuildCfg struct {
 // shouldRender is used in the Fast Render Mode to determine if we need to re-render
 // a Page: If it is recently visited (the home pages will always be in this set) or changed.
 // Note that a page does not have to have a content page / file.
-// For regular builds, this will allways return true.
+// For regular builds, this will always return true.
 // TODO(bep) rename/work this.
 func (cfg *BuildCfg) shouldRender(p *pageState) bool {
        if p == nil {
index 811fb602553bc7feec3bbab9015527ef0b37e7bb..0d901d6b22c27b36bcd990cbc4b1efd56b633530 100644 (file)
@@ -209,7 +209,7 @@ func (c *PageCollections) getSectionOrPage(ref string) (*contentNode, string) {
        return m.getPage(s, name), name
 }
 
-// For Ref/Reflink and .Site.GetPage do simple name lookups for the potentially ambigous myarticle.md and /myarticle.md,
+// For Ref/Reflink and .Site.GetPage do simple name lookups for the potentially ambiguous myarticle.md and /myarticle.md,
 // but not when we get ./myarticle*, section/myarticle.
 func shouldDoSimpleLookup(ref string) bool {
        if ref[0] == '.' {
@@ -325,7 +325,7 @@ func (c *PageCollections) getContentNode(context page.Page, isReflink bool, ref
                return nil, nil
        }
 
-       // Ref/relref supports this potentially ambigous lookup.
+       // Ref/relref supports this potentially ambiguous lookup.
        return getByName(path.Base(name))
 }
 
index 45b4643f03580c4d66ae31613ec8bb38b5c0aa98..1b0c48cbcd2411af7220b9d4cfb800ff9758240c 100644 (file)
@@ -428,7 +428,7 @@ func newSite(cfg deps.DepsCfg) (*Site, error) {
 
                delete(disabledKinds, "taxonomyTerm")
        } else if disabledKinds[page.KindTaxonomy] && !disabledKinds[page.KindTerm] {
-               // This is a potentially ambigous situation. It may be correct.
+               // This is a potentially ambiguous situation. It may be correct.
                ignorableLogger.Errorsf(constants.ErrIDAmbigousDisableKindTaxonomy, `You have the value 'taxonomy' in the disabledKinds list. In Hugo 0.73.0 we fixed these to be what most people expect (taxonomy and term).
 But this also means that your site configuration may not do what you expect. If it is correct, you can suppress this message by following the instructions below.`)
        }
@@ -487,7 +487,7 @@ But this also means that your site configuration may not do what you expect. If
                        siteOutputs[page.KindTerm] = v2
                        delete(siteOutputs, "taxonomyTerm")
                } else if hasTaxonomy && !hasTerm {
-                       // This is a potentially ambigous situation. It may be correct.
+                       // This is a potentially ambiguous situation. It may be correct.
                        ignorableLogger.Errorsf(constants.ErrIDAmbigousOutputKindTaxonomy, `You have configured output formats for 'taxonomy' in your site configuration. In Hugo 0.73.0 we fixed these to be what most people expect (taxonomy and term).
 But this also means that your site configuration may not do what you expect. If it is correct, you can suppress this message by following the instructions below.`)
                }
index 42aefda5e0719683de77d880c1e3e83d3de2e723..9b96ec0a083f4d38f6aacb77341a7d3d8d27e7a9 100644 (file)
@@ -92,7 +92,7 @@ type Language struct {
        collator      *Collator
        location      *time.Location
 
-       // Error during initialization. Will fail the buld.
+       // Error during initialization. Will fail the build.
        initErr error
 }
 
@@ -223,7 +223,7 @@ func (l Languages) AsOrdinalSet() map[string]int {
 }
 
 // IsMultihost returns whether there are more than one language and at least one of
-// the languages has baseURL specificed on the language level.
+// the languages has baseURL specified on the language level.
 func (l Languages) IsMultihost() bool {
        if len(l) <= 1 {
                return false
@@ -326,7 +326,7 @@ type Collator struct {
 // CompareStrings compares a and b.
 // It returns -1 if a < b, 1 if a > b and 0 if a == b.
 // Note that the Collator is not thread safe, so you may want
-// to aquire a lock on it before calling this method.
+// to acquire a lock on it before calling this method.
 func (c *Collator) CompareStrings(a, b string) int {
        return c.c.CompareString(a, b)
 }
index 04313269c7f8b6e8b2761c68a06cb7275b211f4e..e1fdfacb4497c338ba05af4cfa55939048b95a14 100644 (file)
@@ -112,7 +112,7 @@ func (ids *idFactory) Generate(value []byte, kind ast.NodeKind) []byte {
                }
 
                if _, found := ids.vals[util.BytesToReadOnlyString(buf.Bytes())]; found {
-                       // Append a hypen and a number, starting with 1.
+                       // Append a hyphen and a number, starting with 1.
                        buf.WriteRune('-')
                        pos := buf.Len()
                        for i := 1; ; i++ {
index a67b51acbc80ad843ed0047887f1d7cdd89413ca..09bba5c41f1ef9607a6e1e783d6da4dc3df360d9 100644 (file)
@@ -200,8 +200,8 @@ func RenderASTAttributes(w hugio.FlexiWriter, attributes ...ast.Attribute) {
 }
 
 // Render writes the attributes to the given as attributes to an HTML element.
-// This is used for the default codeblock renderering.
-// This performs HTML esacaping of string attributes.
+// This is used for the default codeblock rendering.
+// This performs HTML escaping of string attributes.
 func RenderAttributes(w hugio.FlexiWriter, skipClass bool, attributes ...Attribute) {
        for _, attr := range attributes {
                a := strings.ToLower(string(attr.Name))
index 5732b9030c9df7acb89295caa463e5d28c5c6bbb..084f1fb5bf41d9acebd62ea460382f83b4720b63 100644 (file)
@@ -11,7 +11,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Package media containes Media Type (MIME type) related types and functions.
+// Package media contains Media Type (MIME type) related types and functions.
 package media
 
 import (
index d34a261bf10ee0468ab58f3f52008284cec11e32..17e13f46794b89bf0a7fb13c33fd1856a7f7dd8c 100644 (file)
@@ -23,7 +23,7 @@ import (
 type Format string
 
 const (
-       // These are the supported metdata  formats in Hugo. Most of these are also
+       // These are the supported metadata  formats in Hugo. Most of these are also
        // supported as /data formats.
        ORG  Format = "org"
        JSON Format = "json"
index 719375f669b091dc6d6d4bdabcaa9ca87d8955a3..47985984111d5abebcfed9c654d8a41f49a98080 100644 (file)
@@ -23,7 +23,7 @@ const (
        KindHome    = "home"
        KindSection = "section"
 
-       // Note tha before Hugo 0.73 these were confusingly named
+       // Note that before Hugo 0.73 these were confusingly named
        // taxonomy (now: term)
        // taxonomyTerm (now: taxonomy)
        KindTaxonomy = "taxonomy"
index 753a3e41513394785ccd30a76356f1b4599027d9..b8084bad99d1754eca0f2e31ff5733ccb6ae5b29 100644 (file)
@@ -22,7 +22,7 @@ func (p Pages) Next(cur Page) Page {
        return p[x-1]
 }
 
-// Prev returns the previous page reletive to the given
+// Prev returns the previous page relative to the given
 func (p Pages) Prev(cur Page) Page {
        x := searchPage(cur, p)
 
index 90fbd55518380c469016a1c4301abad03d7eed41..47bd770efaff470a6734332d43803888001b5482 100644 (file)
@@ -62,7 +62,7 @@ type Site interface {
        // Returns the BaseURL for this Site.
        BaseURL() template.URL
 
-       // Retuns a taxonomy map.
+       // Returns a taxonomy map.
        Taxonomies() TaxonomyList
 
        // Returns the last modification date of the content.
index ff5cca458ed435def7c975b63d531aae0858e742..8b40648e7b45d5beccc376ed6638ff8ce4fb656c 100644 (file)
@@ -164,7 +164,7 @@ func resolveComponentInAssets(fs afero.Fs, impPath string) *hugofs.FileMeta {
        var m *hugofs.FileMeta
 
        // We need to check if this is a regular file imported without an extension.
-       // There may be ambigous situations where both foo.js and foo/index.js exists.
+       // There may be ambiguous situations where both foo.js and foo/index.js exists.
        // This import order is in line with both how Node and ESBuild's native
        // import resolver works.
 
index 9ce601b5bd2863e2827cec9b9b743563f32e17cc..618498add3afe7b7ca94664a27e41e625a6e5dfc 100644 (file)
@@ -301,7 +301,7 @@ func NewGitInfo(info gitmap.GitInfo) GitInfo {
        return GitInfo(info)
 }
 
-// GitInfo provides information about a version controled source file.
+// GitInfo provides information about a version controlled source file.
 type GitInfo struct {
        // Commit hash.
        Hash string `json:"hash"`
index 79d027c5c489d871fb22c3fbd5b16f92f5290c6f..283863dbf77765746a3d19f71a8f1b3f57e7e9ef 100644 (file)
@@ -34,7 +34,7 @@ type Filesystem struct {
        SourceSpec
 }
 
-// NewFilesystem returns a new filesytem for a given source spec.
+// NewFilesystem returns a new filesystem for a given source spec.
 func (sp SourceSpec) NewFilesystem(base string) *Filesystem {
        return &Filesystem{SourceSpec: sp, Base: base}
 }
index 23bc18e42a03881aabb0943a070c35cce854a17e..acfa2f16630714a6c58ed6fec67a78edfb237142 100644 (file)
@@ -72,7 +72,7 @@ const (
        HasLockContextKey = hasLockContextKeyType("hasLock")
 )
 
-// Note: The context is currently not fully implemeted in Hugo. This is a work in progress.
+// Note: The context is currently not fully implemented in Hugo. This is a work in progress.
 func (t *executer) ExecuteWithContext(ctx context.Context, p Preparer, wr io.Writer, data any) error {
        if ctx == nil {
                panic("nil context")
@@ -123,7 +123,7 @@ func (t *Template) executeWithState(state *state, value reflect.Value) (err erro
 // can execute in parallel.
 type state struct {
        tmpl   *Template
-       ctx    context.Context // Added for Hugo. The orignal data context.
+       ctx    context.Context // Added for Hugo. The original data context.
        prep   Preparer        // Added for Hugo.
        helper ExecHelper      // Added for Hugo.
        wr     io.Writer
index 70541e0768220cb9aa53096191e67f21b514b91e..53e6b4902f9e7941742344f449cdbce6fa38b94c 100644 (file)
@@ -774,8 +774,8 @@ func (t *templateHandler) loadEmbedded() error {
                name := strings.TrimPrefix(filepath.ToSlash(path), "embedded/templates/")
                templateName := name
 
-               // For the render hooks and the server templates it does not make sense to preseve the
-               // double _indternal double book-keeping,
+               // For the render hooks and the server templates it does not make sense to preserve the
+               // double _internal double book-keeping,
                // just add it if its now provided by the user.
                if !strings.Contains(path, "_default/_markup") && !strings.HasPrefix(name, "_server/") {
                        templateName = internalPathPrefix + name