// E.g. /blog/my-post.md
PathTypeContentSingle
- // All bewlow are bundled content files.
+ // All below are bundled content files.
// Leaf bundles, e.g. /blog/my-post/index.md
PathTypeLeaf
return s
}
-// IdentifierBase satifies identity.Identity.
+// IdentifierBase satisfies identity.Identity.
func (p *Path) IdentifierBase() string {
return p.Base()
}
return p.s
}
-// Name returns the last element of path withhout any extension.
+// Name returns the last element of path without any extension.
func (p *Path) NameNoExt() string {
if i := p.identifierIndex(0); i != -1 {
return p.s[p.posContainerHigh : p.identifiers[i].Low-1]
return p.s[p.posContainerHigh:]
}
-// Name returns the last element of path withhout any language identifier.
+// Name returns the last element of path without any language identifier.
func (p *Path) NameNoLang() string {
i := p.identifierIndex(p.posIdentifierLanguage)
if i == -1 {
return p.s[p.posContainerHigh:p.identifiers[i].Low-1] + p.s[p.identifiers[i].High:]
}
-// BaseNameNoIdentifier returns the logcical base name for a resource without any idenifier (e.g. no extension).
+// BaseNameNoIdentifier returns the logical base name for a resource without any identifier (e.g. no extension).
// For bundles this will be the containing directory's name, e.g. "blog".
func (p *Path) BaseNameNoIdentifier() string {
if p.IsBundle() {
return p.NameNoIdentifier()
}
-// NameNoIdentifier returns the last element of path withhout any identifier (e.g. no extension).
+// NameNoIdentifier returns the last element of path without any identifier (e.g. no extension).
func (p *Path) NameNoIdentifier() string {
if len(p.identifiers) > 0 {
return p.s[p.posContainerHigh : p.identifiers[len(p.identifiers)-1].Low-1]
return p.base(false, false)
}
-// PathRel returns the path relativeto the given owner.
+// PathRel returns the path relative to the given owner.
func (p *Path) PathRel(owner *Path) string {
ob := owner.Base()
if !strings.HasSuffix(ob, "/") {
For a given taxonomy, renders a list of terms assigned to the page.
@context {page} page The current page.
-@context {string} taxonomy The taxonony.
+@context {string} taxonomy The taxonomy.
@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
*/}}
mu sync.Mutex // protects state below.
- // A set of ilenames in /public that
+ // A set of filenames in /public that
// contains a post-processing prefix.
filenamesWithPostPrefix map[string]bool
}
// AppendDirsMerger merges two directories keeping all regular files
// with the first slice as the base.
-// Duplicate directories in the secnond slice will be ignored.
+// Duplicate directories in the second slice will be ignored.
// This strategy is used for the i18n and data fs where we need all entries.
var AppendDirsMerger overlayfs.DirsMerger = func(lofi, bofi []fs.DirEntry) []fs.DirEntry {
for _, fi1 := range bofi {
return f.fs.collectDirEntries(f.name)
}
-// Sentinal error to signal that a file is a directory.
+// Sentinel error to signal that a file is a directory.
var errIsDir = errors.New("isDir")
func (f *rootMappingDir) Stat() (iofs.FileInfo, error) {
}
func (im *identityManager) forEeachIdentity(fn func(id Identity) bool) bool {
- // The absense of a lock here is debliberate. This is currently opnly used on server reloads
+ // The absence of a lock here is deliberate. This is currently only used on server reloads
// in a single-threaded context.
for id := range im.ids {
if fn(id) {
fmt.Fprintf(ts.Stdout(), "%s %04o %s %s\n", fi.Mode(), fi.Mode().Perm(), fi.ModTime().Format(time.RFC3339Nano), fi.Name())
}
},
- // append appends to a file with a leaading newline.
+ // append appends to a file with a leading newline.
"append": func(ts *testscript.TestScript, neg bool, args []string) {
if len(args) < 2 {
ts.Fatalf("usage: append FILE TEXT")
ordinal int
// This is only used in error situations and is expensive to create,
- // to deleay creation until needed.
+ // to delay creation until needed.
pos htext.Position
posInit sync.Once
createPos func() htext.Position
case []byte:
// Note that we don't do any HTML escaping here.
// We used to do that, but that changed in #9558.
- // Noww it's up to the templates to decide.
+ // Now it's up to the templates to decide.
vv = string(vvv)
default:
panic(fmt.Sprintf("not implemented: %T", vvv))
// RenderASTAttributes writes the AST attributes to the given as attributes to an HTML element.
// This is used by the default HTML renderers, e.g. for headings etc. where no hook template could be found.
-// This performs HTML esacaping of string attributes.
+// This performs HTML escaping of string attributes.
func RenderASTAttributes(w hugio.FlexiWriter, attributes ...ast.Attribute) {
for _, attr := range attributes {
// When enabled, we will pick the vendored module closest to the module
// using it.
- // The default behaviour is to pick the first.
+ // The default behavior is to pick the first.
// Note that there can still be only one dependency of a given module path,
// so once it is in use it cannot be redefined.
VendorClosest bool
const commitPrefix = "releaser:"
-// New initialises a ReleaseHandler.
+// New initializes a ReleaseHandler.
func New(skipPush, try bool, step int) (*ReleaseHandler, error) {
if step < 1 || step > 2 {
return nil, fmt.Errorf("step must be 1 or 2")
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package dartsass integrates with the Dass Sass Embedded protocol to transpile
+// Package dartsass integrates with the Dart Sass Embedded protocol to transpile
// SCSS/SASS.
package dartsass
}
}
- // Not found, let Dart Dass handle it
+ // Not found, let Dart Sass handle it
return "", nil
}