mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 23:17:06 +02:00
feat(v2): add ability to set custom title delimiter in config (#3460)
* feat(v2): add custom title delimiter to the theme classic * fix validation tests * remove title delimiter fallback * move titleDelimiter to main config, update theme-bootstrap * remove test value from config * update test snapshot * Improve docs Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
This commit is contained in:
parent
8bed33b81f
commit
c0d8238c49
9 changed files with 38 additions and 10 deletions
|
@ -22,6 +22,7 @@ function Layout(props) {
|
|||
title: siteTitle,
|
||||
themeConfig: {image: defaultImage},
|
||||
url: siteUrl,
|
||||
titleDelimiter,
|
||||
} = siteConfig;
|
||||
const {
|
||||
children,
|
||||
|
@ -33,8 +34,9 @@ function Layout(props) {
|
|||
permalink,
|
||||
version,
|
||||
} = props;
|
||||
const metaTitle = title ? `${title} | ${siteTitle}` : siteTitle;
|
||||
|
||||
const metaTitle = title
|
||||
? `${title} ${titleDelimiter} ${siteTitle}`
|
||||
: siteTitle;
|
||||
const metaImage = image || defaultImage;
|
||||
let metaImageUrl = siteUrl + useBaseUrl(metaImage);
|
||||
if (!isInternalUrl(metaImage)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue