mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Some godoc adjustments and image struct renames
This commit is contained in:
@@ -20,9 +20,16 @@ var _ Dated = Dates{}
|
||||
// Dated wraps a "dated resource". These are the 4 dates that makes
|
||||
// the date logic in Hugo.
|
||||
type Dated interface {
|
||||
// Date returns the date of the resource.
|
||||
Date() time.Time
|
||||
|
||||
// Lastmod returns the last modification date of the resource.
|
||||
Lastmod() time.Time
|
||||
|
||||
// PublishDate returns the publish date of the resource.
|
||||
PublishDate() time.Time
|
||||
|
||||
// ExpiryDate returns the expiration date of the resource.
|
||||
ExpiryDate() time.Time
|
||||
}
|
||||
|
||||
|
@@ -14,12 +14,9 @@
|
||||
package resource
|
||||
|
||||
import (
|
||||
"image"
|
||||
|
||||
"github.com/gohugoio/hugo/common/maps"
|
||||
"github.com/gohugoio/hugo/langs"
|
||||
"github.com/gohugoio/hugo/media"
|
||||
"github.com/gohugoio/hugo/resources/images/exif"
|
||||
|
||||
"github.com/gohugoio/hugo/common/hugio"
|
||||
)
|
||||
@@ -82,26 +79,6 @@ type Resource interface {
|
||||
ErrProvider
|
||||
}
|
||||
|
||||
// Image represents an image resource.
|
||||
type Image interface {
|
||||
Resource
|
||||
ImageOps
|
||||
}
|
||||
|
||||
type ImageOps interface {
|
||||
Height() int
|
||||
Width() int
|
||||
Crop(spec string) (Image, error)
|
||||
Fill(spec string) (Image, error)
|
||||
Fit(spec string) (Image, error)
|
||||
Resize(spec string) (Image, error)
|
||||
Filter(filters ...any) (Image, error)
|
||||
Exif() *exif.Exif
|
||||
|
||||
// Internal
|
||||
DecodeImage() (image.Image, error)
|
||||
}
|
||||
|
||||
type ResourceTypeProvider interface {
|
||||
// ResourceType is the resource type. For most file types, this is the main
|
||||
// part of the MIME type, e.g. "image", "application", "text" etc.
|
||||
|
Reference in New Issue
Block a user