blox

package
v0.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArticleCue string
View Source
var ArticleTemplate string
View Source
var CategoryCue string
View Source
var CategoryTemplate string
View Source
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.

View Source
var PageCue string
View Source
var PageTemplate string
View Source
var ProfileCue string
View Source
var ProfileTemplate string

Functions

func FromYAML added in v0.1.12

func FromYAML(path string, modelName string, cue string) (map[string]interface{}, error)

Types

type BaseModel added in v0.1.3

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

type Model struct {
	ID         string
	Name       string
	Folder     string
	ForeignKey string
	Cue        string
}

func GetModel

func GetModel(id string) (Model, error)

GetModel finds a Model definition and returns it to the caller.

func (Model) DestinationContentPath

func (m Model) DestinationContentPath() string

func (Model) DestinationFilePath

func (m Model) DestinationFilePath(slug string) string

func (Model) New

func (m Model) New(slug string, destination string) error

func (Model) SourceContentPath

func (m Model) SourceContentPath() string

func (Model) SourceFilePath

func (m Model) SourceFilePath(slug string) string

func (Model) StaticContentPath added in v0.1.3

func (m Model) StaticContentPath() string

func (Model) TemplateFilePath added in v0.1.7

func (m Model) TemplateFilePath(slug string) string

func (Model) TemplatePath added in v0.1.7

func (m Model) TemplatePath() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL