Meta tags not reset on navigate
See original GitHub issueI’m hoping to use this plugin to set specific meta data (title, keywords, og: tags etc) on certain pages, but I want it to fallback to the defaults when you navigate to any page that does NOT specify tag data.
The problem is, it doesn’t appear to reset the tags if a user moves to a page that has no overrides.
For example, in my main file I have this:
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Test App</title>
<meta name="keywords" content="standard keywords, more keywords" id="keywords" />
.... etc ....
I have a view “tagged-view” that has this within it:
head: {
title: { inner: 'My Special Page' },
meta: [
{ name: 'keywords', content: 'special keywords, different words', id: 'keywords' }
]
},
Note that I’m using the id
attribute to do replacement of the tag, and that’s working.
If I go to “/” I see the default title (“My Test App”) and default keywords (“standard keywords, more keywords”).
Then if I click a router link to go to /tagged-view, I can see the title is now “My Special Page | My Test App”, and the keywords have changed to “special keywords, different words”.
However, if I then click a router link to go back to “/” I see that title has changed back to the default (“My Test App”) but the keywords are still showing the customised version (“special keywords, different words’”). It only resets back to the defaults if I do a full page refresh.
So it seems as though the only way to have a deafult is to actually physically set the keywords etc (for ALL my meta tags) on every single page.
Is this a known/intended behaviour, or is there some config I can set to ensure it resets on every navigation?
Thanks 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hey @bronthulke, sorry for the delay. I managed to see the error.
I will do some tests, and soon as done I give you feedback here with the solution or a new fixed version.
Hey @ktquez, it’s still an issue and unfortunately I haven’t even had a chance to dig in any deeper myself.