anvil library Null safety

Classes

Anvil
Anvil defines the main executable
BuildConfig
Configuration for building static site.
BuildSearchIndex
Build JSON search index for static search of your content. [...]
Config
Content
Content symbolizes node in content tree. See Page or Section for concrete implementation.
ContentFile
ContentParser
DirectoryServer
Serves local directory with given path as a web server.
GitUtil
LocalServer
Local web server used for anvil serve command. [...]
Page
Page is leaf node which cannot have other subpages.
RedirectPage
Special Page used for aliasing/redirecting pages. Whenever you specify aliases inside your frontmatter, RedirectPage is created.
Section
Section is node with other subsections or pages.
ServeConfig
Configuration specific to build serve command.
Tag
TemplatesConfig
Configures default behavior for template selection. [...]

Extensions

DirectoryExtension
FileSystemEntityExtension

Constants

fs → const LocalFileSystem
kAnvilConfigFile → const String
'anvil.yaml'

Functions

createSearchIndex(Content content, Config config, BuildData data) List<Map<String, dynamic>>
getConfig() Future<Either<ConfigError, Config>>
Returns content of config.yaml file or throws when the file does not exists.
getContentDirectory(Config config) Future<Either<BuildError, Directory>>
Content directory contains Markdown/HTML files. [...]
getDataDirectory(Config config) Directory
getPublicDirectory(Config config) Future<Directory>
Public directory contains generated static files suitable for publishing. [...]
getStaticDirectory(Config config) Directory
Static folder contains files to be copied into public folder like CSS or JS. [...]
getTemplatesDirectory(Config config) Directory
Templates folder contains Jinja templates for rendering Markdown files inside content folder. [...]
isProjectDirectory() Future<bool>
jsonToYaml(dynamic json) String
parseAddress(String address, int port) Uri
Parse configured base_url. [...]
parseDataTree(Config config, {String? path}) Map<String, Object?>
Parse JSON files inside data_dir and create data Map which you can access inside templates. [...]
setupReloadScript(Config config) Future<void>
watch(String directory, {required Glob files}) Stream<WatchEvent>
Watch directory for changes in whole subtree except public directory.

Enums

ContentFileType

Exceptions / Errors

AnvilError
BuildError
CommandError
ConfigError
MissingFrontmatterError