blog

package
v0.0.0-...-5e61291 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: GPL-2.0, GPL-2.0-or-later Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CloneTemplate *template.Template

Functions

func Init

func Init()

博客模板

func RenderTemplate

func RenderTemplate(name string, args map[string]interface{}, basePath string, isPreview bool) revel.Result

name = index.html, search.html, cate.html, page.html basePath 表未用户主题的基路径, 如/xxx/public/upload/32323232/themes/theme1, 如果没有, 则表示用自带的 isPreview 如果是, 错误提示则显示系统的 500 错误详情信息, 供debug

Types

type BlogTpl

type BlogTpl struct {
	Template    *template.Template
	PathContent map[string]string // path => content
}
var BlogTplObject *BlogTpl

func (*BlogTpl) Content

func (this *BlogTpl) Content(name string) string

type ErrorResult

type ErrorResult struct {
	ViewArgs   map[string]interface{}
	Error      error
	IsPreview  bool
	CurBlogTpl *BlogTpl
}

func (ErrorResult) Apply

func (r ErrorResult) Apply(req *revel.Request, resp *revel.Response)

错误显示出

type RenderTemplateResult

type RenderTemplateResult struct {
	Template    *template.Template
	PathContent map[string]string
	ViewArgs    map[string]interface{}

	IsPreview  bool // 是否是预览
	CurBlogTpl *BlogTpl
}

func (*RenderTemplateResult) Apply

func (r *RenderTemplateResult) Apply(req *revel.Request, resp *revel.Response)

Jump to

Keyboard shortcuts

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