nfl / react-helmet

A document head manager for React
MIT License
17.28k stars 657 forks source link

Do not use titleTemplate on homepage #659

Closed rifqirosyidi closed 2 years ago

rifqirosyidi commented 2 years ago

What is the current behavior?

Hi there, i am using titleTemplate in my application which is working fine. For example i have page

About | My Awesome Site Contact | My Awesome Site

However this also apply to my homepage

My Awesome Site | My Awesome Site

here's what i've implemented

<Helmet
      htmlAttributes={{ lang: "en" }}
      defer={true}
      title={props.title}
      titleTemplate="%s | My Awesome Site"
      link={[
        {
          rel: "icon",
          href: favicon.publicURL,
        },
      ]}
      meta={metaTags}
    />

As you may see, i also pass the title props data for my homepage which is "My Awesome Site" so the resulting in "My Awesome Site | My Awesome Site". Is there any way to work around this?