diff --git a/index.js b/index.js index 8d8804a..fd32541 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,7 @@ const TableOfContentsSerializer = new Serializer('page', { 'title', 'pages', 'skip_toc', + 'is_heading', ], keyForAttribute: 'cammelcase', }); diff --git a/test/core.js b/test/core.js index 64a6349..81788b0 100644 --- a/test/core.js +++ b/test/core.js @@ -198,6 +198,10 @@ id: face input.write({ 'index.md': '# Hello world', 'pages.yml': ` +- title: "Introduction + url: 'toc-heading-introduction' + is_heading: true + - title: "Guides and Tutorials" url: 'index' skip_toc: true @@ -226,6 +230,15 @@ id: face expect(folderOutput.content).to.have.property('index.json'); + expect(JSON.parse(folderOutput.content['pages.json']).data).to.deep.include({ + type: 'pages', + id: 'toc-heading-introduction', + attributes: { + title: 'Introduction', + 'is-heading': true, + }, + }); + expect(JSON.parse(folderOutput.content['pages.json']).data).to.deep.include({ type: 'pages', id: 'index',