ntemplate

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: AGPL-3.0 Imports: 6 Imported by: 2

Documentation

Overview

模板文件和路径处理包

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(mgr driver.Manager, pa PathAliases) driver.Manager

NewManager 新建模板文件系统管理驱动实例

Types

type PathAliases

type PathAliases struct {
	// contains filtered or unexported fields
}

PathAliases 模板路径别名分组设置

func NewPathAliases

func NewPathAliases() *PathAliases

NewPathAliases 新建模板路径别名分组设置实例

func (*PathAliases) Add

func (p *PathAliases) Add(alias, absPath string) *PathAliases

Add 添加别名和路径

func (*PathAliases) AddAllSubdir

func (p *PathAliases) AddAllSubdir(absPath string) error

AddAllSubdir 添加某个路径下以子文件夹为别名的路径(用于添加各个子文件夹为不同主题模板的情况)

func (*PathAliases) Aliases

func (p *PathAliases) Aliases() []string

Aliases 获取全部别名

func (*PathAliases) Parse

func (p *PathAliases) Parse(withAliasTagPath string) string

Parse 根据中括号别名前缀解析模板路径为实际存在的真实路径

func (*PathAliases) ParseOk

func (p *PathAliases) ParseOk(withAliasTagPath string) (string, bool)

ParseOk 根据中括号别名前缀解析模板路径为实际存在的真实路径

func (*PathAliases) ParsePrefix

func (p *PathAliases) ParsePrefix(withAliasPrefixPath string) string

ParsePrefix 根据模板路径子文件夹为别名解析模板路径为实际存在的真实路径

func (*PathAliases) ParsePrefixOk

func (p *PathAliases) ParsePrefixOk(withAliasPrefixPath string) (string, bool)

ParsePrefixOk 根据模板路径子文件夹为别名解析模板路径为实际存在的真实路径

func (*PathAliases) Range

func (p *PathAliases) Range(fn func(string, string) error) (err error)

Range 遍历全部别名及其模板文件夹路径

func (*PathAliases) Restore

func (p *PathAliases) Restore(fullpath string) string

Restore 还原真实路径为带中括号别名前缀的模板初始路径

func (*PathAliases) RestoreOk

func (p *PathAliases) RestoreOk(fullpath string) (string, bool)

RestoreOk 还原真实路径为带中括号别名前缀的模板初始路径

func (*PathAliases) RestorePrefix

func (p *PathAliases) RestorePrefix(fullpath string) string

RestorePrefix 还原真实路径为模板初始路径

func (*PathAliases) RestorePrefixOk

func (p *PathAliases) RestorePrefixOk(fullpath string) (string, bool)

RestorePrefixOk 还原真实路径为模板初始路径

func (*PathAliases) TmplDirs

func (p *PathAliases) TmplDirs() []string

TmplDirs 所有模板文件夹路径

Jump to

Keyboard shortcuts

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