if redirect := serverConfig.MatchRedirect(requestURI); !redirect.IsZero() {
// fullName := filepath.Join(dir, filepath.FromSlash(path.Clean("/"+name)))
doRedirect := true
- // This matches Netlify's behaviour and is needed for SPA behaviour.
+ // This matches Netlify's behavior and is needed for SPA behavior.
// See https://docs.netlify.com/routing/redirects/rewrites-proxies/
if !redirect.Force {
path := filepath.Clean(strings.TrimPrefix(requestURI, baseURL.Path()))
// Turns out that Cloudflare also sets NETLIFY=true in its build environment,
// but all of these 3 should not give any false positives.
if os.Getenv("NETLIFY") == "true" && os.Getenv("PULL_REQUEST") != "" && os.Getenv("DEPLOY_PRIME_URL") != "" {
- // Netlify's cache behaviour is not documented, the currently best example
+ // Netlify's cache behavior is not documented, the currently best example
// is this project:
// https://github.com/philhawksworth/content-shards/blob/master/gulpfile.js
return "/opt/build/cache/hugo_cache/"
var rs *resourceSource
if pi.IsContent() {
- // Create the page now as we need it at assemembly time.
+ // Create the page now as we need it at assembly time.
// The other resources are created if needed.
pageResource, pi, err := m.s.h.newPage(
&pageMeta{
func (t *pageTrees) collectAndMarkStaleIdentities(p *paths.Path) []identity.Identity {
key := p.Base()
var ids []identity.Identity
- // We need only one identity sample per dimensio.
+ // We need only one identity sample per dimension.
nCount := 0
cb := func(n contentNodeI) bool {
if n == nil {
}
// shouldList returns whether this page should be included in the list of pages.
-// glogal indicates site.Pages etc.
+// global indicates site.Pages etc.
func (p *pageMeta) shouldList(global bool) bool {
if p.isStandalone() {
// Never list 404, sitemap and similar.
// the context.Context.
// A common pattern is to pass Page to i18n, and use .ReadingTime etc.
// We need to improve this, but that requires some upstream changes.
- // For now, just creata a wrepper.
+ // For now, just create a wrapper.
templateData = page.PageWithContext{Page: p, Ctx: ctx}
}
}
type ParserAttribute struct {
// Enables custom attributes for titles.
Title bool
- // Enables custom attributeds for blocks.
+ // Enables custom attributes for blocks.
Block bool
}
var (
_ error = (*errorResource)(nil)
- // Imnage covers all current Resource implementations.
+ // Image covers all current Resource implementations.
_ images.ImageResource = (*errorResource)(nil)
// The list of user facing and exported interfaces in resource.go
// Note that if we're missing some interface here, the user will still
httpget ${HUGOTEST_BASEURL_0}doesnotexist 'custom 404'
httpget ${HUGOTEST_BASEURL_0}livereload.js 'function'
-# By defauilt, the server renders to memory.
+# By default, the server renders to memory.
! exists public/index.html
stopServer