structure

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blog

type Blog struct {
	sync.RWMutex
	Url             []byte
	Title           []byte
	Description     []byte
	Cover           []byte
	AssetPath       []byte
	PostCount       int64
	PostsPerPage    int64
	ActiveTheme     string
	NavigationItems []Navigation
}

Blog: settings that are used for template execution

type Helper added in v0.1.0

type Helper struct {
	Name       string
	Arguments  []Helper
	Unescaped  bool
	Position   int
	Block      []byte
	Children   []Helper
	Function   func(*Helper, *RequestData) []byte
	BodyHelper *Helper
}

Helpers are created during parsing of the theme (template files). Helpers should never be altered during template execution (Helpers are shared across all requests).

type Navigation struct {
	Label string `json:"label"`
	Url   string `json:"url"`
	Slug  string `json:"-"`
}

Navigation: an entry in the navigation menu

type Post

type Post struct {
	Id          int64
	Uuid        []byte
	Title       []byte
	Slug        string
	Markdown    []byte
	Html        []byte
	IsFeatured  bool
	IsPage      bool
	IsPublished bool
	Date        *time.Time
	Tags        []Tag
	Author      *User
	Image       []byte
}

type RequestData

type RequestData struct {
	PluginVMs              map[string]*lua.LState
	Posts                  []Post
	Blog                   *Blog
	CurrentTag             *Tag
	CurrentIndexPage       int
	CurrentPostIndex       int
	CurrentTagIndex        int
	CurrentNavigationIndex int
	CurrentHelperContext   int      // 0 = index, 1 = post, 2 = tag, 3 = author, 4 = navigation - used by block helpers
	CurrentTemplate        int      // 0 = index, 1 = post, 2 = tag, 3 = author - never changes during execution. Used by funcs like body_classFunc etc to output the correct class
	ContentForHelpers      []Helper // contentFor helpers that are attached to the currently rendering helper
	CurrentPath            string   // path of the the url of this request
}

RequestData: used for template/helper execution. Contains data specific to the incoming request.

type Tag

type Tag struct {
	Id   int64
	Name []byte
	Slug string
}

type User

type User struct {
	Id       int64
	Name     []byte
	Slug     string
	Email    []byte
	Image    []byte
	Cover    []byte
	Bio      []byte
	Website  []byte
	Location []byte
	Role     int //1 = Administrator, 2 = Editor, 3 = Author, 4 = Owner
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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