]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
all: Fix typos in function names and comments
authorOleksandr Redko <Oleksandr_Redko@epam.com>
Mon, 22 May 2023 17:11:12 +0000 (20:11 +0300)
committerBjรธrn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 19 Jun 2023 07:26:29 +0000 (09:26 +0200)
27 files changed:
cache/docs.go
cache/filecache/filecache_config.go
commands/commandeer.go
commands/convert.go
common/herrors/error_locator.go
common/herrors/file_error.go
common/hexec/exec.go
common/paths/path.go
config/allconfig/allconfig.go
config/commonConfig.go
helpers/emoji.go
helpers/emoji_test.go
htesting/test_helpers.go
hugofs/filter_fs.go
hugofs/fs.go
hugofs/glob/filename_filter_test.go
hugolib/config_test.go
hugolib/configdir_test.go
hugolib/datafiles_test.go
hugolib/embedded_shortcodes_test.go
hugolib/hugo_sites_build.go
hugolib/pagecollections_test.go
hugolib/site.go
langs/language.go
livereload/livereload.go
resources/jsconfig/jsconfig.go
resources/resource_transformers/js/options.go

index babecec22bcf914fe0e8233f0fd6b86d6e349774..b9c49840fadf5f1d57522a0e23977ae18f9b5a6f 100644 (file)
@@ -1,2 +1,2 @@
-// Package cache contains the differenct cache implementations.
+// Package cache contains the different cache implementations.
 package cache
index e8019578ac75ebdd38e5d605477f336fdd8428de..33d2750eaa5b5a8c34ae5d56b8808bd05fac9e90 100644 (file)
@@ -81,7 +81,7 @@ type FileCacheConfig struct {
        // Max age of cache entries in this cache. Any items older than this will
        // be removed and not returned from the cache.
        // A negative value means forever, 0 means cache is disabled.
-       // Hugo is leninent with what types it accepts here, but we recommend using
+       // Hugo is lenient with what types it accepts here, but we recommend using
        // a duration string, a sequence of  decimal numbers, each with optional fraction and a unit suffix,
        // such as "300ms", "1.5h" or "2h45m".
        // Valid time units are "ns", "us" (or "ยตs"), "ms", "s", "m", "h".
index 7322a210a6929adb066490e033a6043a670b28c7..c2b26b5ecaa0d056904f783d50d291c312edba87 100644 (file)
@@ -238,11 +238,11 @@ func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commo
                renderStaticToDisk := cfg.GetBool("renderStaticToDisk")
 
                sourceFs := hugofs.Os
-               var desinationFs afero.Fs
+               var destinationFs afero.Fs
                if cfg.GetBool("renderToDisk") {
-                       desinationFs = hugofs.Os
+                       destinationFs = hugofs.Os
                } else {
-                       desinationFs = afero.NewMemMapFs()
+                       destinationFs = afero.NewMemMapFs()
                        if renderStaticToDisk {
                                // Hybrid, render dynamic content to Root.
                                cfg.Set("publishDirDynamic", "/")
@@ -253,7 +253,7 @@ func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commo
                        }
                }
 
-               fs := hugofs.NewFromSourceAndDestination(sourceFs, desinationFs, cfg)
+               fs := hugofs.NewFromSourceAndDestination(sourceFs, destinationFs, cfg)
 
                if renderStaticToDisk {
                        dynamicFs := fs.PublishDir
index fb01087d581842b918fb8ea2e431664dbe592d3b..f444e001c81fdd1c4ed63bb717d9ee118a1fd4b7 100644 (file)
@@ -84,7 +84,7 @@ type convertCommand struct {
        r *rootCommand
        h *hugolib.HugoSites
 
-       // Commmands.
+       // Commands.
        commands []simplecobra.Commander
 }
 
index 7624bab9876b5ab8e415de05535c7589c8b7fe43..b880fe045429c88b00e7ac5d1f611b62c4de5d23 100644 (file)
@@ -33,7 +33,7 @@ type LineMatcher struct {
 }
 
 // LineMatcherFn is used to match a line with an error.
-// It returns the column number or 0 if the line was found, but column could not be determinde. Returns -1 if no line match.
+// It returns the column number or 0 if the line was found, but column could not be determined. Returns -1 if no line match.
 type LineMatcherFn func(m LineMatcher) int
 
 // SimpleLineMatcher simply matches by line number.
index ae86a700cb5201ee0e5c6f81462ef8f287c74f84..f8bcecd34ec5f58560089b27f2c4a3bb4677abfc 100644 (file)
@@ -297,7 +297,7 @@ func extractFileTypePos(err error) (string, text.Position) {
        }
 
        // The error type from the minifier contains line number and column number.
-       if line, col := exctractLineNumberAndColumnNumber(err); line >= 0 {
+       if line, col := extractLineNumberAndColumnNumber(err); line >= 0 {
                pos.LineNumber = line
                pos.ColumnNumber = col
                return fileType, pos
@@ -369,7 +369,7 @@ func extractOffsetAndType(e error) (int, string) {
        }
 }
 
-func exctractLineNumberAndColumnNumber(e error) (int, int) {
+func extractLineNumberAndColumnNumber(e error) (int, int) {
        switch v := e.(type) {
        case *parse.Error:
                return v.Line, v.Column
index 7a9fdd938ae2acfaf9a9573b1af479632350bed5..95e5162fc3ecbb8f8f5fe42e09f1a0d321e398c0 100644 (file)
@@ -118,7 +118,7 @@ func SafeCommand(name string, arg ...string) (*exec.Cmd, error) {
        return exec.Command(bin, arg...), nil
 }
 
-// Exec encorces a security policy for commands run via os/exec.
+// Exec enforces a security policy for commands run via os/exec.
 type Exec struct {
        sc security.Config
 
index f1992f196cd638739a14f666e1ea21ac4fa7e200..5d211c5e0bc9ba5072a1a635ee019cc5eb4ddbe7 100644 (file)
@@ -209,7 +209,7 @@ func extractFilename(in, ext, base, pathSeparator string) (name string) {
                // return the filename minus the extension (and the ".")
                name = base[:strings.LastIndex(base, ".")]
        } else {
-               // no extension case so just return base, which willi
+               // no extension case so just return base, which will
                // be the filename
                name = base
        }
index ec7895eea1ef519fc52bae8d109e594c22e15e11..9079e2ce33408d533f4a2980345e3ce0d1ef39ed 100644 (file)
@@ -424,10 +424,10 @@ type RootConfig struct {
        // Copyright information.
        Copyright string
 
-       // The language to apply to content without any Clolanguage indicator.
+       // The language to apply to content without any language indicator.
        DefaultContentLanguage string
 
-       // By defefault, we put the default content language in the root and the others below their language ID, e.g. /no/.
+       // By default, we put the default content language in the root and the others below their language ID, e.g. /no/.
        // Set this to true to put all languages below their language ID.
        DefaultContentLanguageInSubdir bool
 
index ac1dd39fab0e5cd01adeead8b1b97ab8ee764a0d..09f81c1ba051cad1c1792fdd9048fe61f8f7b982 100644 (file)
@@ -97,7 +97,7 @@ var defaultBuild = BuildConfig{
                        Source: `(postcss|tailwind)\.config\.js`,
                        Target: cssTargetCachebusterRe,
                },
-               // This is deliberatly coarse grained; it will cache bust resources with "json" in the cache key when js files changes, which is good.
+               // This is deliberately coarse grained; it will cache bust resources with "json" in the cache key when js files changes, which is good.
                {
                        Source: `assets/.*\.(.*)$`,
                        Target: `$1`,
@@ -113,7 +113,7 @@ type BuildConfig struct {
        // related aggregated data (e.g. CSS class names).
        WriteStats bool
 
-       // Can be used to toggle off writing of the intellinsense /assets/jsconfig.js
+       // Can be used to toggle off writing of the IntelliSense /assets/jsconfig.js
        // file.
        NoJSConfigInAssets bool
 
index eb47ff448649acb7b6f6feffab01b3a9db97a533..a1617c48d1f51243ac6be26fcb82135519cbc661 100644 (file)
@@ -30,7 +30,7 @@ var (
        emojiMaxSize   int
 )
 
-// Emoji returns the emojy given a key, e.g. ":smile:", nil if not found.
+// Emoji returns the emoji given a key, e.g. ":smile:", nil if not found.
 func Emoji(key string) []byte {
        emojiInit.Do(initEmoji)
        return emojis[key]
index 6485bb5fee5d1aaf13764d32285a0033855bed49..b45444d45036d9e0640a32df34b2145b74195585 100644 (file)
@@ -41,7 +41,7 @@ func TestEmojiCustom(t *testing.T) {
                {" :beer: :", []byte(" ๐Ÿบ :")},
                {":beer: and :smile: and another :beer:!", []byte("๐Ÿบ and ๐Ÿ˜„ and another ๐Ÿบ!")},
                {" :beer: : ", []byte(" ๐Ÿบ : ")},
-               {"No smilies for you!", []byte("No smilies for you!")},
+               {"No smiles for you!", []byte("No smiles for you!")},
                {" The motto: no smiles! ", []byte(" The motto: no smiles! ")},
                {":hugo_is_the_best_static_gen:", []byte(":hugo_is_the_best_static_gen:")},
                {"์€ํ–‰ :smile: ์€ํ–‰", []byte("์€ํ–‰ ๐Ÿ˜„ ์€ํ–‰")},
index fa3f29c44cb516665f091d40fb8afced9fb448bb..21b4b831e8fc832efd41968c28260b769f4141e3 100644 (file)
@@ -38,7 +38,7 @@ func init() {
 }
 
 // CreateTempDir creates a temp dir in the given filesystem and
-// returns the dirnam and a func that removes it when done.
+// returns the dirname and a func that removes it when done.
 func CreateTempDir(fs afero.Fs, prefix string) (string, func(), error) {
        tempDir, err := afero.TempDir(fs, "", prefix)
        if err != nil {
index 351b4d0f745d2d24c2dc470338096106ba007748..1b020738a20792bba122cbb9042dea75fbe6dbd9 100644 (file)
@@ -92,7 +92,7 @@ func NewLanguageFs(langs map[string]int, fs afero.Fs) (afero.Fs, error) {
                        fim := fi.(FileMetaInfo)
                        langs := translations[fim.Meta().TranslationBaseNameWithExt]
                        if len(langs) > 0 {
-                               fim.Meta().Translations = sortAndremoveStringDuplicates(langs)
+                               fim.Meta().Translations = sortAndRemoveStringDuplicates(langs)
                        }
                }
        }
@@ -328,7 +328,7 @@ func printFs(fs afero.Fs, path string, w io.Writer) {
        })
 }
 
-func sortAndremoveStringDuplicates(s []string) []string {
+func sortAndRemoveStringDuplicates(s []string) []string {
        ss := sort.StringSlice(s)
        ss.Sort()
        i := 0
index ce92a626dea9f2d32b449325543b9460580c0c5f..9462afa249abe9a6a6d4048e099cd180f62ba58d 100644 (file)
@@ -175,7 +175,7 @@ func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error)
 }
 
 // IsOsFs returns whether fs is an OsFs or if it fs wraps an OsFs.
-// TODO(bep) make this nore robust.
+// TODO(bep) make this more robust.
 func IsOsFs(fs afero.Fs) bool {
        var isOsFs bool
        WalkFilesystems(fs, func(fs afero.Fs) bool {
index b74982ef3b1cd9e97949037d0515ac8fb955cfcd..8437af858edc4f45d238388ceb4b35f1b6c91abc 100644 (file)
@@ -59,11 +59,11 @@ func TestFilenameFilter(t *testing.T) {
        c.Assert(includeOnlyFilter.Match("ab.jpg", false), qt.Equals, true)
        c.Assert(includeOnlyFilter.Match("ab.gif", false), qt.Equals, false)
 
-       exlcudeOnlyFilter, err := NewFilenameFilter(nil, []string{"**.json", "**.jpg"})
+       excludeOnlyFilter, err := NewFilenameFilter(nil, []string{"**.json", "**.jpg"})
        c.Assert(err, qt.IsNil)
-       c.Assert(exlcudeOnlyFilter.Match("ab.json", false), qt.Equals, false)
-       c.Assert(exlcudeOnlyFilter.Match("ab.jpg", false), qt.Equals, false)
-       c.Assert(exlcudeOnlyFilter.Match("ab.gif", false), qt.Equals, true)
+       c.Assert(excludeOnlyFilter.Match("ab.json", false), qt.Equals, false)
+       c.Assert(excludeOnlyFilter.Match("ab.jpg", false), qt.Equals, false)
+       c.Assert(excludeOnlyFilter.Match("ab.gif", false), qt.Equals, true)
 
        var nilFilter *FilenameFilter
        c.Assert(nilFilter.Match("ab.gif", false), qt.Equals, true)
index 02d25fa9be996ec4956cc2f5b862fce0fe318217..56a03c6dfbafe21901488d1fd9c450b7a38cf87b 100644 (file)
@@ -35,7 +35,7 @@ func TestLoadConfigLanguageParamsOverrideIssue10620(t *testing.T) {
        files := `
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 title = "Base Title"
 staticDir = "mystatic"
 [params]
@@ -79,7 +79,7 @@ func TestLoadConfig(t *testing.T) {
                files := `
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 title = "Base Title"
 staticDir = "mystatic"
 [params]
@@ -131,7 +131,7 @@ myparam = "svParamValue"
                files := `
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 title = "Base Title"
 defaultContentLanguage = "sv"
 disableLanguages = ["sv"]
@@ -178,7 +178,7 @@ running = true
                files := `
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 title = "Base Title"
 [params]
 p1 = "p1base"
index 3ab84c1bd8e98c9e455bc935fd2328b9ce431c31..559de6b22c9f76be3e43e0e32ffa14881a6bd490 100644 (file)
@@ -30,7 +30,7 @@ b = "bc1"
 
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 ignoreErrors = ["error-missing-instagram-accesstoken"]
 [params]
 a = "a1"
index 4fb3d5bdb9df397a16ecc29adf0c054d8981e9e6..73586c31c69ea0e416eb7afa01d8dbd401b6539a 100644 (file)
@@ -25,7 +25,7 @@ func TestData(t *testing.T) {
                files := `
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 theme = "mytheme"
 -- data/a.toml --
 v1 = "a_v1"
index 8ff1435b6378de2a7585b2b96e39561d9c9750cd..6436f29a10ee3883be1932cfb768b12c077a775c 100644 (file)
@@ -30,7 +30,7 @@ func TestEmbeddedShortcodes(t *testing.T) {
                files := `
 -- hugo.toml --
 baseURL = "https://example.com"
-disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
+disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
 ignoreErrors = ["error-missing-instagram-accesstoken"]
 [params]
 foo = "bar"
index d90d9ce7b08e38e601bbf7b5d6cf2546da608127..c552b9de88f49b3454a5540981de000b46e59b17 100644 (file)
@@ -326,7 +326,7 @@ func (h *HugoSites) postProcess(l logg.LevelLogger) error {
        // This will only be set when js.Build have been triggered with
        // imports that resolves to the project or a module.
        // Write a jsconfig.json file to the project's /asset directory
-       // to help JS intellisense in VS Code etc.
+       // to help JS IntelliSense in VS Code etc.
        if !h.ResourceSpec.BuildConfig().NoJSConfigInAssets && h.BaseFs.Assets.Dirs != nil {
                fi, err := h.BaseFs.Assets.Fs.Stat("")
                if err != nil {
index abdfb9619a5e9d74368cb5f7e913bc1b06e7e314..66f157781951d4f6e4437203e0fa48db888dd277 100644 (file)
@@ -235,7 +235,7 @@ func TestGetPage(t *testing.T) {
                {"Root relative, no slash, root page", page.KindPage, nil, []string{"about.md", "ABOUT.md"}, "about page"},
                {"Root relative, no slash, section", page.KindSection, nil, []string{"sect3"}, "section 3"},
                {"Root relative, no slash, section page", page.KindPage, nil, []string{"sect3/page1.md"}, "Title3_1"},
-               {"Root relative, no slash, sub setion", page.KindSection, nil, []string{"sect3/sect7"}, "another sect7"},
+               {"Root relative, no slash, sub section", page.KindSection, nil, []string{"sect3/sect7"}, "another sect7"},
                {"Root relative, no slash, nested page", page.KindPage, nil, []string{"sect3/subsect/deep.md"}, "deep page"},
                {"Root relative, no slash, OS slashes", page.KindPage, nil, []string{filepath.FromSlash("sect5/page3.md")}, "Title5_3"},
 
@@ -247,7 +247,7 @@ func TestGetPage(t *testing.T) {
                // content root relative paths without a leading slash, the lookup
                // returns /sect7. This undermines ambiguity detection, but we have no choice.
                //{"Ambiguous", nil, []string{"sect7"}, ""},
-               {"Section, ambigous", page.KindSection, nil, []string{"sect7"}, "Sect7s"},
+               {"Section, ambiguous", page.KindSection, nil, []string{"sect7"}, "Sect7s"},
 
                {"Absolute, home", page.KindHome, nil, []string{"/", ""}, "home page"},
                {"Absolute, page", page.KindPage, nil, []string{"/about.md", "/about"}, "about page"},
index fca8bca7518e09f8dd001c0610e1fe62f83b570e..7a352892990bd9840334a59b6bde6284db43ba80 100644 (file)
@@ -885,7 +885,7 @@ func (s *Site) getLanguageTargetPathLang(alwaysInSubDir bool) string {
        return s.getLanguagePermalinkLang(alwaysInSubDir)
 }
 
-// get any lanaguagecode to prefix the relative permalink with.
+// get any language code to prefix the relative permalink with.
 func (s *Site) getLanguagePermalinkLang(alwaysInSubDir bool) string {
        if !s.h.isMultiLingual() || s.h.Conf.IsMultihost() {
                return ""
index f8d4f64b5a67ee1e9308120e2bc232123202f122..2cd60867513ac229979ea00e0d9196905f7840d9 100644 (file)
@@ -92,7 +92,7 @@ func NewLanguage(lang, defaultContentLanguage, timeZone string, languageConfig L
        return l, l.loadLocation(timeZone)
 }
 
-// This is injected from hugolib to avoid cirular dependencies.
+// This is injected from hugolib to avoid circular dependencies.
 var DeprecationFunc = func(item, alternative string, err bool) {}
 
 const paramsDeprecationWarning = `.Language.Params is deprecated and will be removed in a future release. Use site.Params instead.
index 9223d1497a5338043dad98485c506e853c6dc443..59d4c128684a12e55a96e3e5aeb4df76d46b57be 100644 (file)
@@ -143,7 +143,7 @@ func refreshPathForPort(s string, port int) {
        wsHub.broadcast <- []byte(msg)
 }
 
-// ServeJS serves the liverreload.js who's reference is injected into the page.
+// ServeJS serves the livereload.js who's reference is injected into the page.
 func ServeJS(w http.ResponseWriter, r *http.Request) {
        w.Header().Set("Content-Type", media.Builtin.JavascriptType.Type)
        w.Write(liveReloadJS())
index 1fd6d6103f041f42231b418617594acafd564e90..b6e867995780131972e98cdfd593120bae7f8916 100644 (file)
@@ -20,7 +20,7 @@ import (
 )
 
 // Builder builds a jsconfig.json file that, currently, is used only to assist
-// intellinsense in editors.
+// IntelliSense in editors.
 type Builder struct {
        sourceRootsMu sync.RWMutex
        sourceRoots   map[string]bool
index 1f57709cd9510e1049371e21e96afca944e94c68..e9ffbabe478b1eed2ac92b221403f5de0590b500 100644 (file)
@@ -239,7 +239,7 @@ func createBuildPlugins(c *Client, opts Options) ([]api.Plugin, error) {
 
                if m != nil {
                        // Store the source root so we can create a jsconfig.json
-                       // to help intellisense when the build is done.
+                       // to help IntelliSense when the build is done.
                        // This should be a small number of elements, and when
                        // in server mode, we may get stale entries on renames etc.,
                        // but that shouldn't matter too much.