Files
imen_pishghaman/apps/web/app/composables/useSeoContext.ts
T

14 lines
509 B
TypeScript
Raw Normal View History

import type { SeoContext } from "#shared/seo/schema";
/** Absolute URL on the production domain. "/" → "https://domain/" (matches the sitemap entry). */
export const useAbsUrl = () => {
const { siteUrl } = useRuntimeConfig().public;
return (p: string) => new URL(p, siteUrl).toString();
};
/** Settings + site URL for the JSON-LD builders in #shared/seo/schema */
export const useSeoContext = (): SeoContext => ({
settings: useSiteStore().settings,
siteUrl: useRuntimeConfig().public.siteUrl,
});