summaryrefslogtreecommitdiffstats
path: root/resources/page/page.go
diff options
context:
space:
mode:
Diffstat (limited to 'resources/page/page.go')
-rw-r--r--resources/page/page.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/resources/page/page.go b/resources/page/page.go
index 3c58dbb66..5ddacc8a6 100644
--- a/resources/page/page.go
+++ b/resources/page/page.go
@@ -78,13 +78,30 @@ type ChildCareProvider interface {
// ContentProvider provides the content related values for a Page.
type ContentProvider interface {
Content() (any, error)
+
+ // Plain returns the Page Content stripped of HTML markup.
Plain() string
+
+ // PlainWords returns a string slice from splitting Plain using https://pkg.go.dev/strings#Fields.
PlainWords() []string
+
+ // Summary returns a generated summary of the content.
+ // The breakpoint can be set manually by inserting a summary separator in the source file.
Summary() template.HTML
+
+ // Truncated returns whether the Summary is truncated or not.
Truncated() bool
+
+ // FuzzyWordCount returns the approximate number of words in the content.
FuzzyWordCount() int
+
+ // WordCount returns the number of words in the content.
WordCount() int
+
+ // ReadingTime returns the reading time based on the length of plain text.
ReadingTime() int
+
+ // Len returns the length of the content.
Len() int
}