render

package
v0.0.0-...-8b2948b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: MIT Imports: 8 Imported by: 0

README

简介

该模块使用html/template库来解析模板,并把它写入目标路经

会把源路径中所有".html"文件加载进来,并对其中非"_"开头的文件进行渲染

包含在keepdir中的 文件/文件夹 将会原封不动的拷贝到目标路经中

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(source, target string, keepdirs []string, data interface{}) error

* Render render html file from source path to target path * use html/template lib to parse template to the specified data object * any have ".html" suffix file in source path will be load * any without "_" prefix and have ".html" suffix file in source path will be render to target path with same path name * all in keepdirs list path file/dir will be copy to target path

func SplitRenderFile

func SplitRenderFile(root string, keepdir DirSorted) ([]PathFile, []PathFile, error)

* split file with need rending and not

Types

type DirSorted

type DirSorted []string

func CreateExcludeSorted

func CreateExcludeSorted(list []string) DirSorted

type PathFile

type PathFile struct {
	Path string
	File string
}

Jump to

Keyboard shortcuts

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