octopusthink.com does this by passing a homepage prop to the SEO component, which works because the homepage is using a different template than the other pages. So we basically have two options here:
Always use a separate template for the homepage. (Increases complexity needlessly for some uses.)
Dynamically determine if we're on the homepage (maybe by inspecting the URL or the source filename?) and page the prop accordingly.
No. 2 seems like the much less fragile option here, but if it isn't a possible technically a better alternative might be to manually set a "homepage" flag to true in the homepage's front matter.
Basically so this:
becomes
See https://github.com/octopusthink/octopusthink.com/pull/92 for some context.
octopusthink.com does this by passing a
homepage
prop to the SEO component, which works because the homepage is using a different template than the other pages. So we basically have two options here:No. 2 seems like the much less fragile option here, but if it isn't a possible technically a better alternative might be to manually set a "homepage" flag to true in the homepage's front matter.