Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Davis <phil@jankaritech.com>2020-12-16 14:11:32 +0300
committerGitHub <noreply@github.com>2020-12-16 14:11:32 +0300
commit04b89857e104ac7dcbf9fc65d8d4f1a1178123e6 (patch)
tree585bf761f0a1cfc69dffcd8afd22e94ca9da7c07 /resources
parent21fa1e86f2aa929fb0983a0cc3dc4e271ea1cc54 (diff)
all: Fix minor typos
Diffstat (limited to 'resources')
-rw-r--r--resources/image.go2
-rw-r--r--resources/image_cache.go2
-rw-r--r--resources/image_test.go2
-rw-r--r--resources/page/page_generate/generate_page_wrappers.go8
-rw-r--r--resources/page/page_outputformat.go2
-rw-r--r--resources/page/pagegroup.go4
-rw-r--r--resources/page/pages.go2
-rw-r--r--resources/page/pages_prev_next.go2
-rw-r--r--resources/page/pages_related.go2
-rw-r--r--resources/resource.go4
-rw-r--r--resources/resource_spec.go2
-rw-r--r--resources/resource_test.go2
-rw-r--r--resources/resource_transformers/babel/babel.go4
-rw-r--r--resources/resource_transformers/minifier/minify.go2
-rw-r--r--resources/resource_transformers/postcss/postcss.go4
-rw-r--r--resources/transform.go6
16 files changed, 25 insertions, 25 deletions
diff --git a/resources/image.go b/resources/image.go
index ac0a0cc97..ed303613f 100644
--- a/resources/image.go
+++ b/resources/image.go
@@ -152,7 +152,7 @@ func (i *imageResource) cloneWithUpdates(u *transformationUpdate) (baseResource,
var img *images.Image
- if u.isContenChanged() {
+ if u.isContentChanged() {
img = i.WithSpec(base)
} else {
img = i.Image
diff --git a/resources/image_cache.go b/resources/image_cache.go
index 1888b457f..1bb92b6ca 100644
--- a/resources/image_cache.go
+++ b/resources/image_cache.go
@@ -46,7 +46,7 @@ func (c *imageCache) deleteIfContains(s string) {
}
}
-// The cache key is a lowecase path with Unix style slashes and it always starts with
+// The cache key is a lowercase path with Unix style slashes and it always starts with
// a leading slash.
func (c *imageCache) normalizeKey(key string) string {
return "/" + c.normalizeKeyBase(key)
diff --git a/resources/image_test.go b/resources/image_test.go
index 542ecb9b9..9c1861960 100644
--- a/resources/image_test.go
+++ b/resources/image_test.go
@@ -354,7 +354,7 @@ func TestImageResizeInSubPath(t *testing.T) {
assertImageFile(c, spec.BaseFs.PublishFs, publishedImageFilename, 101, 101)
c.Assert(spec.BaseFs.PublishFs.Remove(publishedImageFilename), qt.IsNil)
- // Cleare mem cache to simulate reading from the file cache.
+ // Clear mem cache to simulate reading from the file cache.
spec.imageCache.clear()
resizedAgain, err := image.Resize("101x101")
diff --git a/resources/page/page_generate/generate_page_wrappers.go b/resources/page/page_generate/generate_page_wrappers.go
index ff3744c20..e1d83115b 100644
--- a/resources/page/page_generate/generate_page_wrappers.go
+++ b/resources/page/page_generate/generate_page_wrappers.go
@@ -81,7 +81,7 @@ func generateMarshalJSON(c *codegen.Inspector) error {
// Exclude these methods
excludes := []reflect.Type{
- // We need to eveluate the deprecated vs JSON in the future,
+ // We need to evaluate the deprecated vs JSON in the future,
// but leave them out for now.
pageInterfaceDeprecated,
@@ -146,7 +146,7 @@ func generateDeprecatedWrappers(c *codegen.Inspector) error {
"Hugo": "Use the global hugo function.",
"LanguagePrefix": "Use .Site.LanguagePrefix.",
"GetParam": "Use .Param or .Params.myParam.",
- "RSSLink": `Use the Output Format's link, e.g. something like:
+ "RSSLink": `Use the Output Format's link, e.g. something like:
{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}`,
"URL": "Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url",
}
@@ -244,8 +244,8 @@ package page
%s
// ZeroFile represents a zero value of source.File with warnings if invoked.
-type zeroFile struct {
- log *helpers.DistinctLogger
+type zeroFile struct {
+ log *helpers.DistinctLogger
}
func NewZeroFile(log *helpers.DistinctLogger) source.File {
diff --git a/resources/page/page_outputformat.go b/resources/page/page_outputformat.go
index ff4213cc4..9eed8241e 100644
--- a/resources/page/page_outputformat.go
+++ b/resources/page/page_outputformat.go
@@ -27,7 +27,7 @@ type OutputFormats []OutputFormat
// OutputFormat links to a representation of a resource.
type OutputFormat struct {
- // Rel constains a value that can be used to construct a rel link.
+ // Rel contains a value that can be used to construct a rel link.
// This is value is fetched from the output format definition.
// Note that for pages with only one output format,
// this method will always return "canonical".
diff --git a/resources/page/pagegroup.go b/resources/page/pagegroup.go
index 07ccbfedd..d4ca8ca41 100644
--- a/resources/page/pagegroup.go
+++ b/resources/page/pagegroup.go
@@ -343,7 +343,7 @@ func (p Pages) GroupByParamDate(key string, format string, order ...string) (Pag
return p.groupByDateField(sorter, formatter, order...)
}
-// ProbablyEq wraps comare.ProbablyEqer
+// ProbablyEq wraps compare.ProbablyEqer
func (p PageGroup) ProbablyEq(other interface{}) bool {
otherP, ok := other.(PageGroup)
if !ok {
@@ -387,7 +387,7 @@ func (psg PagesGroup) Len() int {
return l
}
-// ProbablyEq wraps comare.ProbablyEqer
+// ProbablyEq wraps compare.ProbablyEqer
func (psg PagesGroup) ProbablyEq(other interface{}) bool {
otherPsg, ok := other.(PagesGroup)
if !ok {
diff --git a/resources/page/pages.go b/resources/page/pages.go
index ac69a8079..dff784f5c 100644
--- a/resources/page/pages.go
+++ b/resources/page/pages.go
@@ -104,7 +104,7 @@ func (p Pages) Len() int {
return len(p)
}
-// ProbablyEq wraps comare.ProbablyEqer
+// ProbablyEq wraps compare.ProbablyEqer
func (pages Pages) ProbablyEq(other interface{}) bool {
otherPages, ok := other.(Pages)
if !ok {
diff --git a/resources/page/pages_prev_next.go b/resources/page/pages_prev_next.go
index f30a55da5..753a3e415 100644
--- a/resources/page/pages_prev_next.go
+++ b/resources/page/pages_prev_next.go
@@ -13,7 +13,7 @@
package page
-// Next returns the next page reletive to the given
+// Next returns the next page relative to the given
func (p Pages) Next(cur Page) Page {
x := searchPage(cur, p)
if x <= 0 {
diff --git a/resources/page/pages_related.go b/resources/page/pages_related.go
index 026026572..bc3b8b55a 100644
--- a/resources/page/pages_related.go
+++ b/resources/page/pages_related.go
@@ -108,7 +108,7 @@ func (p Pages) withInvertedIndex(search func(idx *related.InvertedIndex) ([]rela
d, ok := p[0].(InternalDependencies)
if !ok {
- return nil, errors.Errorf("invalid type %T in related serch", p[0])
+ return nil, errors.Errorf("invalid type %T in related search", p[0])
}
cache := d.GetRelatedDocsHandler()
diff --git a/resources/resource.go b/resources/resource.go
index 64f9f12f3..28b9a8879 100644
--- a/resources/resource.go
+++ b/resources/resource.go
@@ -440,7 +440,7 @@ func (l *genericResource) openDestinationsForWriting() (w io.WriteCloser, err er
// Fast path:
// This is a processed version of the original;
- // check if it already existis at the destination.
+ // check if it already exists at the destination.
for _, targetFilename := range targetFilenames {
if _, err := l.getSpec().BaseFs.PublishFs.Stat(targetFilename); err == nil {
continue
@@ -662,7 +662,7 @@ type resourcePathDescriptor struct {
targetPathBuilder func() page.TargetPaths
// This will normally be the same as above, but this will only apply to publishing
- // of resources. It may be mulltiple values when in multihost mode.
+ // of resources. It may be multiple values when in multihost mode.
baseTargetPathDirs []string
// baseOffset is set when the output format's path has a offset, e.g. for AMP.
diff --git a/resources/resource_spec.go b/resources/resource_spec.go
index 1659332ab..c29d2eaf9 100644
--- a/resources/resource_spec.go
+++ b/resources/resource_spec.go
@@ -274,7 +274,7 @@ func (r *Spec) newResource(sourceFs afero.Fs, fd ResourceSourceDescriptor) (reso
ext := strings.ToLower(filepath.Ext(fd.RelTargetFilename))
mimeType, found := r.MediaTypes.GetFirstBySuffix(strings.TrimPrefix(ext, "."))
- // TODO(bep) we need to handle these ambigous types better, but in this context
+ // TODO(bep) we need to handle these ambiguous types better, but in this context
// we most likely want the application/xml type.
if mimeType.Suffix() == "xml" && mimeType.SubType == "rss" {
mimeType, found = r.MediaTypes.GetByType("application/xml")
diff --git a/resources/resource_test.go b/resources/resource_test.go
index bf7a94529..f015cd6c9 100644
--- a/resources/resource_test.go
+++ b/resources/resource_test.go
@@ -41,7 +41,7 @@ func TestGenericResource(t *testing.T) {
c.Assert(r.ResourceType(), qt.Equals, "css")
}
-func TestGenericResourceWithLinkFacory(t *testing.T) {
+func TestGenericResourceWithLinkFactory(t *testing.T) {
c := qt.New(t)
spec := newTestResourceSpec(specDescriptor{c: c})
diff --git a/resources/resource_transformers/babel/babel.go b/resources/resource_transformers/babel/babel.go
index a7598f820..64d8667bd 100644
--- a/resources/resource_transformers/babel/babel.go
+++ b/resources/resource_transformers/babel/babel.go
@@ -131,11 +131,11 @@ func (t *babelTransformation) Transform(ctx *resources.ResourceTransformationCtx
configFile = filepath.Clean(configFile)
- // We need an abolute filename to the config file.
+ // We need an absolute filename to the config file.
if !filepath.IsAbs(configFile) {
configFile = t.rs.BaseFs.ResolveJSConfigFile(configFile)
if configFile == "" && t.options.Config != "" {
- // Only fail if the user specificed config file is not found.
+ // Only fail if the user specified config file is not found.
return errors.Errorf("babel config %q not found:", configFile)
}
}
diff --git a/resources/resource_transformers/minifier/minify.go b/resources/resource_transformers/minifier/minify.go
index 51a3f4047..972461e0e 100644
--- a/resources/resource_transformers/minifier/minify.go
+++ b/resources/resource_transformers/minifier/minify.go
@@ -20,7 +20,7 @@ import (
"github.com/gohugoio/hugo/resources/resource"
)
-// Client for minification of Resource objects. Supported minfiers are:
+// Client for minification of Resource objects. Supported minifiers are:
// css, html, js, json, svg and xml.
type Client struct {
rs *resources.Spec
diff --git a/resources/resource_transformers/postcss/postcss.go b/resources/resource_transformers/postcss/postcss.go
index 8ba40ebd1..27864b0c5 100644
--- a/resources/resource_transformers/postcss/postcss.go
+++ b/resources/resource_transformers/postcss/postcss.go
@@ -166,11 +166,11 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC
configFile = filepath.Clean(configFile)
- // We need an abolute filename to the config file.
+ // We need an absolute filename to the config file.
if !filepath.IsAbs(configFile) {
configFile = t.rs.BaseFs.ResolveJSConfigFile(configFile)
if configFile == "" && t.options.Config != "" {
- // Only fail if the user specificed config file is not found.
+ // Only fail if the user specified config file is not found.
return errors.Errorf("postcss config %q not found:", configFile)
}
}
diff --git a/resources/transform.go b/resources/transform.go
index d995bb46b..a9ec84671 100644
--- a/resources/transform.go
+++ b/resources/transform.go
@@ -105,7 +105,7 @@ type ResourceTransformationCtx struct {
// to be simple types, as it needs to be serialized to JSON and back.
Data map[string]interface{}
- // This is used to publis additional artifacts, e.g. source maps.
+ // This is used to publish additional artifacts, e.g. source maps.
// We may improve this.
OpenResourcePublisher func(relTargetPath string) (io.WriteCloser, error)
}
@@ -479,7 +479,7 @@ func (r *resourceAdapter) transform(publish, setContent bool) error {
publishwriters = append(publishwriters, metaw)
}
- // Any transofrmations reading from From must also write to To.
+ // Any transformations reading from From must also write to To.
// This means that if the target buffer is empty, we can just reuse
// the original reader.
if b, ok := tctx.To.(*bytes.Buffer); ok && b.Len() > 0 {
@@ -587,7 +587,7 @@ type transformationUpdate struct {
startCtx ResourceTransformationCtx
}
-func (u *transformationUpdate) isContenChanged() bool {
+func (u *transformationUpdate) isContentChanged() bool {
return u.content != nil || u.sourceFilename != nil
}