Skip to content

Commit

Permalink
Removes metatags if it has no content
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoLnx committed Mar 20, 2024
1 parent bc798d9 commit 01f88cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/PageHead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const {
socialImage,
} = data;
const metatags = {
const rawMetatags = {
viewport: 'width=device-width, initial-scale=1',
'og:title': title,
'og:description': description,
Expand All @@ -35,4 +35,8 @@ const metatags = {
'og:image': socialImage,
'google-site-verification': import.meta.env.VITE_GOOGLE_SITE_VERIFICATION,
};
const metatags = Object.fromEntries(
Object.entries(rawMetatags).filter(([, content]) => content),
);
</script>

0 comments on commit 01f88cc

Please sign in to comment.