Package tags builds tag clouds from file metadata. This makes it easy to create lists of all files tagged with a specific tag, as well as to see all tags globally used on a site.



This section is empty.


This section is empty.


This section is empty.


type TagInfo

type TagInfo struct {
	TaggedFiles filesByPath
	IndexFile   *goldsmith.File
	SafeName    string
	RawName     string

TagInfo contains site-wide information about a particular tag.

type TagState

type TagState struct {
	CurrentTag  *TagInfo
	CurrentTags tagInfoByName
	TagsByName  *tagInfoByName
	TagsByCount *tagInfoByCount

TagState contains site-wide information about tags used on a site.

type Tags

type Tags struct {
	// contains filtered or unexported fields

Tags chainable context.

func New

func New() *Tags

New creates a new instance of the Tags plugin.

func (*Tags) BaseDir

func (plugin *Tags) BaseDir(dir string) *Tags

BaseDir sets the base directory used to generate tag list files (default: "tags").

func (*Tags) Finalize

func (plugin *Tags) Finalize(context *goldsmith.Context) error

func (*Tags) IndexMeta

func (plugin *Tags) IndexMeta(meta map[string]interface{}) *Tags

IndexMeta sets the metadata which will be assigned to generated tag list files (default: {}).

func (*Tags) IndexName

func (plugin *Tags) IndexName(name string) *Tags

IndexName sets the filename which will be used to create tag list files (default: "index.html").

func (*Tags) Initialize

func (*Tags) Initialize(context *goldsmith.Context) (goldsmith.Filter, error)

func (*Tags) Name

func (*Tags) Name() string

func (*Tags) Process

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

func (*Tags) StateKey

func (plugin *Tags) StateKey(key string) *Tags

StateKey sets the meatadata key used to store site-wide tag information (default: "TagState").

func (*Tags) TagsKey

func (plugin *Tags) TagsKey(key string) *Tags

TagsKey sets the metadata key used to get the tags for this file, stored as a slice of strings (default: "Tags").

Source Files