-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix($core): Change meta merge function #2614 #2615
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
base: master
Are you sure you want to change the base?
Conversation
654fdf9
to
c49055c
Compare
8d6e870
to
87f1bae
Compare
Great work! I just ran into the same issue and was happy to see that someone already addressed it :) I think that your PR only addresses a part of the problem, though. For example the I see two solutions for this:
|
I found another problem: the order of meta tags is very important. For example: <meta property="og:image" content="https://example.com/rock.jpg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:image" content="https://example.com/rock2.jpg" />
<meta property="og:image" content="https://example.com/rock3.jpg" />
<meta property="og:image:height" content="1000" /> means there are 3 images on this page, the first image is 300x300, the middle one has unspecified dimensions, and the last one is 1000px tall. Because the meta property order is important, the following example should not be union: <meta property="og:image" content="https://example.com/rock.jpg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:image" content="https://example.com/rock2.jpg" />
<meta property="og:image" content="https://example.com/rock3.jpg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" /> Because it means there are 3 images on this page, the first image is 300x300, the middle one has unspecified dimensions, and the last one is 300x300. |
Maybe we should maintain a list for unique meta name? We can only deduplicate meta tags which name in the list, and we can expose the list to vueconfig? |
Another method is merging |
Good point with the order of meta tags!
I think this would be the best solution. That way, we don't have to maintain or expose the META_TYPE array. It also means that users can provide default values in That's just my personal opinion, though. It would be nice to hear what the maintainers think :) |
@seifertm Okay, I will rewrite my PR to use this method. |
738ae57
to
d9c8a61
Compare
d9c8a61
to
1823459
Compare
Hey guys. Will it fix this issue? |
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
close #2614