为了便于开发hexo主题,在此记录下hexo启动后,基本的参数内容。
因为几乎都是json格式,熟悉了过后,用ejs写代码去实现自己想要的功能,两个字:带劲。
不明白官网使用手册,基本的参数都提供了,这个json数据为啥不直接提供。都是我自己运行后调用,打印出来的。
{
title: 'now',
date: Moment<2023-04-13T23:30:27+08:00>,
_content: '',
source: 'now/index.md',
raw: '',
updated: Moment<2023-04-21T12:08:08+08:00>,
path: 'now/index.html',
comments: true,
layout: 'page',
_id: '',
content: '具体内容',
site: { data: {} },
excerpt: '',
more: '',
permalink: 'https://www.ninojay.top/now/index.html',
full_source: '/Users/cengzhongjie/Desktop/website/source/now/index.md',
__page: true,
lang: 'en',
canonical_path: 'now/index.html'
}
{
title: 'hexo底层json数据内容',
date: Moment<2023-04-21T12:49:00+08:00>,
_content: '',
source: '_posts/2023/hexo-date-inside.md',
raw: '',
slug: '2023/hexo-date-inside',
published: true,
updated: Moment<2023-04-21T12:56:33+08:00>,
_id: '',
comments: true,
layout: 'post',
photos: [],
link: '',
content: '',
site: { data: {} },
excerpt: '',
more: '',
path: '2023/hexo-date-inside/',
permalink: 'https://www.ninojay.top/2023/hexo-date-inside/',
full_source: '/Users/cengzhongjie/Desktop/website/source/_posts/2023/hexo-date-inside.md',
asset_dir: '/Users/cengzhongjie/Desktop/website/source/_posts/2023/hexo-date-inside/',
tags: _Query {
data: [ [_Document], [_Document], [_Document], [_Document] ],
length: 4
},
categories: _Query { data: [ [_Document] ], length: 1 },
next: <ref *1> _Document {
title: '这个世界真的能消灭贫困吗?',
date: Moment<2023-04-20T20:17:00+08:00>,
_content: '',
source: '_posts/2023/ask-why-no-more-peaceful-person.md',
raw: '',
slug: '2023/ask-why-no-more-peaceful-person',
published: true,
updated: Moment<2023-04-21T10:31:50+08:00>,
_id: '',
comments: true,
layout: 'post',
photos: [],
link: '',
content: '',
site: { data: {} },
excerpt: '',
more: '',
path: [Getter],
permalink: [Getter],
full_source: [Getter],
asset_dir: [Getter],
tags: [Getter],
categories: [Getter],
prev: _Document {
title: 'hexo底层json数据内容',
date: Moment<2023-04-21T12:49:00+08:00>,
_content: '',
source: '_posts/2023/hexo-date-inside.md',
raw: '',
slug: '2023/hexo-date-inside',
published: true,
updated: Moment<2023-04-21T12:56:33+08:00>,
_id: '',
comments: true,
layout: 'post',
photos: [],
link: '',
content: '',
site: [Object],
excerpt: '',
more: '',
path: [Getter],
permalink: [Getter],
full_source: [Getter],
asset_dir: [Getter],
tags: [Getter],
categories: [Getter],
next: [Circular *1],
__post: true
},
next: _Document {
title: '手把手教你搭建轻型个人网站(0)——前言',
date: Moment<2023-04-19T13:45:00+08:00>,
_content: '',
source: '_posts/2023/how-to-deploy-your-own-website-0.md',
raw: '',
slug: '2023/how-to-deploy-your-own-website-0',
published: true,
updated: Moment<2023-04-21T12:50:39+08:00>,
_id: 'clgq2pcx20008inqt63x2a5i1',
comments: true,
layout: 'post',
photos: [],
link: '',
content: '',
path: [Getter],
permalink: [Getter],
full_source: [Getter],
asset_dir: [Getter],
tags: [Getter],
categories: [Getter],
prev: [Circular *1],
next: [_Document],
__post: true
},
__post: true
},
__post: true,
lang: 'en',
canonical_path: '2023/hexo-date-inside/index.html'
}
_Query {
data: [
_Document {
name: '互联网',
_id: '',
slug: [Getter], // 互联网
path: [Getter], // tags/工具使用/
permalink: [Getter], // https://www.ninojay.top/tags/%E6%80%9D%E8%80%83/
posts: [Getter], //见下
length: [Getter] // 1 代表这个标签下的post数目
},
_Document {
name: '工具使用',
_id: '',
slug: [Getter],
path: [Getter],
permalink: [Getter],
posts: [Getter],
length: [Getter]
},
_Document {
name: '搭建网站',
_id: '',
slug: [Getter],
path: [Getter],
permalink: [Getter],
posts: [Getter],
length: [Getter]
},
_Document {
name: 'hexo',
_id: '',
slug: [Getter],
path: [Getter],
permalink: [Getter],
posts: [Getter],
length: [Getter]
}
],
length: 4
}
_Query {
data: [
_Document {
title: '这个世界真的能消灭贫困吗?',
date: Moment<2023-04-20T20:17:00+08:00>,
_content: '',
source: '',
slug: '2023/ask-why-no-more-peaceful-person',
published: true,
updated: Moment<2023-04-21T10:31:50+08:00>,
_id: '',
comments: true,
layout: 'post',
photos: [],
link: '',
content: '',
site: [Object],
excerpt: '',
more: '',
path: [Getter],
permalink: [Getter],
full_source: [Getter],
asset_dir: [Getter],
tags: [Getter],
categories: [Getter],
prev: [_Document],
next: [_Document],
__post: true
}
],
length: 1
}
_Query {
data: [
_Document {
name: '思辨',
_id: '',
slug: [Getter], // 思辨
path: [Getter], // categories/思辨/
permalink: [Getter], // https://www.ninojay.top/categories/%E6%80%9D%E8%BE%A8/
posts: [Getter],
length: [Getter] // 7 代表该分类下post数量
}
],
length: 1
}
_Query {
data: [
_Document {
title: '食01-小炒肉',
date: Moment<2022-03-31T14:27:36+08:00>,
banner: '/img/postImages/xiaochaorou.jpg',
_content: '',
source: '_posts/2022/stir-fried-pork.md',
raw: '',
slug: '2022/stir-fried-pork',
published: true,
updated: Moment<2023-04-19T03:11:22+08:00>,
comments: true,
layout: 'post',
photos: [],
link: '',
_id: '',
content: '',
path: [Getter],
permalink: [Getter],
full_source: [Getter],
asset_dir: [Getter],
tags: [Getter],
categories: [Getter],
prev: [_Document],
next: [_Document],
__post: true
}
],
length: 1
}