mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
all: Fix typos and some URLs
This commit is contained in:
parent
4a53fd56b7
commit
168d375784
18 changed files with 26 additions and 26 deletions
|
@ -188,7 +188,7 @@ func ReaderContains(r io.Reader, subslice []byte) bool {
|
||||||
//
|
//
|
||||||
// - "Go" (strings.Title)
|
// - "Go" (strings.Title)
|
||||||
// - "AP" (see https://www.apstylebook.com/)
|
// - "AP" (see https://www.apstylebook.com/)
|
||||||
// - "Chicago" (see http://www.chicagomanualofstyle.org/home.html)
|
// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
|
||||||
// - "FirstUpper" (only the first character is upper case)
|
// - "FirstUpper" (only the first character is upper case)
|
||||||
// - "None" (no transformation)
|
// - "None" (no transformation)
|
||||||
//
|
//
|
||||||
|
|
|
@ -59,7 +59,7 @@ type componentFsDir struct {
|
||||||
fs *componentFs
|
fs *componentFs
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadDir reads count entries from this virtual directorie and
|
// ReadDir reads count entries from this virtual directory and
|
||||||
// sorts the entries according to the component filesystem rules.
|
// sorts the entries according to the component filesystem rules.
|
||||||
func (f *componentFsDir) ReadDir(count int) ([]iofs.DirEntry, error) {
|
func (f *componentFsDir) ReadDir(count int) ([]iofs.DirEntry, error) {
|
||||||
fis, err := f.DirOnlyOps.(iofs.ReadDirFile).ReadDir(-1)
|
fis, err := f.DirOnlyOps.(iofs.ReadDirFile).ReadDir(-1)
|
||||||
|
|
|
@ -103,16 +103,16 @@ type pageMap struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// pageTrees holds pages and resources in a tree structure for all sites/languages.
|
// pageTrees holds pages and resources in a tree structure for all sites/languages.
|
||||||
// Eeach site gets its own tree set via the Shape method.
|
// Each site gets its own tree set via the Shape method.
|
||||||
type pageTrees struct {
|
type pageTrees struct {
|
||||||
// This tree contains all Pages.
|
// This tree contains all Pages.
|
||||||
// This include regular pages, sections, taxonimies and so on.
|
// This include regular pages, sections, taxonomies and so on.
|
||||||
// Note that all of these trees share the same key structure,
|
// Note that all of these trees share the same key structure,
|
||||||
// so you can take a leaf Page key and do a prefix search
|
// so you can take a leaf Page key and do a prefix search
|
||||||
// with key + "/" to get all of its resources.
|
// with key + "/" to get all of its resources.
|
||||||
treePages *doctree.NodeShiftTree[contentNodeI]
|
treePages *doctree.NodeShiftTree[contentNodeI]
|
||||||
|
|
||||||
// This tree contains Resoures bundled in pages.
|
// This tree contains Resources bundled in pages.
|
||||||
treeResources *doctree.NodeShiftTree[contentNodeI]
|
treeResources *doctree.NodeShiftTree[contentNodeI]
|
||||||
|
|
||||||
// All pages and resources.
|
// All pages and resources.
|
||||||
|
@ -1012,7 +1012,7 @@ func (h *HugoSites) resolveAndClearStateForIdentities(
|
||||||
seen := map[string]bool{
|
seen := map[string]bool{
|
||||||
change.IdentifierBase(): true,
|
change.IdentifierBase(): true,
|
||||||
}
|
}
|
||||||
// Print the top level dependenies.
|
// Print the top level dependencies.
|
||||||
identity.WalkIdentitiesDeep(change, func(level int, id identity.Identity) bool {
|
identity.WalkIdentitiesDeep(change, func(level int, id identity.Identity) bool {
|
||||||
if level > 1 {
|
if level > 1 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -169,7 +169,7 @@ ExpiryDate: 2099-07-13 15:28:01 +0000 UTC`
|
||||||
// have date literals.
|
// have date literals.
|
||||||
|
|
||||||
// YAML
|
// YAML
|
||||||
// Note: This is with go-yaml v2, I suspect v3 will fail with the unquouted values.
|
// Note: This is with go-yaml v2, I suspect v3 will fail with the unquoted values.
|
||||||
b.AssertFileContent("public/en/short-date-yaml-unqouted/index.html", expectShortDateEn)
|
b.AssertFileContent("public/en/short-date-yaml-unqouted/index.html", expectShortDateEn)
|
||||||
b.AssertFileContent("public/nn/short-date-yaml-unqouted/index.html", expectShortDateNn)
|
b.AssertFileContent("public/nn/short-date-yaml-unqouted/index.html", expectShortDateNn)
|
||||||
b.AssertFileContent("public/en/short-date-yaml-qouted/index.html", expectShortDateEn)
|
b.AssertFileContent("public/en/short-date-yaml-qouted/index.html", expectShortDateEn)
|
||||||
|
|
|
@ -236,7 +236,7 @@ func (h *HugoSites) process(ctx context.Context, l logg.LevelLogger, config *Bui
|
||||||
return h.processFull(ctx, l, *config)
|
return h.processFull(ctx, l, *config)
|
||||||
}
|
}
|
||||||
|
|
||||||
// assemble creates missing sections, applies agregate values (e.g. dates, cascading params),
|
// assemble creates missing sections, applies aggregate values (e.g. dates, cascading params),
|
||||||
// removes disabled pages etc.
|
// removes disabled pages etc.
|
||||||
func (h *HugoSites) assemble(ctx context.Context, l logg.LevelLogger, bcfg *BuildCfg) error {
|
func (h *HugoSites) assemble(ctx context.Context, l logg.LevelLogger, bcfg *BuildCfg) error {
|
||||||
l = l.WithField("step", "assemble")
|
l = l.WithField("step", "assemble")
|
||||||
|
|
|
@ -92,7 +92,7 @@ type pageMetaParams struct {
|
||||||
|
|
||||||
// From page front matter.
|
// From page front matter.
|
||||||
type pageMetaFrontMatter struct {
|
type pageMetaFrontMatter struct {
|
||||||
configuredOutputFormats output.Formats // outputs defiend in front matter.
|
configuredOutputFormats output.Formats // outputs defined in front matter.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *pageMetaParams) init(preserveOringal bool) {
|
func (m *pageMetaParams) init(preserveOringal bool) {
|
||||||
|
@ -333,7 +333,7 @@ func (ps *pageState) setMetaPost(cascade map[page.PageMatcher]maps.Params) error
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply cascades first so they can be overriden later.
|
// Apply cascades first so they can be overridden later.
|
||||||
if cascade != nil {
|
if cascade != nil {
|
||||||
if ps.m.pageConfig.Cascade != nil {
|
if ps.m.pageConfig.Cascade != nil {
|
||||||
for k, v := range cascade {
|
for k, v := range cascade {
|
||||||
|
|
|
@ -150,7 +150,7 @@ func createTargetPathDescriptor(p *pageState) (page.TargetPathDescriptor, error)
|
||||||
opath, _ = url.QueryUnescape(opath)
|
opath, _ = url.QueryUnescape(opath)
|
||||||
if strings.HasSuffix(opath, "//") {
|
if strings.HasSuffix(opath, "//") {
|
||||||
// When rewriting the _index of the section the permalink config is applied to,
|
// When rewriting the _index of the section the permalink config is applied to,
|
||||||
// we get douple slashes at the end sometimes; clear them up here
|
// we get double slashes at the end sometimes; clear them up here
|
||||||
opath = strings.TrimSuffix(opath, "/")
|
opath = strings.TrimSuffix(opath, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -516,7 +516,7 @@ baseURL = "https://example.org"
|
||||||
disableKinds = ["taxonomy", "term"]
|
disableKinds = ["taxonomy", "term"]
|
||||||
disableLiveReload = true
|
disableLiveReload = true
|
||||||
[outputs]
|
[outputs]
|
||||||
# This looks odd, but it triggers the behaviour in #5858
|
# This looks odd, but it triggers the behavior in #5858
|
||||||
# The total output formats list gets sorted, so CSS before HTML.
|
# The total output formats list gets sorted, so CSS before HTML.
|
||||||
home = [ "CSS" ]
|
home = [ "CSS" ]
|
||||||
-- content/mybundle/index.md --
|
-- content/mybundle/index.md --
|
||||||
|
|
|
@ -462,7 +462,7 @@ func TestRebuildVariations(t *testing.T) {
|
||||||
files := `
|
files := `
|
||||||
-- hugo.toml --
|
-- hugo.toml --
|
||||||
baseURL = "https://example.com"
|
baseURL = "https://example.com"
|
||||||
disdableKinds = ["term", "taxonomy"]
|
disableKinds = ["term", "taxonomy"]
|
||||||
disableLiveReload = true
|
disableLiveReload = true
|
||||||
defaultContentLanguage = "nn"
|
defaultContentLanguage = "nn"
|
||||||
paginate = 20
|
paginate = 20
|
||||||
|
@ -597,7 +597,7 @@ Codeblock Include: {{ .Title }}|
|
||||||
// - Edit content file direct
|
// - Edit content file direct
|
||||||
// - Edit content file transitive shortcode
|
// - Edit content file transitive shortcode
|
||||||
// - Edit content file transitive render hook
|
// - Edit content file transitive render hook
|
||||||
// - Rename one languge version of a content file
|
// - Rename one language version of a content file
|
||||||
// - Delete content file, check site.RegularPages and section.RegularPagesRecursive (length)
|
// - Delete content file, check site.RegularPages and section.RegularPagesRecursive (length)
|
||||||
// - Add content file (see above).
|
// - Add content file (see above).
|
||||||
// - Edit shortcode
|
// - Edit shortcode
|
||||||
|
@ -1284,7 +1284,7 @@ func benchmarkFilesEdit(count int) string {
|
||||||
files := `
|
files := `
|
||||||
-- hugo.toml --
|
-- hugo.toml --
|
||||||
baseURL = "https://example.com"
|
baseURL = "https://example.com"
|
||||||
disdableKinds = ["term", "taxonomy"]
|
disableKinds = ["term", "taxonomy"]
|
||||||
disableLiveReload = true
|
disableLiveReload = true
|
||||||
-- layouts/_default/single.html --
|
-- layouts/_default/single.html --
|
||||||
Single: {{ .Title }}|{{ .Content }}|
|
Single: {{ .Title }}|{{ .Content }}|
|
||||||
|
|
|
@ -206,7 +206,7 @@ type shortcode struct {
|
||||||
// Before Hug0 0.55 we didn't send any shortcode output to the markup
|
// Before Hug0 0.55 we didn't send any shortcode output to the markup
|
||||||
// renderer, and this flag told Hugo to process the {{ .Inner }} content
|
// renderer, and this flag told Hugo to process the {{ .Inner }} content
|
||||||
// separately.
|
// separately.
|
||||||
// The old behaviour can be had by starting your shortcode template with:
|
// The old behavior can be had by starting your shortcode template with:
|
||||||
// {{ $_hugo_config := `{ "version": 1 }`}}
|
// {{ $_hugo_config := `{ "version": 1 }`}}
|
||||||
doMarkup bool
|
doMarkup bool
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ func doRenderShortcode(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pre Hugo 0.55 this was the behaviour even for the outer-most
|
// Pre Hugo 0.55 this was the behavior even for the outer-most
|
||||||
// shortcode.
|
// shortcode.
|
||||||
if sc.doMarkup && (level > 0 || sc.configVersion() == 1) {
|
if sc.doMarkup && (level > 0 || sc.configVersion() == 1) {
|
||||||
var err error
|
var err error
|
||||||
|
|
|
@ -479,7 +479,7 @@ func (h *HugoSites) fileEventsContentPaths(p []pathChange) []pathChange {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remve all files below dir.
|
// Remove all files below dir.
|
||||||
if len(dirs) > 0 {
|
if len(dirs) > 0 {
|
||||||
n := 0
|
n := 0
|
||||||
for _, d := range dirs {
|
for _, d := range dirs {
|
||||||
|
@ -877,7 +877,7 @@ func (s *Site) render(ctx *siteRenderContext) (err error) {
|
||||||
if ctx.outIdx == 0 {
|
if ctx.outIdx == 0 {
|
||||||
// Note that even if disableAliases is set, the aliases themselves are
|
// Note that even if disableAliases is set, the aliases themselves are
|
||||||
// preserved on page. The motivation with this is to be able to generate
|
// preserved on page. The motivation with this is to be able to generate
|
||||||
// 301 redirects in a .htacess file and similar using a custom output format.
|
// 301 redirects in a .htaccess file and similar using a custom output format.
|
||||||
if !s.conf.DisableAliases {
|
if !s.conf.DisableAliases {
|
||||||
// Aliases must be rendered before pages.
|
// Aliases must be rendered before pages.
|
||||||
// Some sites, Hugo docs included, have faulty alias definitions that point
|
// Some sites, Hugo docs included, have faulty alias definitions that point
|
||||||
|
|
|
@ -47,7 +47,7 @@ type siteRenderContext struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Whether to render 404.html, robotsTXT.txt and similar.
|
// Whether to render 404.html, robotsTXT.txt and similar.
|
||||||
// These are useually rendered once in the root of public.
|
// These are usually rendered once in the root of public.
|
||||||
func (s siteRenderContext) shouldRenderStandalonePage(kind string) bool {
|
func (s siteRenderContext) shouldRenderStandalonePage(kind string) bool {
|
||||||
if s.multihost || kind == kinds.KindSitemap {
|
if s.multihost || kind == kinds.KindSitemap {
|
||||||
// 1 per site
|
// 1 per site
|
||||||
|
|
|
@ -28,7 +28,7 @@ type connection struct {
|
||||||
send chan []byte
|
send chan []byte
|
||||||
|
|
||||||
// There is a potential data race, especially visible with large files.
|
// There is a potential data race, especially visible with large files.
|
||||||
// This is protected by synchronisation of the send channel's close.
|
// This is protected by synchronization of the send channel's close.
|
||||||
closer sync.Once
|
closer sync.Once
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// Package blackfriday holds some copmpability functions for the old Blackfriday v1 Markdown engine.
|
// Package blackfriday holds some compability functions for the old Blackfriday v1 Markdown engine.
|
||||||
package blackfriday
|
package blackfriday
|
||||||
|
|
||||||
import "unicode"
|
import "unicode"
|
||||||
|
|
|
@ -141,7 +141,7 @@ type Client struct {
|
||||||
goBinaryStatus goBinaryStatus
|
goBinaryStatus goBinaryStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
// Graph writes a module dependenchy graph to the given writer.
|
// Graph writes a module dependency graph to the given writer.
|
||||||
func (c *Client) Graph(w io.Writer) error {
|
func (c *Client) Graph(w io.Writer) error {
|
||||||
mc, coll := c.collect(true)
|
mc, coll := c.collect(true)
|
||||||
if coll.err != nil {
|
if coll.err != nil {
|
||||||
|
|
|
@ -14,5 +14,5 @@
|
||||||
// Package pageparser provides a parser for Hugo content files (Markdown, HTML etc.) in Hugo.
|
// Package pageparser provides a parser for Hugo content files (Markdown, HTML etc.) in Hugo.
|
||||||
// This implementation is highly inspired by the great talk given by Rob Pike called "Lexical Scanning in Go"
|
// This implementation is highly inspired by the great talk given by Rob Pike called "Lexical Scanning in Go"
|
||||||
// It's on YouTube, Google it!.
|
// It's on YouTube, Google it!.
|
||||||
// See slides here: http://cuddle.googlecode.com/hg/talk/lex.html
|
// See slides here: https://go.dev/talks/2011/lex.slide#1
|
||||||
package pageparser
|
package pageparser
|
||||||
|
|
|
@ -185,7 +185,7 @@ func TestTransform(t *testing.T) {
|
||||||
|
|
||||||
spec := newTestResourceSpec(specDescriptor{c: c})
|
spec := newTestResourceSpec(specDescriptor{c: c})
|
||||||
|
|
||||||
// Two transformations with same id, different behaviour.
|
// Two transformations with same id, different behavior.
|
||||||
t1 := createContentReplacer("t1", "blue", "green")
|
t1 := createContentReplacer("t1", "blue", "green")
|
||||||
t2 := createContentReplacer("t1", "color", "car")
|
t2 := createContentReplacer("t1", "color", "car")
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ type Batcher struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates and starts a Batcher with the given time interval.
|
// New creates and starts a Batcher with the given time interval.
|
||||||
// It will fall back to a poll based watcher if native isn's supported.
|
// It will fall back to a poll based watcher if native isn't supported.
|
||||||
// To always use polling, set poll to true.
|
// To always use polling, set poll to true.
|
||||||
func New(intervalBatcher, intervalPoll time.Duration, poll bool) (*Batcher, error) {
|
func New(intervalBatcher, intervalPoll time.Duration, poll bool) (*Batcher, error) {
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Reference in a new issue