mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
Create pages from _content.gotmpl
Closes #12427 Closes #12485 Closes #6310 Closes #5074
This commit is contained in:
parent
55dea41c1a
commit
e2d66e3218
60 changed files with 2391 additions and 438 deletions
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/bep/gitmap"
|
||||
"github.com/gohugoio/hugo/common/hugo"
|
||||
"github.com/gohugoio/hugo/common/paths"
|
||||
"github.com/gohugoio/hugo/media"
|
||||
|
||||
"github.com/gohugoio/hugo/common/hugio"
|
||||
|
||||
|
@ -37,6 +38,12 @@ type File struct {
|
|||
lazyInit sync.Once
|
||||
}
|
||||
|
||||
// IsContentAdapter returns whether the file represents a content adapter.
|
||||
// This means that there may be more than one Page associated with this file.
|
||||
func (fi *File) IsContentAdapter() bool {
|
||||
return fi.fim.Meta().PathInfo.IsContentData()
|
||||
}
|
||||
|
||||
// Filename returns a file's absolute path and filename on disk.
|
||||
func (fi *File) Filename() string { return fi.fim.Meta().Filename }
|
||||
|
||||
|
@ -136,7 +143,7 @@ func (fi *File) p() *paths.Path {
|
|||
func NewFileInfoFrom(path, filename string) *File {
|
||||
meta := &hugofs.FileMeta{
|
||||
Filename: filename,
|
||||
PathInfo: paths.Parse("", filepath.ToSlash(path)),
|
||||
PathInfo: media.DefaultPathParser.Parse("", filepath.ToSlash(path)),
|
||||
}
|
||||
|
||||
return NewFileInfo(hugofs.NewFileMetaInfo(nil, meta))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue