Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 4x 3x 3x 12x 3x 2x 1x 1x 1x 1x | import type { Ref } from "vue";
import { JOURNAL } from "../../../articles/shared/constants";
/** The `citation_*` tags and the `ScholarlyArticle` graph, from an article that has loaded. */
export const useScholarlyMeta = (article: Ref<Article | undefined>) => {
useHead({
meta: () =>
article.value
? toCitationMeta(article.value, JOURNAL).map((tag, index) => ({
...tag,
key: `citation-${index}`,
"data-hid": `citation-${index}`,
}))
: [],
});
useSchemaOrg(
computed(() => {
if (!article.value) return [];
const { title, excerpt, image, publishedAt, updatedAt, authors, permalink } =
article.value;
const periodical = new URL("/#periodical", permalink).href;
return [
{ "@type": "Periodical", "@id": periodical, ...JOURNAL },
defineArticle({
"@type": "ScholarlyArticle",
headline: title,
description: excerpt,
image: image?.url,
datePublished: publishedAt,
dateModified: updatedAt,
isPartOf: { "@id": periodical },
author: authors.map(({ name, slug }) =>
definePerson({
name,
url: new URL(`/colaboradores/${slug}/`, permalink).href,
}),
),
}),
];
}),
);
};
|