Documentation
¶
Overview ¶
Package goldsmith generates static websites.
Index ¶
- type Context
- func (self *Context) CreateFileFromAsset(relPath, dataPath string) (*File, error)
- func (self *Context) CreateFileFromReader(relPath string, reader io.Reader) (*File, error)
- func (self *Context) DispatchAndCacheFile(outputFile *File, inputFiles ...*File)
- func (self *Context) DispatchFile(file *File)
- func (self *Context) Filter(filters ...Filter) *Context
- func (self *Context) RetrieveCachedFile(outputPath string, inputFiles ...*File) *File
- func (self *Context) Threads(threads int) *Context
- type File
- func (self *File) CopyProps(file *File)
- func (self *File) Dir() string
- func (self *File) Ext() string
- func (self *File) GoString() string
- func (self *File) ModTime() time.Time
- func (self *File) Name() string
- func (self *File) Path() string
- func (self *File) Prop(name string) (FileProp, bool)
- func (self *File) PropOrDef(name string, valueDef FileProp) FileProp
- func (self *File) Props() FileProps
- func (self *File) Read(data []byte) (int, error)
- func (self *File) RemoveProp(name string)
- func (self *File) Rename(path string) error
- func (self *File) Seek(offset int64, whence int) (int64, error)
- func (self *File) SetProp(name string, value FileProp)
- func (self *File) Size() int64
- func (self *File) WriteTo(writer io.Writer) (int64, error)
- type FileProp
- type FileProps
- type Filter
- type Finalizer
- type Goldsmith
- type Initializer
- type Plugin
- type Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context corresponds to the current link in the chain and provides methods that enable plugins to inject new files into the chain.
func (*Context) CreateFileFromAsset ¶
CreateFileFromAsset creates a new file instance from the provided file path.
func (*Context) CreateFileFromReader ¶
CreateFileFrom data creates a new file instance from the provided data buffer.
func (*Context) DispatchAndCacheFile ¶
DispatchAndCacheFile caches the file data (excluding the metadata), taking dependencies on any input files that are needed to generate it, and then passes it to the next link in the chain.
func (*Context) DispatchFile ¶
DispatchFile causes the file to get passed to the next link in the chain.
func (*Context) RetrieveCachedFile ¶
RetrieveCachedFile looks up file data (excluding the metadata), given an output path and any input files that are needed to generate it. The function will return nil if the desired file is not found in the cache.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents in-memory or on-disk files in a chain.
func (*File) PropOrDef ¶
PropOrDef returns the metadata property for the provided name or the default.
func (*File) RemoveProp ¶
RemoveProp deletes the metadata property for the provided name.
type Finalizer ¶
Finalizer allows for optional finalization of a plugin after all files queued in the chain have passed through it.
type Goldsmith ¶
Goldsmith chainable context.
func (*Goldsmith) Begin ¶
Begin starts a chain, reading the files located in the source directory as input.
func (*Goldsmith) FilterPush ¶
FilterPush pushes a filter instance on the chain's filter stack.
type Initializer ¶
Initializer is used to optionally initialize a plugin and to specify a filter to be used for determining which files will be processed.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package devserver makes it easy to view statically generated websites and automatically rebuild them when source data changes.
|
Package devserver makes it easy to view statically generated websites and automatically rebuild them when source data changes. |
filters
|
|
Package harness provides a simple way to test goldsmith plugins and filters.
|
Package harness provides a simple way to test goldsmith plugins and filters. |
plugins
|
|
absolute
Package absolute converts relative file references in HTML documents to absolute paths.
|
Package absolute converts relative file references in HTML documents to absolute paths. |
breadcrumbs
Package breadcrumbs generates metadata required to enable breadcrumb navigation.
|
Package breadcrumbs generates metadata required to enable breadcrumb navigation. |
collection
Package collection groups related pages into named collections.
|
Package collection groups related pages into named collections. |
document
Package document enables simple HTML modification via callback via "goquery", an API similar to "jquery".
|
Package document enables simple HTML modification via callback via "goquery", an API similar to "jquery". |
forward
Package forward allows to create simple redirections for pages that have moved to a new URL.
|
Package forward allows to create simple redirections for pages that have moved to a new URL. |
frontmatter
Package frontmatter extracts the metadata stored in your files.
|
Package frontmatter extracts the metadata stored in your files. |
index
Package index creates metadata for directory listings and generates index pages for every directory which contains other files.
|
Package index creates metadata for directory listings and generates index pages for every directory which contains other files. |
layout
Package layout transforms content by applying Go templates to the content and metadata of HTML files.
|
Package layout transforms content by applying Go templates to the content and metadata of HTML files. |
livejs
Package livejs injects code to reload the current page when it (or its dependencies) are modified.
|
Package livejs injects code to reload the current page when it (or its dependencies) are modified. |
markdown
Package markdown renders Markdown documents to HTML with the "goldmark" processor.
|
Package markdown renders Markdown documents to HTML with the "goldmark" processor. |
minify
Package minify removes superfluous data from a variety of web formats without modifying their behavior in web browsers.
|
Package minify removes superfluous data from a variety of web formats without modifying their behavior in web browsers. |
pager
Package pager splits arrays of metadata into standalone pages.
|
Package pager splits arrays of metadata into standalone pages. |
summary
Package summary generates a summary and title for HTML files using CSS selectors.
|
Package summary generates a summary and title for HTML files using CSS selectors. |
syntax
Package syntax generates syntax highlighting for preformatted code blocks using the "chroma" processor.
|
Package syntax generates syntax highlighting for preformatted code blocks using the "chroma" processor. |
tags
Package tags builds tag clouds from file metadata.
|
Package tags builds tag clouds from file metadata. |
thumbnail
Package thumbnail automatically generates thumbnails for a variety of common image formats and saves them to a user-configurable path.
|
Package thumbnail automatically generates thumbnails for a variety of common image formats and saves them to a user-configurable path. |