new File(…objects)
File's data. Properties of parameters will be assigned to File.
You must provide docDir
and docPath
to File so it could be saved, or
provide docDir
and srcPath
, and ensure docPath
will be generated from
srcPath
by renderer.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
objects |
Object |
<repeatable> |
Properties:
Name | Type | Description |
---|---|---|
srcDir |
String | |
srcPath |
String | |
docDir |
String | |
docPath |
String | Maybe generated by renderer from |
binary |
Boolean | Whether file is a binary. |
created |
String | |
updated |
String | |
title |
String | |
layout |
String | |
draft |
Boolean | Whether file is a draft. |
raw |
Buffer | String | Raw file content that is read from disk. |
text |
String | File content after front-matter. |
content |
String | Rendered content that is wrote to disk. |
frontMatter |
Object | |
categories |
Array.<Category> | Only available for posts. |
tags |
Array.<Tag> | Only available for posts. |
category |
Category | Current category if this is a category page. |
tag |
Tag | Current tag if this is a tag page. |
excerpt |
String | |
more |
String | Content after excerpt. |
toc |
Array.<TOC> | Content TOC. |
files |
Array.<File> | Files belonging to this file. |
posts |
Array.<File> | Posts belonging to this file. Typically available for pages like home or archives. |
pages |
Array.<File> | If this page is paginated, this contains all
paginated pages. Generated by |
index |
Number | If this page is paginated, this is the index of
current page in all paginated pages. Generated by |
next |
File | Next post. |
prev |
File | Prev post. |