v0.0.0-...-72c21ce Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 8 Imported by: 0



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 (self *Tags) BaseDir(dir string) *Tags

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

func (*Tags) Finalize

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

func (*Tags) IndexMeta

func (self *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) error

func (*Tags) Name

func (*Tags) Name() string

func (*Tags) Process

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

func (*Tags) StateKey

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

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

func (*Tags) TagsKey

func (self *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").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL