mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
all: Remove unused code
Using x/tools/cmd/deadcode
This commit is contained in:
@@ -129,21 +129,6 @@ type TemplatesProvider interface {
|
||||
TextTmpl() TemplateParseFinder
|
||||
}
|
||||
|
||||
// WithInfo wraps the info in a template.
|
||||
func WithInfo(templ Template, info Info) Template {
|
||||
if manager, ok := info.(InfoManager); ok {
|
||||
return &templateInfoManager{
|
||||
Template: templ,
|
||||
InfoManager: manager,
|
||||
}
|
||||
}
|
||||
|
||||
return &templateInfo{
|
||||
Template: templ,
|
||||
Info: info,
|
||||
}
|
||||
}
|
||||
|
||||
var baseOfRe = regexp.MustCompile("template: (.*?):")
|
||||
|
||||
func extractBaseOf(err string) string {
|
||||
@@ -173,17 +158,6 @@ type page interface {
|
||||
IsNode() bool
|
||||
}
|
||||
|
||||
func GetHasLockFromContext(ctx context.Context) bool {
|
||||
if v := ctx.Value(texttemplate.HasLockContextKey); v != nil {
|
||||
return v.(bool)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func SetHasLockInContext(ctx context.Context, hasLock bool) context.Context {
|
||||
return context.WithValue(ctx, texttemplate.HasLockContextKey, hasLock)
|
||||
}
|
||||
|
||||
func GetCallbackFunctionFromContext(ctx context.Context) any {
|
||||
return ctx.Value(texttemplate.CallbackContextKey)
|
||||
}
|
||||
|
@@ -39,22 +39,6 @@ type InfoManager interface {
|
||||
identity.Manager
|
||||
}
|
||||
|
||||
type defaultInfo struct {
|
||||
identity.Manager
|
||||
parseInfo ParseInfo
|
||||
}
|
||||
|
||||
func NewInfo(id identity.Manager, parseInfo ParseInfo) Info {
|
||||
return &defaultInfo{
|
||||
Manager: id,
|
||||
parseInfo: parseInfo,
|
||||
}
|
||||
}
|
||||
|
||||
func (info *defaultInfo) ParseInfo() ParseInfo {
|
||||
return info.parseInfo
|
||||
}
|
||||
|
||||
type ParseInfo struct {
|
||||
// Set for shortcode templates with any {{ .Inner }}
|
||||
IsInner bool
|
||||
|
Reference in New Issue
Block a user