mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
@@ -19,6 +19,8 @@ import (
|
||||
"html"
|
||||
"html/template"
|
||||
|
||||
"github.com/gohugoio/hugo/cache/namedmemcache"
|
||||
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/spf13/cast"
|
||||
@@ -26,14 +28,22 @@ import (
|
||||
|
||||
// New returns a new instance of the transform-namespaced template functions.
|
||||
func New(deps *deps.Deps) *Namespace {
|
||||
cache := namedmemcache.New()
|
||||
deps.BuildStartListeners.Add(
|
||||
func() {
|
||||
cache.Clear()
|
||||
})
|
||||
|
||||
return &Namespace{
|
||||
deps: deps,
|
||||
cache: cache,
|
||||
deps: deps,
|
||||
}
|
||||
}
|
||||
|
||||
// Namespace provides template functions for the "transform" namespace.
|
||||
type Namespace struct {
|
||||
deps *deps.Deps
|
||||
cache *namedmemcache.Cache
|
||||
deps *deps.Deps
|
||||
}
|
||||
|
||||
// Emojify returns a copy of s with all emoji codes replaced with actual emojis.
|
||||
|
Reference in New Issue
Block a user