Factor provides a standard function that you can use to add dynamic meta tags and information to your pages: useMeta
.
To add custom meta tags, all you need to do is import this function and use it from within your components:
<template> // component... </template>
<script setup>
import { useMeta } from "@factor/api"
import {computed} from 'vue'
useMeta({
title: "my title",
meta: [
{
name: `description`,
content: "my description",
},
{
property: "og:title",
content: metaTitle,
},
{
property: "og:description",
content: "my description",
},
{
name: "twitter:card",
content: "summary",
},
}
name: "twitter:title",
content: metaTitle,
},
{
name: "twitter:description",
// can be computed
content: computed(() => "my description"),
},
],
})
</script>
useMeta