Skip to content

Commit 261de93

Browse files
committed
feat: add pages' create time and last edited time in the frontmatter
1 parent 64bbdc9 commit 261de93

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

source/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ export class Notion {
189189
{
190190
id: page.id,
191191
title,
192+
createdTime: page.created_time,
193+
lastEditedTime: page.last_edited_time,
192194
},
193195
{ forceQuotes: true },
194196
).trim(),

spec/client.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ describe('cl:Notion', () => {
5555
---
5656
id: 'page'
5757
title: 'Title'
58+
createdTime: '2020-01-01T00:00:00Z'
59+
lastEditedTime: '2020-01-01T00:00:00Z'
5860
---
5961
block 0 for block page
6062

spec/gatsby-node.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('fn:sourceNodes', () => {
161161
id: 'page',
162162
last_edited_time: '2020-01-01T00:00:00Z',
163163
markdown:
164-
"---\nid: 'page'\ntitle: 'Title'\n---\nblock 0 for block page\n\nblock 0 for block page-block0\n",
164+
"---\nid: 'page'\ntitle: 'Title'\ncreatedTime: '2020-01-01T00:00:00Z'\nlastEditedTime: '2020-01-01T00:00:00Z'\n---\nblock 0 for block page\n\nblock 0 for block page-block0\n",
165165
object: 'page',
166166
parent: { database_id: 'database-page', type: 'database_id' },
167167
properties: {

0 commit comments

Comments
 (0)