blox

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 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,
	},
}

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 ProfileCue string
View Source
var ProfileTemplate string

Functions

This section is empty.

Types

type Article added in v0.1.3

type Article struct {
	BaseModel `json:",omitempty"`

	Title       string `json:"title"`
	Excerpt     string `json:"excerpt"`
	PublishDate string `json:"publish_date"`
	EditDate    string `json:"edit_date"`

	Draft    bool `json:"draft"`
	Featured bool `json:"featured"`

	CoverImage string `json:"cover_image"`
	ShareImage string `json:"share_image"`

	CategoryID string   `json:"category_id"`
	Tags       []string `json:"tags"`

	ProfileID string `json:"profile_id"`
}

func ArticleFromYAML added in v0.1.3

func ArticleFromYAML(path string) (Article, error)

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 Category added in v0.1.3

type Category struct {
	BaseModel `json:",omitempty"`

	Title       string `json:"title"`
	Description string `json:"description"`

	CoverImage string `json:"cover_image"`
	ShareImage string `json:"share_image"`
}

func CategoryFromYAML added in v0.1.3

func CategoryFromYAML(path string) (Category, error)

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

type Profile

type Profile struct {
	BaseModel `json:",omitempty"`

	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`

	Company string `json:"company"`
	Title   string `json:"title"`

	SocialAccounts []SocialAccount `json:"social_accounts,omitempty"`
}

func ProfileFromYAML

func ProfileFromYAML(path string) (Profile, error)

type SocialAccount

type SocialAccount struct {
	Network  string `json:"network"`
	Username string `json:"username"`
	Url      string `json:"url,omitempty"`
}

Jump to

Keyboard shortcuts

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