Page class

A single page of the site.

It contains the page's source path, url, content, and additional data. The page object is passed to the different modules of the content package and may be modified by them. How the page is built is determined by the PageConfig object.

Available extensions

Constructors

Page({required String path, required String url, required String content, Map<String, Object?> initialData = const {}, required PageConfig config, required RouteLoader loader})

Properties

config PageConfig
The configuration for the page.
final
content String
The (unparsed) content of the page.
getter/setter pair
data PageDataMap
Data available to the page.
no setter
hashCode int
The hash code for this object.
no setterinherited
loader RouteLoader
The route loader that created this page.
final
path String
The source path of the page including its suffix, e.g. 'index.html', 'some/path.md'.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url String
The url of the page, e.g. '/', '/some/path'.
final

Methods

apply({String? content, Map<String, Object?>? data, bool mergeData = true}) → void
Applies changes to the page content or data.
applyExtensions(List<Node> nodes) Future<List<Node>>

Available on Page, provided by the PageHandlersExtension extension

Applies the configured extensions to the parsed nodes.
build() Future<Component>
buildLayout(Component child) → Component

Available on Page, provided by the PageHandlersExtension extension

Builds the layout for the page using one of the configured layouts.
copy() Page
getContentType() String

Available on Page, provided by the PageHandlersExtension extension

loadData() Future<void>

Available on Page, provided by the PageHandlersExtension extension

Loads additional data for the page using the configured data loaders.
markNeedsRebuild() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseFrontmatter() → void

Available on Page, provided by the PageHandlersExtension extension

Parses the frontmatter of the page content and adds it to the page data.
parseNodes() List<Node>

Available on Page, provided by the PageHandlersExtension extension

Parses the page content using one of the configured parsers.
readPartial(String path) Future<String>
readPartialSync(String path) String
render() Future<Component>
Renders the page.
renderTemplate(List<Page> pages) Future<void>

Available on Page, provided by the PageHandlersExtension extension

Renders the page content using the configured template engine.
toString() String
A string representation of this object.
inherited
wrapTheme(Component child) → Component

Available on Page, provided by the PageHandlersExtension extension

Wraps child in the provided theme.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

wrap(Page page, List<Page> pages, Component child) → Component