mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Add IsRenderable to Page
As pages are read from the target, they will be assessed if they should be rendered or not. The logic for IsRenderable is in the parser/page.go and looks for anything exception '<'.
This commit is contained in:
@@ -39,6 +39,7 @@ type Content []byte
|
||||
type Page interface {
|
||||
FrontMatter() FrontMatter
|
||||
Content() Content
|
||||
IsRenderable() bool
|
||||
}
|
||||
|
||||
type page struct {
|
||||
@@ -55,6 +56,10 @@ func (p *page) FrontMatter() FrontMatter {
|
||||
return p.frontmatter
|
||||
}
|
||||
|
||||
func (p *page) IsRenderable() bool {
|
||||
return p.render
|
||||
}
|
||||
|
||||
// ReadFrom reads the content from an io.Reader and constructs a page.
|
||||
func ReadFrom(r io.Reader) (p Page, err error) {
|
||||
reader := bufio.NewReader(r)
|
||||
|
Reference in New Issue
Block a user