feat(v2): read first heading as title and use it in front-matter (#4485)

* feat(v2): read first heading as title and pass it to front-matter

* fix(v2): always trim content after extracting front-matter

* fix(v2): remove heading from rss and keep duplicate heading

* fix(v2): rollback some unnecessary comment changes

* test(v2): add unit tests to blog

* test(v2): add unit tests to docs

* test(v2): correct issue on windows

* test(v2): add additional test cases
This commit is contained in:
Armano 2021-03-23 18:07:21 +01:00 committed by GitHub
parent fb372c574d
commit ea13c94cc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 448 additions and 35 deletions

View file

@ -119,7 +119,7 @@ export function processDocMetadata({
// ex: myDoc -> .
const docsFileDirName = path.dirname(source);
const {frontMatter = {}, excerpt} = parseMarkdownString(content);
const {frontMatter = {}, excerpt} = parseMarkdownString(content, source);
const {
sidebar_label: sidebarLabel,
custom_edit_url: customEditURL,