Documentation
¶
Index ¶
- Variables
- func FromYAML(path string, modelName string, cue string) (map[string]interface{}, error)
- type BaseModel
- type Model
- func (m Model) DestinationContentPath() string
- func (m Model) DestinationFilePath(slug string) string
- func (m Model) New(slug string, destination string) error
- func (m Model) SourceContentPath() string
- func (m Model) SourceFilePath(slug string) string
- func (m Model) StaticContentPath() string
- func (m Model) TemplateFilePath(slug string) string
- func (m Model) TemplatePath() string
Constants ¶
This section is empty.
Variables ¶
var ArticleCue string
ArticleCue is the cue for an Article
var ArticleTemplate string
ArticleTemplate is the template for an article
var CategoryCue string
CategoryCue is the Cue for a category
var CategoryTemplate string
CategoryTemplate is the template for a Category
var Models = []Model{ { ID: "profile", Name: "Profile", Folder: "profiles", ForeignKey: "profile_id", Cue: ProfileCue, }, { ID: "article", Name: "Article", Folder: "articles", ForeignKey: "article_id", Cue: ArticleCue, }, { ID: "category", Name: "Category", Folder: "categories", ForeignKey: "category_id", Cue: CategoryCue, }, { ID: "page", Name: "Page", Folder: "pages", ForeignKey: "page_id", Cue: PageCue, }, }
Models is used by various commands to determine how to perform certain actions based on arguments and flags provided. All new types must be represented in this slice.
var PageCue string
PageCue is the cue template for a page
var PageTemplate string
PageTemplate is the page template
var ProfileCue string
ProfileCue is the cue for a profile
var ProfileTemplate string
ProfileTemplate is the template for a profile
Functions ¶
Types ¶
type BaseModel ¶
type BaseModel struct {
ID string `json:"id"`
Body string `json:"body"`
BodyRaw string `json:"body_raw"`
}
BaseModel defines fields used by all drb models
type Model ¶
Model represents a content model
func (Model) DestinationContentPath ¶
DestinationContentPath returns the path where output YAML is stored
func (Model) DestinationFilePath ¶
DestinationFilePath returns the path where a converted model will be stored as YAML.
func (Model) SourceContentPath ¶
SourceContentPath returns the path where content source files (markdown/yaml) are stored
func (Model) SourceFilePath ¶
SourceFilePath returns the path where a specific content file should be stored, based on its slug
func (Model) StaticContentPath ¶
StaticContentPath returns the path where images and other static content path will be stored
func (Model) TemplateFilePath ¶
TemplateFilePath returns the path for a template file
func (Model) TemplatePath ¶
TemplatePath returns the path where templates are stored