Documentation ¶
Index ¶
- type Document
- type FilesEvent
- type Page
- type Site
- func (s *Site) AbsDir() string
- func (s *Site) AddDocument(d Document, output bool)
- func (s *Site) AddHTMLPage(url string, src string, fm pages.FrontMatter)
- func (s *Site) Clean() error
- func (s *Site) Config() *config.Config
- func (s *Site) DestDir() string
- func (s *Site) Exclude(siteRel string) bool
- func (s *Site) FilePathPage(rel string) (Document, bool)
- func (s *Site) FilenameURLPath(relpath string) (string, bool)
- func (s *Site) FilenameURLs() map[string]string
- func (s *Site) HasLayout(ln string) bool
- func (s *Site) KeepFile(filename string) bool
- func (s *Site) OutputDocs() []Document
- func (s *Site) Pages() (out []Page)
- func (s *Site) PathPrefix() string
- func (s *Site) Posts() []Page
- func (s *Site) Read() error
- func (s *Site) ReadCollections() (err error)
- func (s *Site) RelativePath(path string) string
- func (s *Site) Reloaded(paths []string) (*Site, error)
- func (s *Site) RendererManager() renderers.Renderers
- func (s *Site) RequiresFullReload(paths []string) bool
- func (s *Site) SetAbsoluteURL(url string)
- func (s *Site) Site() interface{}
- func (s *Site) SourceDir() string
- func (s *Site) TemplateEngine() *liquid.Engine
- func (s *Site) ToLiquid() interface{}
- func (s *Site) URLPage(urlpath string) (p Document, found bool)
- func (s *Site) WatchFiles() (<-chan FilesEvent, error)
- func (s *Site) WatchRebuild() (<-chan interface{}, error)
- func (s *Site) Write() (int, error)
- func (s *Site) WriteDoc(d Document) error
- func (s *Site) WriteDocument(w io.Writer, d Document) error
- func (s *Site) WriteFiles() (count int, err error)
- func (s *Site) WritePage(w io.Writer, p Page) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesEvent ¶ added in v0.1.0
type FilesEvent struct { Time time.Time // A single time is used for all the changes Paths []string // relative to site source }
FilesEvent is a list of changed or added site source files, with a single timestamp that approximates when they were changed.
func (FilesEvent) String ¶ added in v0.1.0
func (e FilesEvent) String() string
type Site ¶
type Site struct { Collections []*collection.Collection Routes map[string]Document // URL path -> Document; only for output pages // contains filtered or unexported fields }
Site is a Jekyll site.
func FromDirectory ¶
FromDirectory reads the configuration file, if it exists.
func (*Site) AddDocument ¶
AddDocument adds a document to the site's fields. It ignores unpublished documents unless config.Unpublished is true.
func (*Site) AddHTMLPage ¶ added in v0.2.6
func (s *Site) AddHTMLPage(url string, src string, fm pages.FrontMatter)
AddHTMLPage is in the plugins.Site interface.
func (*Site) Clean ¶
Clean the destination. Remove files that aren't in keep_files, and resulting empty directories.
func (*Site) Exclude ¶
Exclude returns a boolean indicating that the site configuration excludes a file or directory. It does not exclude top-level _underscore files and directories.
func (*Site) FilePathPage ¶
FilePathPage returns a Page, give a file path relative to site source directory.
func (*Site) FilenameURLPath ¶
FilenameURLPath returns a page's URL path, give a relative file path relative to the site source directory.
func (*Site) FilenameURLs ¶
FilenameURLs returns a map of site-relative pathnames to URL paths
func (*Site) KeepFile ¶
KeepFile returns a boolean indicating that clean should leave the file in the destination directory.
func (*Site) OutputDocs ¶ added in v0.1.0
OutputDocs returns a list of output pages.
func (*Site) PathPrefix ¶
PathPrefix is in the page.Container interface.
func (*Site) ReadCollections ¶
ReadCollections reads the pages of the collections named in the site configuration. It adds each collection's pages to the site map, and creates a template site variable for each collection.
func (*Site) RelativePath ¶ added in v0.2.0
RelativePath is in the page.Container interface.
func (*Site) Reloaded ¶ added in v0.1.0
Reloaded returns the same or a new site reading the same source directory, configuration file, and load flags. build --incremental and site --incremental use this.
func (*Site) RendererManager ¶ added in v0.2.5
RendererManager returns the rendering manager.
func (*Site) RequiresFullReload ¶ added in v0.2.3
RequiresFullReload returns true if a source file requires a full reload / rebuild.
This is always true outside of incremental mode, since even a static asset can cause pages to change if they reference its variables.
This function works on relative paths. It does not work for theme sources.
func (*Site) SetAbsoluteURL ¶
SetAbsoluteURL overrides the loaded configuration. The server uses this.
func (*Site) Site ¶
func (s *Site) Site() interface{}
Site is in the pages.RenderingContext interface.
func (*Site) TemplateEngine ¶
TemplateEngine is part of the plugins.Site interface.
func (*Site) ToLiquid ¶
func (s *Site) ToLiquid() interface{}
ToLiquid returns the site variable for template evaluation.
func (*Site) WatchFiles ¶ added in v0.1.0
func (s *Site) WatchFiles() (<-chan FilesEvent, error)
WatchFiles returns a channel that receives FilesEvent on changes within the site directory.
func (*Site) WatchRebuild ¶ added in v0.1.0
WatchRebuild watches the site directory. Each time a file changes, it rebuilds the site. It sends status messages (strings) and errors to its output channel.
TODO use a logger instead of a message channel?
func (*Site) Write ¶ added in v0.2.5
Write cleans the destination and writes files into it. It sets TZ from the site config.
func (*Site) WriteDocument ¶
WriteDocument writes the rendered document.
func (*Site) WriteFiles ¶ added in v0.1.0
WriteFiles writes output files.