Skip to content

Commit c0af134

Browse files
authored
Merge pull request #811 from dannon/social-previews
Social previews, followup of meta.
2 parents 7230c55 + 12731bc commit c0af134

File tree

4 files changed

+86
-14
lines changed

4 files changed

+86
-14
lines changed

website/nuxt.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,13 @@ export default defineNuxtConfig({
2323
},
2424
},
2525

26+
// Add runtime configuration for the application URL
27+
runtimeConfig: {
28+
public: {
29+
// Default base URL for production
30+
appUrl: process.env.APP_URL || "https://iwc.galaxyproject.org",
31+
},
32+
},
33+
2634
compatibilityDate: "2025-03-03",
2735
});

website/pages/about.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,30 @@
129129
</template>
130130

131131
<script setup lang="ts">
132+
import { ref } from "vue";
133+
import { useSeoMeta, useRuntimeConfig } from "#imports";
134+
135+
// Get the public runtime config to access the app URL
136+
const config = useRuntimeConfig().public;
137+
const baseUrl = config.appUrl || (process.client ? window.location.origin : "https://workflows.galaxyproject.org");
138+
139+
// Add SEO meta tags using the useSeoMeta composable
140+
useSeoMeta({
141+
title: "About the Galaxy Workflows Library",
142+
description:
143+
"Learn about the IWC curated collection of peer-reviewed, ready-to-use Galaxy workflows for scientific analysis",
144+
ogTitle: "About the Galaxy Workflows Library",
145+
ogDescription:
146+
"Discover a curated collection of ready-to-use, peer-reviewed Galaxy workflows for scientific analysis",
147+
ogImage: `${baseUrl}/iwc_logo.png`,
148+
ogType: "website",
149+
twitterCard: "summary",
150+
twitterTitle: "About the Galaxy Workflows Library",
151+
twitterDescription:
152+
"Discover a curated collection of ready-to-use, peer-reviewed Galaxy workflows for scientific analysis",
153+
twitterImage: `${baseUrl}/iwc_logo.png`,
154+
});
155+
132156
const features = [
133157
{
134158
icon: "uil:check-circle",

website/pages/index.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,31 @@
22
import { ref, computed, onMounted, watch } from "vue";
33
import { type Workflow } from "~/models/workflow";
44
import { useWorkflowStore } from "~/stores/workflows";
5+
import { useSeoMeta, useRuntimeConfig } from "#imports";
56
67
import MarkdownRenderer from "~/components/MarkdownRenderer.vue";
78
89
import Fuse from "fuse.js";
910
11+
// Get the public runtime config to access the app URL
12+
const config = useRuntimeConfig().public;
13+
const baseUrl = config.appUrl || (process.client ? window.location.origin : "https://iwc.galaxyproject.org");
14+
15+
// Add SEO meta tags using the specialized useSeoMeta composable
16+
useSeoMeta({
17+
title: "Intergalactic Workflow Commission",
18+
description:
19+
"Ready-to-use, open-source pipelines with sample data and training materials to make progress quickly and reliably",
20+
ogTitle: "Intergalactic Workflow Commission",
21+
ogDescription: "Discover and run vetted analysis pipelines on Galaxy",
22+
ogImage: `${baseUrl}/iwc_logo.png`,
23+
ogType: "website",
24+
twitterCard: "summary",
25+
twitterTitle: "Intergalactic Workflow Commission",
26+
twitterDescription: "Discover and run vetted analysis pipelines on Galaxy",
27+
twitterImage: `${baseUrl}/iwc_logo.png`,
28+
});
29+
1030
const categoryDescription = ref<string | null>(null);
1131
const selectedCategory = ref<string | null>(null);
1232
const isLoading = ref(false);

website/pages/workflow/[id].vue

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { ref, computed, onBeforeMount, onMounted, onUnmounted, nextTick, watch } from "vue";
33
import { useRoute } from "vue-router";
4+
import { useSeoMeta, useRuntimeConfig } from "#imports";
45
import MarkdownRenderer from "~/components/MarkdownRenderer.vue";
56
import Author from "~/components/Author.vue";
67
import { useWorkflowStore } from "~/stores/workflows";
@@ -12,6 +13,39 @@ const appConfig = useAppConfig();
1213
const workflowStore = useWorkflowStore();
1314
const 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+
1549
const selectedInstance = ref("");
1650
1751
const 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
76106
interface 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

Comments
 (0)