Skip to content
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

Merged
merged 4 commits into from
Aug 21, 2023
Merged

ENDOC-666 blog seo #769

merged 4 commits into from
Aug 21, 2023

Conversation

nshaw
Copy link
Contributor

@nshaw nshaw commented Aug 18, 2023

No description provided.

@nshaw nshaw requested review from avdev4j and jyunmitch August 18, 2023 18:46
const siteConfig = ctx.siteConfig;
const coverUrl = frontmatter.cover ? siteConfig.themeConfig.entando.domain + siteConfig.base + frontmatter.cover : undefined;

const title = frontmatter.title
Copy link
Contributor

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);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done.

@avdev4j
Copy link
Contributor

avdev4j commented Aug 21, 2023

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.

@nshaw
Copy link
Contributor Author

nshaw commented Aug 21, 2023

@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.

@nshaw nshaw merged commit c1838db into main Aug 21, 2023
@nshaw nshaw deleted the ENDOC-666-blog-seo branch August 21, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants