fix(v2): fix title logic (meta vs heading) + ignore fixed anchor id syntax (#4688)

* parseMarkdownContentTitle should ignore {#my-anchor-id} syntax

* use frontMatter.title in priority for page meta title

* parseMarkdownString should ignore fixed anchor ids syntax

* docs: make the distinction between headingTitle + metaTitle more clear + add useful todo

* docs: make the distinction between headingTitle + metaTitle more clear + add useful todo

* writeHeadingIds should ignore top-level md title like "# Title"
=> we are not supposed to create anchor links for h1 headers

* update tests

* fix doc tests
This commit is contained in:
Sébastien Lorber 2021-04-27 15:44:46 +02:00 committed by GitHub
parent bca796545b
commit 8ebbc17c7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 124 additions and 77 deletions

View file

@ -181,7 +181,7 @@ describe('simple site', () => {
isDocsHomePage: false,
permalink: '/docs/foo/bar',
slug: '/foo/bar',
title: 'Bar',
title: 'Remarkable',
description: 'This is custom description',
frontMatter: {
description: 'This is custom description',
@ -255,7 +255,7 @@ describe('simple site', () => {
isDocsHomePage: true,
permalink: '/docs/',
slug: '/',
title: 'Bar',
title: 'Remarkable',
description: 'This is custom description',
frontMatter: {
description: 'This is custom description',