Skip to main content
Module

x/lume_plugin_ci/deps.ts>Site

Lume plugin for CI information
Go to Latest
class Site
Re-export
import { Site } from "https://deno.land/x/lume_plugin_ci@v0.1.0/deps.ts";

This is the heart of Lume, it contains everything needed to build the site

Constructors

new
Site(options?: Partial<SiteOptions>)

Properties

componentLoader: ComponentLoader

To load reusable components

dataLoader: DataLoader

To load all _data files

events: Events<SiteEvent>

To listen and dispatch events

files: StaticFile[]

The static files to be copied are stored here

formats: Formats

Info about how to handle different file formats

globalData: Data

Global data shared by all pages

includesLoader: IncludesLoader

To load all _includes files (layouts, templates, etc)

logger: Logger

To output messages to the console

options: SiteOptions
pageLoader: PageLoader

To load all pages

pages: Page[]

The generated pages are stored here

preprocessors: Processors

To store and run the pre-processors

processors: Processors

To store and run the processors

reader: Reader

To read the files from the filesystem

renderer: Renderer

To render the pages using any template engine

scopes: Scopes

To update pages of the same scope after any change

scripts: Scripts

To run scripts

source: Source

To scan the src folder

writer: Writer

To write the generated pages in the dest folder

Methods

addEventListener(
type: SiteEventType,
listener: EventListener<SiteEvent> | string,
options?: EventOptions,
): this

Add a listener to an event

build(): Promise<void>

Build the entire site

clear(): Promise<void>

Clear the dest directory and any cache

copy(from: string, to?: string | ((path: string) => string)): this

Copy static files or directories without processing

copy(from: string[], to?: (path: string) => string): this
data(name: string, data: unknown): this

Register extra data accessible by layouts

dest(...path: string[]): string

Returns the full path to the dest directory. Use the arguments to return a subpath

dispatchEvent(event: SiteEvent): Promise<boolean>

Dispatch an event

engine(extensions: string[], engine: Engine): this

Register a engine for some extensions

filter(
name: string,
filter: Helper,
async?,
): this

Register a template filter

getContent(file: string, unnamed 1?: ResolveOptions): Promise<string | Uint8Array | undefined>

Get the content of a file. Resolve the path if it's needed.

helper(
name: string,
fn: Helper,
options: HelperOptions,
): this

Register a template helper

ignore(...paths: (string | ScopeFilter)[]): this

Ignore one or several files or directories

includes(extensions: string[], path: string): this

Register an import path for some extensions

loadAssets(extensions: string[], pageLoader?: Loader): this

Register an assets loader for some extensions

loadComponents(
extensions: string[],
componentLoader?: Loader,
engine: Engine,
): this

Register a component loader for some extensions

loadData(extensions: string[], dataLoader?: Loader): this

Register a data loader for some extensions

loadPages(
extensions: string[],
pageLoader?: Loader,
engine?: Engine,
): this

Register a page loader for some extensions

preprocess(extensions: string[] | "*", preprocessor: Processor): this

Register a preprocessor for some extensions

process(extensions: string[] | "*", processor: Processor): this

Register a processor for some extensions

remoteFile(filename: string, url: string): this

Define a remote fallback for a missing local file

renderPage(file: string): Promise<Page | undefined>

Render a single page (used for on demand rendering)

run(name: string, options?: ScriptOptions): Promise<boolean>

Runs a script or function registered previously

scopedUpdates(...scopes: ScopeFilter[]): this

Define independent scopes to optimize the update process

script(name: string, ...scripts: ScriptOrFunction[]): this

Register a script or a function, so it can be executed with lume run

src(...path: string[]): string

Returns the full path to the src directory. Use the arguments to return a subpath

update(files: Set<string>): Promise<void>

Reload some files that might be changed

url(path: string, absolute?): string

Return the URL of a path

use(plugin: Plugin): this

Use a plugin