mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
@@ -22,6 +22,10 @@ import (
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"github.com/gohugoio/hugo/resources/internal"
|
||||
|
||||
"github.com/gohugoio/hugo/common/herrors"
|
||||
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
"github.com/gohugoio/hugo/media"
|
||||
@@ -95,6 +99,24 @@ type Transformer interface {
|
||||
Transform(...ResourceTransformation) (ResourceTransformer, error)
|
||||
}
|
||||
|
||||
func NewFeatureNotAvailableTransformer(key string, elements ...interface{}) ResourceTransformation {
|
||||
return transformerNotAvailable{
|
||||
key: internal.NewResourceTransformationKey(key, elements...),
|
||||
}
|
||||
}
|
||||
|
||||
type transformerNotAvailable struct {
|
||||
key internal.ResourceTransformationKey
|
||||
}
|
||||
|
||||
func (t transformerNotAvailable) Transform(ctx *ResourceTransformationCtx) error {
|
||||
return herrors.ErrFeatureNotAvailable
|
||||
}
|
||||
|
||||
func (t transformerNotAvailable) Key() internal.ResourceTransformationKey {
|
||||
return t.key
|
||||
}
|
||||
|
||||
type baseResourceResource interface {
|
||||
resource.Cloner
|
||||
resource.ContentProvider
|
||||
|
Reference in New Issue
Block a user