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

Dont re-use tags when route changes #4

Open
r0skar opened this issue Aug 5, 2018 · 3 comments
Open

Dont re-use tags when route changes #4

r0skar opened this issue Aug 5, 2018 · 3 comments

Comments

@r0skar
Copy link

r0skar commented Aug 5, 2018

Hi, I was trying your awesome plugin with @stencil/router, however I noticed, that If a certain route does not have a Helmet tag, previously declared tags just stay "online". This causes a few problems:

Current behavior
I have a page-not-found component, which will trigger if no other route matches the requested path. If I add a <meta name="robots" content="noindex, nofollow" /> to the 404 component and than go back to the homepage, the robots dont change. The only solution I found is to add <meta name="robots" content="index, follow"> to every route in my app, but this becomes very repetitive.

Desired behavior
Dont re-use previously declared tags, but simply remove them, which basically means we fall back to the original tags declared in index.html

@DavidFrahm
Copy link

I would like to make time and contribute to this issue. Before I dig in from scratch, any existing thoughts on how this should/could be implemented?

@perrygovier
Copy link
Contributor

I solved this with an abstraction layer that outputs default tags if not otherwise provided. You can see it in practice here:
https://github.com/ionic-team/capacitor-site/blob/main/src/components/meta-tags/meta-tags.tsx

@mikaelkaron
Copy link
Collaborator

I this still current? And if so, what would we like to do?

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

No branches or pull requests

4 participants