API Reference

Theme Class

Defined in lib/theme/index.js:10
Extends Box

Description

This module manages all files in the theme folder.

Constructor

Theme

This module manages all files in the theme folder.

Methods

_dispatch

(type, path, [callback]) async private
Inherited from : lib/box/index.js:102

Dispatches files to processors.

Parameters

  • type String

    Available types: create, update, delete

  • path String

    File path

  • callback Function optional

_loadFileList

(callback) async private
Inherited from : lib/box/index.js:175

Loads file list and checks their modified date.

Parameters

addProcessor

(pattern, fn)
Inherited from : lib/box/index.js:86

Adds a processor to the box.

Parameters

generate

([options], [callback]) async

Runs generators.

Parameters

getView

(path) Theme.View

Gets a view.

Parameters

Returns

process

([files], [callback]) async
Inherited from : lib/box/index.js:266

Loads all files and runs processors.

Parameters

unwatch

Inherited from : lib/box/index.js:396

Stops watching.

watch

Inherited from : lib/box/index.js:347

Starts watching.

Properties

Box.File

static
Inherited from : lib/box/index.js:408

See Box.File

Box.Pattern

static
Inherited from : lib/box/index.js:417

See Box.Pattern

base

Inherited from : lib/box/index.js:31

Base path.

config

Theme configuration.

i18n

The i18n instance of the theme.

isProcessing

private
Inherited from : lib/box/index.js:64

Indicates if the box is processing.

options

Inherited from : lib/box/index.js:73

processingFiles

private
Inherited from : lib/box/index.js:47

Processing files.

processors

Inherited from : lib/box/index.js:39

Processor collection.

views

The view collection of the theme.

watcher

Inherited from : lib/box/index.js:56

A instance of watcher.