Returns the base URL path where the site is "mounted". This property is
meant to be used in conjunction with the $path
configuration in content.
For example, if you want to generate your site to: /mysite/
,
/mysite/about/
, /mysite/static/main.css
, etc. You would use in
_collection.yaml
:
$path: /${pod.basePath}/${doc.basename}/
Returns the default locale for the pod. The default locale can be
overwritten in amagaki.ts
.
Returns a set of the pod's global locales. Global locales are defined in
amagaki.ts
.
Returns the pod's global localization configuration.
Returns the meta information from the pod config.
Returns the YAML schema used to serialize and deserialize all YAML documents that go through the pod.
Returns a collection object. If no _collection.yaml
file is found within
the requested directory, the directory will be walked upwards until finding
a directory containing a _collection.yaml
file. If no _collection.yaml
is found, no collection will be returned.
The podPath to the collection.
Lists collections using glob patterns, as outlined by the glob
module.
Various techniques can be used to list collections depending on your needs:
// All top-level collections:
pod.collections('/content/**')
// All top-level collections, sorted by the field "order":
pod.collections('/content/**', {sort: 'order'})
// Both the "pages" and "posts" collections:
pod.collections(['/content/posts/*', '/content/pages/*'])
@param patterns A list of glob patterns or a single glob pattern. If
nothing is supplied, all docs within the pod will be returned.
Configures a configuration update on the pod based on the provided config. Should only be called once on a pod.
Pod configuration value.
Deletes a file within the pod.
Lists documents using glob patterns, as outlined by the glob
module.
Note the following behavior:
_
are ignored.Various techniques can be used to list docs depending on your needs:
// All docs within the "pages" collection:
pod.docs('/content/pages/**')
// Only Markdown docs within the "pages" collection:
pod.docs('/content/pages/**\/*.md')
// All docs within both the "pages" and "posts" collections:
pod.docs(['/content/pages/**', '/content/posts/**'])
// All Markdown docs within the entire pod:
pod.docs('**\/*.md')
// All docs named `index.yaml` within the entire pod:
pod.docs('**\/index.yaml')
A list of glob patterns or a single glob pattern. If nothing is supplied, all docs within the pod will be returned.
Dumps an object to a YAML string, using the pod's schema.
Returns whether a file exists within the pod.
The podPath to the file.
Returns the absolute file path on the file system.
The podPath to the file or directory.
Returns a locale object.
The locale identifier code.
Reads a file into a string.
Reads YAML content from a file into an object.
Reads YAML content into an object.
The YAML content as string to read.
A key used for caching the read.
Sets the environment using settings specified from one of the
preconfigured environments in amagaki.ts
. This is useful for changing
behavior depending on your build environment, such as outputting different
content between dev, staging, and prod.
Returns a static file object.
The podPath to the static file.
Returns a translation string object.
The options of the translation string.
Walks a podPath directory an returns a flattened list of podPaths within
that directory, recursively in a flat list. For example, if walking
/content/pages/
, it might return: /content/pages/index.yaml
,
/content/pages/subpages/index.yaml
, etc.
Writes a file to a location within the pod.
Generated using TypeDoc
Pods are the "command center" for all operations within a site. Pods hold references to things like the build environment, template engines, file system accessors, routes, etc. Pods provide an interaction model for accessing the different elements of a site and operating on them.