diff --git a/components/Nav/Banner.vue b/components/Nav/Banner.vue
index 07006c98..f4917469 100644
--- a/components/Nav/Banner.vue
+++ b/components/Nav/Banner.vue
@@ -32,7 +32,7 @@ const dismiss = (id: string) => {
-
+
diff --git a/components/Nav/Footer.vue b/components/Nav/Footer.vue
index 53d510f0..7ec94ce1 100644
--- a/components/Nav/Footer.vue
+++ b/components/Nav/Footer.vue
@@ -58,7 +58,7 @@ const socials = {
-
+
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 8d05d2e3..ac913ed4 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -61,6 +61,9 @@ export default defineNuxtConfig({
gtm: {
id: process.env.GOOGLE_TAG_MANAGER_ID!,
},
+ site: {
+ url: process.env.NUXT_PUBLIC_SITE_URL!,
+ },
},
},
diff --git a/plugins/links.ts b/plugins/links.ts
new file mode 100644
index 00000000..f13d5f37
--- /dev/null
+++ b/plugins/links.ts
@@ -0,0 +1,34 @@
+export default defineNuxtPlugin((nuxtApp) => {
+ nuxtApp.vueApp.directive('links', {
+ mounted(el: HTMLElement) {
+ const anchors = Array.from(el.getElementsByTagName('a'));
+
+ for (const anchor of anchors) {
+ const href = anchor.getAttribute('href');
+
+ if (!href) return;
+
+ const url = new URL(href, window.location.origin);
+
+ const isLocal = url.hostname === 'directus.io';
+
+ if (isLocal) {
+ anchor.addEventListener('click', (e) => {
+ const { pathname, searchParams, hash } = new URL(anchor.href);
+
+ navigateTo({
+ path: pathname,
+ hash: hash,
+ query: Object.fromEntries(searchParams.entries()),
+ });
+
+ e.preventDefault();
+ });
+ } else {
+ anchor.setAttribute('target', '_blank');
+ anchor.setAttribute('rel', 'noopener noreferrer');
+ }
+ }
+ },
+ });
+});