11<script setup lang="ts">
22import { ref , computed , onBeforeMount , onMounted , onUnmounted , nextTick , watch } from " vue" ;
33import { useRoute } from " vue-router" ;
4+ import { useSeoMeta , useRuntimeConfig } from " #imports" ;
45import MarkdownRenderer from " ~/components/MarkdownRenderer.vue" ;
56import Author from " ~/components/Author.vue" ;
67import { useWorkflowStore } from " ~/stores/workflows" ;
@@ -12,6 +13,39 @@ const appConfig = useAppConfig();
1213const workflowStore = useWorkflowStore ();
1314const workflow = computed (() => workflowStore .workflow );
1415
16+ // Get the public runtime config to access the app URL
17+ const config = useRuntimeConfig ().public ;
18+ const baseUrl = config .appUrl || (process .client ? window .location .origin : " https://iwc.galaxyproject.org" );
19+
20+ const authors = computed (() => {
21+ let authorLine = " " ;
22+ if (workflow .value ?.authors ) {
23+ authorLine = workflow .value .authors .map ((author ) => author .name ).join (" , " );
24+ }
25+ return authorLine ;
26+ });
27+
28+ const workflowName = computed (() => {
29+ return workflow .value ?.definition ?.name || " Workflow Details" ;
30+ });
31+
32+ // Generate SEO meta tags for the workflow detail page
33+ // Using computed properties for reactive SEO meta
34+ useSeoMeta ({
35+ title: computed (() =>
36+ workflow .value ? ` ${workflowName .value } | ${appConfig .site .name } ` : " Workflow Details | " + appConfig .site .name ,
37+ ),
38+ description: computed (() => workflow .value ?.definition .annotation || " Galaxy workflow" ),
39+ ogTitle: computed (() => workflow .value ?.definition ?.name || " Workflow Details" ),
40+ ogDescription: computed (() => workflow .value ?.definition .annotation || " Galaxy workflow" ),
41+ ogImage: ` ${baseUrl }/iwc_logo.png ` ,
42+ ogType: " website" ,
43+ twitterCard: " summary" ,
44+ twitterTitle: computed (() => workflow .value ?.definition ?.name || " Workflow Details" ),
45+ twitterDescription: computed (() => workflow .value ?.definition .annotation || " Galaxy workflow" ),
46+ twitterImage: ` ${baseUrl }/iwc_logo.png ` ,
47+ });
48+
1549const selectedInstance = ref (" " );
1650
1751const launchUrl = computed (() => {
@@ -68,10 +102,6 @@ const tools = computed(() => {
68102 return Array .from (new Set (toolIds ));
69103});
70104
71- const workflowName = computed (() => {
72- return workflow .value ?.definition ?.name || " Workflow Details" ;
73- });
74-
75105// Define interface for tab items
76106interface TabItem {
77107 label: string ;
@@ -151,16 +181,6 @@ onBeforeMount(async () => {
151181 setActiveTabFromHash ();
152182 });
153183});
154-
155- useHead ({
156- title: computed (() => ` ${workflowName .value } | ${appConfig .site .name } ` ),
157- meta: [
158- {
159- name: " description" ,
160- content: ` Workflow ${workflowName .value } ` ,
161- },
162- ],
163- });
164184 </script >
165185
166186<template >
0 commit comments