-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENDOC-666 blog seo #769
ENDOC-666 blog seo #769
Conversation
const siteConfig = ctx.siteConfig; | ||
const coverUrl = frontmatter.cover ? siteConfig.themeConfig.entando.domain + siteConfig.base + frontmatter.cover : undefined; | ||
|
||
const title = frontmatter.title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick suggestion here, as we proceed the same way to format both frontmatter and page titles.
We should create a function that applies the regexp or return null.
function formatToReadableString(value) {
if(!value){
return null;
}
return value.toString().replace(/["|'|\\]/g, '');
};
Then the current code can be simplified to
const title = formatToReadableString(frontmatter.title) ?? formatToReadableString($page.title);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done.
tested locally, I checked the different tags in the header section and all seems ok. I could not test over Twitter or Facebook because my local OG tool was not working anymore. |
@avdev4j thanks. I pushed to staging and tested using the LinkedIn Post Inspector as well. I also ran a local build in prod mode and it looks good there too. |
No description provided.