core/view

View resolver and loader.
Source:

Methods

(static) init(hexo)

Initialize module global variables, including the theme directory variable.

Must be used before module:core/view.require or module:core/view.resolve.

Source:
Parameters:
Name Type Description
hexo string Hexo instance.

(static) require(filename) → {Object}

Resolve and require a view module.
Properties:
Name Type Description
resolve function See module:core/view.resolve.
Source:
Parameters:
Name Type Description
filename string The file path of the view to be required.
Returns:
Type:
Object
The view module.

(inner) resolve(filename) → {string}

Resolve the full path of a given view file name.

This function will first look up current theme layout directory and then view directory (lib/view/) in this module and return the full path of the first found file under these directories.

Source:
Parameters:
Name Type Description
filename string The relative file path to the theme layout directory or the lib/view/ directory in this directory.
Returns:
Type:
string
Resolved full path of the given view file.