Back to godoc.org

Package breadcrumbs

v0.0.0-...-42a2ac9
Latest Go to latest

The latest major version is .

Published: Aug 14, 2020 | License: MIT | Module: github.com/FooSoft/goldsmith-components

Overview

Package breadcrumbs generates metadata required to enable breadcrumb navigation. This is particularly helpful for sites that have deep hierarchies which may be otherwise confusing to visitors.

Index

type Breadcrumbs struct {
	// contains filtered or unexported fields
}

Breadcrumbs chainable plugin context.

func New

func New() *Breadcrumbs

New creates a new instance of the Breadcrumbs plugin.

func (plugin *Breadcrumbs) CrumbsKey(key string) *Breadcrumbs

CrumbsKey sets the metadata key used to store information about crumbs (default: "Crumbs").

func (plugin *Breadcrumbs) Finalize(context *goldsmith.Context) error
func (*Breadcrumbs) Initialize(context *goldsmith.Context) (goldsmith.Filter, error)
func (*Breadcrumbs) Name() string
func (plugin *Breadcrumbs) NameKey(key string) *Breadcrumbs

NameKey sets the metadata key used to access the crumb name (default: "CrumbName"). Crumb names must be globally unique within any given website.

func (plugin *Breadcrumbs) ParentKey(key string) *Breadcrumbs

ParentKey sets the metadata key used to access the parent name (default: "CrumbParent").

func (plugin *Breadcrumbs) Process(context *goldsmith.Context, inputFile *goldsmith.File) error

type Crumb

type Crumb struct {
	Ancestors []*Node
	Node      *Node
}

Crumb provides organizational information about this node and ones before it.

type Node

type Node struct {
	File     *goldsmith.File
	Parent   *Node
	Children []*Node
	// contains filtered or unexported fields
}

Node represents information about a specific file in the site's structure.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier