Back to godoc.org

Package tags

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 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.

Index

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").

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