Skip to content

Commit

Permalink
all: Fix minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis authored Dec 16, 2020
1 parent 21fa1e8 commit 04b8985
Show file tree
Hide file tree
Showing 67 changed files with 124 additions and 124 deletions.
2 changes: 1 addition & 1 deletion benchSite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# allow user to override go executable by running as GOEXE=xxx make ...
GOEXE="${GOEXE-go}"

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

Expand Down
2 changes: 1 addition & 1 deletion cache/filecache/filecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (c *Cache) GetOrCreateBytes(id string, create func() ([]byte, error)) (Item
return info, b, nil
}

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

Expand Down
2 changes: 1 addition & 1 deletion cache/namedmemcache/named_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (c *Cache) Clear() {
// GetOrCreate tries to get the value with the given cache key, if not found
// create will be called and cached.
// This method is thread safe. It also guarantees that the create func for a given
// key is invoced only once for this cache.
// key is invoked only once for this cache.
func (c *Cache) GetOrCreate(key string, create func() (interface{}, error)) (interface{}, error) {
c.mu.RLock()
entry, found := c.cache[key]
Expand Down
2 changes: 1 addition & 1 deletion codegen/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (m Methods) Imports() []string {
}

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

Expand Down
2 changes: 1 addition & 1 deletion common/hugio/readers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ReadSeekCloser interface {
}

// ReadSeekerNoOpCloser implements ReadSeekCloser by doing nothing in Close.
// TODO(bep) rename this and simila to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.
// TODO(bep) rename this and similar to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.
type ReadSeekerNoOpCloser struct {
ReadSeeker
}
Expand Down
2 changes: 1 addition & 1 deletion config/commonConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var DefaultBuild = Build{
WriteStats: false,
}

// Build holds some build related condfiguration.
// Build holds some build related configuration.
type Build struct {
UseResourceCacheWhen string // never, fallback, always. Default is fallback

Expand Down
10 changes: 5 additions & 5 deletions helpers/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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, ".")
Expand Down
2 changes: 1 addition & 1 deletion helpers/pathspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions helpers/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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 += "/"
}
Expand Down
2 changes: 1 addition & 1 deletion hugofs/filter_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (f *filterDir) Readdirnames(count int) ([]string, error) {
}

// Try to extract the language from the given filename.
// Any valid language identificator in the name will win over the
// Any valid language identifier in the name will win over the
// language set on the file system, e.g. "mypost.en.md".
func langInfoFrom(languages map[string]int, name string) (string, string, string) {
var lang string
Expand Down
2 changes: 1 addition & 1 deletion hugofs/nosymlink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestNoSymlinkFs(t *testing.T) {
// Check readdir
f, err = fs.Open(workDir)
c.Assert(err, qt.IsNil)
// There is at least one unsported symlink inside workDir
// There is at least one unsupported symlink inside workDir
_, err = f.Readdir(-1)
c.Assert(err, qt.IsNil)
f.Close()
Expand Down
2 changes: 1 addition & 1 deletion hugofs/rootmapping_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func TestRootMappingFsMount(t *testing.T) {
c.Assert(err, qt.IsNil)
c.Assert(string(b), qt.Equals, "some no content")

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

Expand Down
8 changes: 4 additions & 4 deletions hugolib/breaking_changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -88,15 +88,15 @@ 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)
},
},
{
"Disable only taxonomyTerm",
`disableKinds = ["taxonomyTerm"]`,
func(err error, out string, b *sitesBuilder) {
b.Assert(err, qt.IsNil)
asertDisabledTaxonomyAndTerm(b, false, true)
assertDisabledTaxonomyAndTerm(b, false, true)
},
},
{
Expand All @@ -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)
},
},
} {
Expand Down
8 changes: 4 additions & 4 deletions hugolib/content_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion hugolib/content_map_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hugolib/embedded_shortcodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestShortcodeYoutube(t *testing.T) {
`{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`,
"(?s)\n<div class=\"video\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen title=\"YouTube Video\">.*?</iframe>.*?</div>",
},
// set custom title for accessability)
// set custom title for accessibility)
{
`{{< youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" >}}`,
"(?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>",
Expand Down
6 changes: 3 additions & 3 deletions hugolib/hugo_modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ JS imported in module: |
"devDependencies": {
"postcss-cli": "7.8.0",
"tailwindcss": "1.8.0"
}
}`)

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1078,7 +1078,7 @@ workingDir=%q
[[module.mounts]]
source = %q
target = "content"
`, workDir, absContentDir)

defer clean1()
Expand Down
6 changes: 3 additions & 3 deletions hugolib/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion hugolib/page__common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hugolib/pagebundler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions hugolib/pagecollections.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hugolib/pages_capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion hugolib/paths/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 04b8985

Please sign in to comment.