util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFilesAll

func CopyFilesAll(thisDir, toDir string)

只支持单级目录的拷贝

func CreateFileWithContent

func CreateFileWithContent(content string, name ...string)

func IsExist

func IsExist(filename string) bool

func IsNotIn

func IsNotIn[T string | int | float32 | float64](arr []T, target T) bool

func MakeTemplateFile

func MakeTemplateFile(dir, name, tmpl string)

创建基础模板文件,分别传入模板名称(可自定义)。 其中dir有三个个可选值,分别是“posts”和“pages”以及“common”,对应文章、页面模板以及共用的模板

func RenderHandle

func RenderHandle(filename string) func(w http.ResponseWriter, r *http.Request)

func ReturnCategoryList

func ReturnCategoryList(posts *[]model.Post) []string

func SimpleMkdir

func SimpleMkdir(em ...string)

func TrimExt

func TrimExt(filename string) string

去除文件扩展名,可传入完整路径或文件BaseName

Types

This section is empty.

Jump to

Keyboard shortcuts

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