This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
Open
Description
When using with target:static
multiple meta tags are duplicated in my generated html files.
E.g. lang
, charset
, language
, viewport
, ... all meta tags, that modules.js
are handled during generate()
as "without content"
Investigating the issue I found, that this is a "problem" with vue-meta
.
when vue-meta
is refreshing the metas it removes duplicates only based on the given hid
If there is no hid
set, then it is possible, that a single meta value is added multiple times.
Proposed fix
Adding hid
based on meta.id
when generating the metas so that vue-meta
s filtering works as expected.
//modules.js:241
const generate = (metas, optionsGenerate, id = '', index = false) => {
...
if (meta.value && meta.multi && Array.isArray(meta.value)) {
...
} else if (typeof meta.value === 'object' && !Array.isArray(meta.value)) {
...
} else if (meta.content) {
...
} else if (meta.id) {
if (meta.ids) {
meta.ids.map(id => {
...
outputMeta.push({
hid: id, // -------------------> add hid
[id]: meta.value
})
})
} else {
...
outputMeta.push({
hid: meta.id, // -------------------> add hid
[meta.id]: meta.value
})
}
}
})
}
I'll prepare a PR
Metadata
Assignees
Labels
No labels