head icon indicating copy to clipboard operation
head copied to clipboard

Meta tags are "deduped" based on property name only

Open yp0011 opened this issue 4 years ago • 7 comments

According to https://ogp.me/ "If a tag can have multiple values, just put multiple versions of the same tag on your page."

In my use case I want to add multiple tags for the video pages of my website and I am adding these values to the meta array. The issue is that only 1 of the properties is added due to the fact that the property names are the same.

I have tested this by adding a suffix to each property name and all of the elements are added, although they are no longer valid OG tags.

<meta property="og:video:tag1" content="Bene Gesserit">
<meta property="og:video:tag2" content="Blade Runner 2049">
<meta property="og:video:tag3" content="Coming Soon">

Currently I only get

<meta property="og:video:tag" content="Coming Soon">

The desired outcoume would look like below :

<meta property="og:video:tag" content="Bene Gesserit">
<meta property="og:video:tag" content="Blade Runner 2049">
<meta property="og:video:tag" content="Coming Soon">

I would suggest that a check on the content property value is performed during the deduplication process in order to allow for the desired output as above.

yp0011 avatar Nov 03 '21 15:11 yp0011

You can use key attribute to avoid this.

egoist avatar Nov 23 '21 16:11 egoist

You can use key attribute to avoid this.

Not sure how I missed this, although it does seem a little bit redundant if the content could be used for this purpose?

glen-84 avatar Nov 23 '21 17:11 glen-84

Not sure how I missed this, although it does seem a little bit redundant if the content could be used for this purpose?

yeah that seems like a good idea

egoist avatar Nov 23 '21 17:11 egoist

After 0.7.3 I have the following lines from index.html dissappearing in the final build.

<meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">

I guess this is related to this issue.

husayt avatar Jan 17 '22 11:01 husayt

As of @vueuse/[email protected], should I make reproduction repo?

VeselyJan92 avatar Sep 18 '22 17:09 VeselyJan92

@VeselyJan92

What issue are you having exactly? Reproduction repo would be helpful

harlan-zw avatar Sep 19 '22 03:09 harlan-zw

Thanks for quick attention, but after giving it few hours I found out that there was a bug in i18n-module

https://github.com/nuxt-community/i18n-module/issues/1520

VeselyJan92 avatar Sep 19 '22 09:09 VeselyJan92

Going to close this as the above is unrelated and the main issue is resolved.

harlan-zw avatar Oct 25 '22 03:10 harlan-zw