Home Manual Reference Source Test Repository
import CollectionPage from 'reptar/lib/collection/page.js'
public class | source

CollectionPage

Constructor Summary

Public Constructor
public

constructor(collectionId: string, pageIndex: number, options: Object)

Constructor for a CollectionPage.

Member Summary

Public Members
public

Collection ID this page is a part of.

public

Data accessible from template.

public

Absolute destination path.

public

An array of Files that are in this page.

public

Unique ID of this CollectionPage.

public

Page index, 0-indexed.

public

The permalink template.

Method Summary

Public Methods
public

Generate the checksum of this CollectionPage.

public

render(globalData: *): *

public

setData(data: {})

public

setFiles(files: Array<File>)

Set what files belong in this page.

public

Link this page with its next page, for use in templates.

public

Link this page with its previus page, for use in templates.

public

async update()

Update a CollectionPage's content via updating every File's content.

public

async write(globalData: Object)

Writes a given CollectionPage to the file system.

Public Constructors

public constructor(collectionId: string, pageIndex: number, options: Object) source

Constructor for a CollectionPage.

Params:

NameTypeAttributeDescription
collectionId string

Collection ID.

pageIndex number

Page index.

options Object

Additional options.

options.config Config

Config instance.

options.renderer Renderer

Renderer instance.

Public Members

public collectionId: string source

Collection ID this page is a part of.

public data: Object source

Data accessible from template.

public destination: string source

Absolute destination path.

public files: Array<string> source

An array of Files that are in this page.

public id: string source

Unique ID of this CollectionPage. Comprised of its Collection's ID and its page index.

public index: number source

Page index, 0-indexed.

The permalink template.

Public Methods

public getChecksum(): string source

Generate the checksum of this CollectionPage. It's derived from the Files that exist in this collection.

Return:

string

public render(globalData: *): * source

Params:

NameTypeAttributeDescription
globalData *

Return:

*

public setData(data: {}) source

Params:

NameTypeAttributeDescription
data {}
  • optional
  • default: {}

public setFiles(files: Array<File>) source

Set what files belong in this page.

Params:

NameTypeAttributeDescription
files Array<File>

Array of files.

public setNextPage(next: CollectionPage) source

Link this page with its next page, for use in templates.

Params:

NameTypeAttributeDescription
next CollectionPage

CollectionPage instance.

public setPreviousPage(previous: CollectionPage) source

Link this page with its previus page, for use in templates.

Params:

NameTypeAttributeDescription
previous CollectionPage

CollectionPage instance.

public async update() source

Update a CollectionPage's content via updating every File's content.

public async write(globalData: Object) source

Writes a given CollectionPage to the file system.

Params:

NameTypeAttributeDescription
globalData Object

Site wide data.