Documentation
¶
Index ¶
- Constants
- Variables
- func ReadConfig(ctx *cli.Context) (cfg Config, flags Flags, configPaths []string, err error)
- type Cloudfront
- type Config
- func (c Config) AuthorOrDefault() string
- func (c Config) BaseURLOrDefault() string
- func (c *Config) Fields() []Field
- func (c Config) ImagePostTemplateOrDefault() string
- func (c Config) ImageSizesOrDefault() []int
- func (c Config) OutputPathOrDefault() string
- func (c Config) PagesPathOrDefault() string
- func (c Config) PartialsPathOrDefault() string
- func (c Config) PostSortAscendingOrDefault() bool
- func (c Config) PostSortKeyOrDefault() string
- func (c Config) PostsPathOrDefault() string
- func (c Config) SlugTemplateOrDefault() string
- func (c Config) StaticsPathOrDefault() string
- func (c Config) TagTemplateOrDefault() string
- func (c Config) TextPostTemplateOrDefault() string
- func (c Config) ThumbnailCachePathOrDefault() string
- func (c Config) TitleOrDefault() string
- type Extra
- type Field
- type Flags
- type S3
Constants ¶
const ( FlagConfig = "config" FlagDryRun = "dry-run" FlagParallelism = "parallelism" )
Flag constants
Variables ¶
var ( Version = "" GitRef = "" )
These are set by ldflags.
Functions ¶
Types ¶
type Cloudfront ¶
type Cloudfront struct {
Distribution string `json:"distribution,omitempty" yaml:"distribution,omitempty"`
}
Cloudfront represents cloudfront options.
func (Cloudfront) IsZero ¶
func (cf Cloudfront) IsZero() bool
IsZero returns if the config is set or not.
type Config ¶
type Config struct { // Title is the title for the blog. Title string `json:"title" yaml:"title"` // Author is your name. Author string `json:"author" yaml:"author"` // Description is a description for the blog, will be used in html head meta. Description string `json:"description,omitempty" yaml:"description,omitempty"` // BaseURL is the base url for the blog. BaseURL string `json:"baseURL,omitempty" yaml:"baseURL,omitempty"` // PostsPath is the path to the posts to compile. PostsPath string `json:"postsPath,omitempty" yaml:"postsPath,omitempty"` // PagesPath is the path to a folder with pages to compile. // They are rendered and copied to the root of the output. PagesPath string `json:"pagesPath,omitempty" yaml:"pagesPath,omitempty"` // OutputPath is the compiled site path. OutputPath string `json:"outputPath,omitempty" yaml:"outputPath,omitempty"` // PatialsPath is the path to a folder with partials to include // when rendering pages and the posts. PartialsPath string `json:"partialsPath,omitempty" yaml:"partialsPath,omitempty"` // StaticPath is the path to a folder with static files to copy over. StaticsPath string `json:"staticsPath,omitempty" yaml:"staticsPath,omitempty"` // ThumbnailCachePath is the path to the thumbnail cache. ThumbnailCachePath string `json:"thumbnailCachePath,omitempty" yaml:"thumbnailCachePath,omitempty"` // SlugTemplate is the template for post slugs. // It defaults to "/{{ .Meta.Posted.Year }}/{{ .Meta.Posted.Month }}/{{ .Meta.Posted.Day }}/{{ .Meta.Title | slugify }}/" SlugTemplate string `json:"slugTemplate,omitempty" yaml:"slugTemplate,omitempty"` // ImagePostTemplate is the path to the post template file. // It is what is rendered when you go to /<POST_SLUG>/ for image posts. ImagePostTemplatePath string `json:"imagePostTemplatePath,omitempty" yaml:"imagePostTemplatePath,omitempty"` // TextPostTemplatePath is the path to the text post template file. // It is what is rendered when you go to /<POST_SLUG>/ for text posts. TextPostTemplatePath string `json:"textPostTemplatePath,omitempty" yaml:"textPostTemplatePath,omitempty"` // TagTemplate is the path to the tag template file. // It is what is rendered when you go to /tags/:tag_name TagTemplatePath string `json:"tagTemplatePath,omitempty" yaml:"tagTemplatePath,omitempty"` // ImageSizes lets you set what size thumbnails to create from post files. // This defaults to 2048px, 1024px, and 512px. ImageSizes []int `json:"imageSizes,omitempty" yaml:"imageSizes,omitempty"` // Extra is optional and allows you to provide variables for templates. Extra map[string]string `json:"extra,omitempty" yaml:"extra,omitempty"` // S3 governs how the blog is deployed. S3 S3 `json:"s3,omitempty" yaml:"s3,omitempty"` // Cloudfront governs options for how the s3 files are cached. Cloudfront Cloudfront `json:"cloudfront,omitempty" yaml:"cloudfront,omitempty"` // PostSortKey is the key that you can use to sort posts in the feed by. PostSortKey string `json:"postSortKey,omitempty" yaml:"postSortKey,omitempty"` // PostSortAscending determines if we should sort ascending or descending. PostSortAscending *bool `json:"postSortAscending,omitempty" yaml:"postSortAscending,omitempty"` // SkipImageOriginal instructs the engine to not copy the original image. SkipCopyOriginalImage bool `json:"skipImageOriginal,omitempty" yaml:"skipImageOriginal,omitempty"` // SkipTags instructs the engine to not create tag summary pages. SkipGenerateTags bool `json:"skipGenerateTags,omitempty" yaml:"skipGenerateTags,omitempty"` // SkipGenerateJSONData instructs the engine not to create a data.json file. SkipGenerateJSONData bool `json:"skipGenerateJSONData,omitempty" yaml:"skipGenerateJSONData,omitempty"` }
Config is the blog config
func (Config) AuthorOrDefault ¶
AuthorOrDefault returns the author or a default.
func (Config) BaseURLOrDefault ¶
BaseURLOrDefault returns the base url or a default.
func (Config) ImagePostTemplateOrDefault ¶
ImagePostTemplateOrDefault returns the single post template or a default.
func (Config) ImageSizesOrDefault ¶
ImageSizesOrDefault returns the image sizes or a default set.
func (Config) OutputPathOrDefault ¶
OutputPathOrDefault returns the output path.
func (Config) PagesPathOrDefault ¶
PagesPathOrDefault returns page file paths or defaults.
func (Config) PartialsPathOrDefault ¶
PartialsPathOrDefault returns partial file paths or defaults.
func (Config) PostSortAscendingOrDefault ¶
PostSortAscendingOrDefault returns the post sort direction or a default.
func (Config) PostSortKeyOrDefault ¶
PostSortKeyOrDefault returns the post sort key or a default.
func (Config) PostsPathOrDefault ¶
PostsPathOrDefault returns the images path.
func (Config) SlugTemplateOrDefault ¶
SlugTemplateOrDefault returns the slug template or default.
func (Config) StaticsPathOrDefault ¶
StaticsPathOrDefault returns static file paths or defaults.
func (Config) TagTemplateOrDefault ¶
TagTemplateOrDefault returns the single tag template or a default.
func (Config) TextPostTemplateOrDefault ¶
TextPostTemplateOrDefault returns the single text post template or a default.
func (Config) ThumbnailCachePathOrDefault ¶
ThumbnailCachePathOrDefault returns static file paths or defaults.
func (Config) TitleOrDefault ¶
TitleOrDefault returns the title or a default.