blog

package
v0.0.0-...-7b4d1b6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AtomHref string
View Source
var RssHref string

Functions

func Attach

func Attach(url string)

Attach the blog app frontend

func AttachAdmin

func AttachAdmin(url string)

func Flatpage

func Flatpage(ctx *web.Context, url string) string

A Flatpage view. Attach it via web.Get wherever you want flatpages to be available

func Index

func Index() string

func RenderPost

func RenderPost(post *Post) string

Render the post, using the cached ContentRendered if available, or generating and re-saving it to the database if not

Types

type Entry

type Entry struct {
	Id              bson.ObjectId `bson:"_id,omitempty"`
	SourceId        string
	Url             string
	Type            string
	Title           string
	Data            string
	SummaryRendered string
	ContentRendered string
	Timestamp       uint64
}

func (*Entry) Collection

func (e *Entry) Collection() string

func (*Entry) Indexes

func (e *Entry) Indexes() [][]string

func (*Entry) PreSave

func (e *Entry) PreSave()

func (*Entry) Sorting

func (e *Entry) Sorting() string

func (*Entry) SummaryRender

func (e *Entry) SummaryRender() string

func (*Entry) Unique

func (e *Entry) Unique() bson.M

type M

type M bson.M

type Page

type Page struct {
	Id              bson.ObjectId `bson:"_id,omitempty"`
	Url             string
	Content         string
	ContentRendered string
}

Flatpage Model

func GetPage

func GetPage(url string) *Page

A shortcut to return the page for a given url (or nil if there isn't one)

func (*Page) Collection

func (p *Page) Collection() string

func (*Page) FromParams

func (p *Page) FromParams(params map[string]string) error

Instantiate a Page object from POST parameters

func (*Page) Indexes

func (p *Page) Indexes() [][]string

func (*Page) PreSave

func (p *Page) PreSave()

func (*Page) Unique

func (p *Page) Unique() bson.M

type PagesPanel

type PagesPanel struct{}

func (*PagesPanel) Render

func (pp *PagesPanel) Render() string

type Post

type Post struct {
	Id              bson.ObjectId `bson:"_id,omitempty"`
	Title           string
	Slug            string
	Content         string
	ContentRendered string
	Summary         string
	Tags            []string
	Timestamp       uint64
	Published       int
}

Blog Post Model

func LatestPost

func LatestPost() *Post

A shortcut to return the latest blog post (or nil if there aren't any)

func (*Post) Collection

func (p *Post) Collection() string

func (*Post) FromParams

func (p *Post) FromParams(params map[string]string) error

Instantiate a post object from POST parameters

func (*Post) Indexes

func (p *Post) Indexes() [][]string

func (*Post) NaturalTime

func (p *Post) NaturalTime() string

func (*Post) PreSave

func (p *Post) PreSave()

func (*Post) Sorting

func (p *Post) Sorting() string

func (*Post) Unique

func (p *Post) Unique() bson.M

type PostPanel

type PostPanel struct{}

func (*PostPanel) Render

func (pp *PostPanel) Render() string

type UnpublishedPanel

type UnpublishedPanel struct{}

func (*UnpublishedPanel) Render

func (up *UnpublishedPanel) Render() string

Jump to

Keyboard shortcuts

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