Documentation

Overview

    Package site implements site building.

    Index

    Constants

    View Source
    const TemplateExt = ".tmpl"

      TemplateExt is a template file extension.

      Variables

      View Source
      var SupportedFormats = []string{".html", ".md"}

        SupportedFormats contains supported page formats.

        Functions

        This section is empty.

        Types

        type Page

        type Page struct {
        	URI         string            `yaml:"uri"`
        	Content     string            `yaml:"-"`
        	Title       string            `yaml:"title"`
        	Description string            `yaml:"description"`
        	MetaTags    map[string]string `yaml:"meta_tags"`
        	Template    string            `yaml:"template"`
        	// contains filtered or unexported fields
        }

          Page represents a site page.

          func (*Page) Build

          func (p *Page) Build() error

            Build builds a site page to dst.

            type Site

            type Site struct {
            	// contains filtered or unexported fields
            }

              Site represents a site.

              func New

              func New(src, dst string, minify bool) (*Site, error)

                New returns a new site.

                func (*Site) Build

                func (s *Site) Build() error

                  Build builds the site.

                  func (*Site) Clean

                  func (s *Site) Clean() (err error)

                    Clean removes all generated files.

                    func (*Site) Serve

                    func (s *Site) Serve(addr string) error

                      Serve starts local HTTP server, serving the site.

                      Source Files