Skip to content

Commit b64e514

Browse files
authored
feat: update metadata (#740)
Signed-off-by: Gašper Grom <[email protected]>
1 parent 76fb743 commit b64e514

File tree

21 files changed

+181
-64
lines changed

21 files changed

+181
-64
lines changed

frontend/app/pages/collection/[slug].vue

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,32 @@ onServerPrefetch(async () => {
5050
}
5151
})
5252
53-
const title = computed(() => `${data.value?.name || 'Collection'} | LFX Insights`);
54-
const description = computed(() => `${data.value?.description || ''}`);
53+
const title = computed(() => `${data.value?.name || 'Collection'} Insights`);
54+
55+
// Truncate description to first 1-2 sentences, keeping it under 160 characters
56+
const description = computed(() => {
57+
const desc = data.value?.description || '';
58+
if (!desc) return '';
59+
60+
// Split by sentence endings (. ! ?)
61+
const sentences = desc.match(/[^.!?]+[.!?]+/g) || [desc];
62+
63+
// Try first sentence
64+
if (sentences[0] && sentences[0].trim().length <= 160) {
65+
return sentences[0].trim();
66+
}
67+
68+
// Try first two sentences
69+
if (sentences.length > 1) {
70+
const twoSentences = (sentences[0] + ' ' + sentences[1]).trim();
71+
if (twoSentences.length <= 160) {
72+
return twoSentences;
73+
}
74+
}
75+
76+
// Fallback: truncate to 157 chars and add ellipsis
77+
return desc.substring(0, 157).trim() + '...';
78+
});
5579
5680
useSeoMeta({
5781
title,

frontend/app/pages/collection/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ SPDX-License-Identifier: MIT
1010
import LfxCollectionListView from "~/components/modules/collection/views/collection-list.vue";
1111
1212
const title = 'Collections | LFX Insights';
13-
const description = 'Explore a curated list of collections to gain valuable insights'
14-
+ ' and stay informed with the latest trends and data on LFX Insights.';
13+
const description = 'Explore curated collections of open source projects on LFX Insights. '
14+
+ 'Discover projects grouped by technology, ecosystem, and community.';
1515
1616
useSeoMeta({
1717
title,

frontend/app/pages/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ SPDX-License-Identifier: MIT
99
<script setup lang="ts">
1010
import LfxExplore from '~/components/modules/explore/views/explore.vue';
1111
12-
const title = 'Explore | LFX Insights';
13-
const description = `Discover the world'smost critical open source projects.`;
12+
const title = 'LFX Insights';
13+
const description = 'Insights into the world\'s most critical open source software. By the Linux Foundation.';
1414
1515
useSeoMeta({
1616
title,
1717
description,
1818
ogTitle: title,
19+
ogDescription: description,
20+
twitterTitle: title,
1921
twitterDescription: description
2022
})
2123
</script>

frontend/app/pages/open-source-index/category/[slug].vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,33 @@ SPDX-License-Identifier: MIT
77
</template>
88

99
<script setup lang="ts">
10+
import {computed, onServerPrefetch, ref} from 'vue';
11+
import {useRoute} from 'vue-router';
1012
import LfxOpenSourceIndexCategory from "~/components/modules/open-source-index/views/open-source-index-category.vue";
13+
import {OSS_INDEX_API_SERVICE, type SortType} from "~/components/modules/open-source-index/services/osi.api.service";
14+
15+
const route = useRoute();
16+
const slug = ref<string>(route.params.slug as string || '');
17+
const sort = ref<SortType>(route.query.sort as SortType || 'totalContributors');
18+
19+
const {data, suspense} = OSS_INDEX_API_SERVICE.fetchOSSCollection(slug.value, sort);
20+
21+
onServerPrefetch(async () => {
22+
await suspense();
23+
});
24+
25+
const title = computed(() => `${data.value?.name || 'Projects'} Projects | LFX Insights`);
26+
const description = computed(() =>
27+
`View open source projects in the ${data.value?.name || ''} category on LFX Insights. `
28+
+ `Compare contributor counts, growth trends, and development health across leading projects.`
29+
);
30+
31+
useSeoMeta({
32+
title,
33+
description,
34+
ogTitle: title,
35+
ogDescription: description,
36+
twitterTitle: title,
37+
twitterDescription: description
38+
});
1139
</script>

frontend/app/pages/open-source-index/group/[slug].vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,33 @@ SPDX-License-Identifier: MIT
77
</template>
88

99
<script setup lang="ts">
10+
import {computed, onServerPrefetch, ref} from 'vue';
11+
import {useRoute} from 'vue-router';
1012
import LfxOpenSourceIndexGroup from "~/components/modules/open-source-index/views/open-source-index-group.vue";
13+
import {OSS_INDEX_API_SERVICE, type SortType} from "~/components/modules/open-source-index/services/osi.api.service";
14+
15+
const route = useRoute();
16+
const slug = ref<string>(route.params.slug as string || '');
17+
const sort = ref<SortType>(route.query.sort as SortType || 'totalContributors');
18+
19+
const {data, suspense} = OSS_INDEX_API_SERVICE.fetchOSSCategory(slug.value, sort);
20+
21+
onServerPrefetch(async () => {
22+
await suspense();
23+
});
24+
25+
const title = computed(() => `${data.value?.name || 'Category'} | Open Source Index`);
26+
const description = computed(() =>
27+
'Browse open source project groups in the Linux Foundation Open Source Index. '
28+
+ 'See how categories like developer tools, frameworks, and platforms rank by contributors and activity.'
29+
);
30+
31+
useSeoMeta({
32+
title,
33+
description,
34+
ogTitle: title,
35+
ogDescription: description,
36+
twitterTitle: title,
37+
twitterDescription: description
38+
});
1139
</script>

frontend/app/pages/open-source-index/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ SPDX-License-Identifier: MIT
99
<script setup lang="ts">
1010
import LfxOpenSourceIndex from '~/components/modules/open-source-index/views/open-source-index.vue';
1111
12-
const title = 'Open Source Index | LFX Insights';
13-
const description = `Curated list of the most critical open source projects powering our modern
14-
digital infrastructure, measured by contributor volume and software value`;
12+
const title = 'Open Source Index | by Linux Foundation';
13+
const description = 'Explore the Linux Foundation Open Source Index on LFX Insights. '
14+
+ 'Compare thousands of open source projects by contributors, software value, and category.';
1515
1616
useSeoMeta({
1717
title,

frontend/app/pages/project/[slug]/contributors.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ const widget = route.query?.widget
2424
const title = computed(() => {
2525
const widgetName = widget && lfxWidgets[widget as Widget]?.name?.length
2626
? lfxWidgets[widget as Widget]?.name
27-
: 'contributor insights';
28-
return `LFX Insights | ${project.value?.name} ${widgetName}`;
27+
: 'Contributors Insights';
28+
return widget ? `${project.value?.name} ${widgetName}` : `${project.value?.name} Contributors Insights`;
2929
});
3030
const imageAlt = computed(() => {
3131
const widgetName = widget && lfxWidgets[widget as Widget]?.name?.length
3232
? lfxWidgets[widget as Widget]?.name
3333
: '';
3434
return `${project.value?.name} contributor insights${widgetName ? ` - ${widgetName}` : ''}`;
3535
});
36-
const description = computed(() => `Explore ${project.value?.name} contributor insights`);
36+
const description = computed(() =>
37+
`See who contributes to ${project.value?.name}, `
38+
+ `with insights on maintainers, top contributors, and organizations in open source.`);
3739
const url = computed(() => `${config.public.appUrl}${route.fullPath}`);
3840
const image = computed(() => (project.value
3941
? `${config.public.appUrl}/api/seo/og-image?projectSlug=${project.value.slug}`

frontend/app/pages/project/[slug]/development.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@ const config = useRuntimeConfig()
2222
2323
const widget = route.query?.widget
2424
25-
const title = computed(() => `LFX Insights | ${project.value?.name} ${
26-
(widget && lfxWidgets[widget as Widget]?.name?.length)
27-
? lfxWidgets[widget as Widget]?.name
28-
: 'development insights'}`);
25+
const title = computed(() => {
26+
const widgetName = widget && lfxWidgets[widget as Widget]?.name?.length
27+
? lfxWidgets[widget as Widget]?.name
28+
: 'Development Insights';
29+
return widget ? `${project.value?.name} ${widgetName}` : `${project.value?.name} Development Insights`;
30+
});
2931
const imageAlt = computed(() => `${project.value?.name} development insights${
3032
(widget && lfxWidgets[widget as Widget]?.name?.length)
3133
? ` - ${lfxWidgets[widget as Widget]?.name}`
3234
: ''}`);
33-
const description = computed(() => `Explore ${project.value?.name} development insights`);
35+
const description = computed(() =>
36+
`Track ${project.value?.name} development activity, `
37+
+ `including commits, releases, pull requests, and issues over time.`);
3438
const url = computed(() => `${config.public.appUrl}${route.fullPath}`);
3539
const image = computed(() => (project.value
3640
? `${config.public.appUrl}/api/seo/og-image?projectSlug=${project.value.slug}`

frontend/app/pages/project/[slug]/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ const route = useRoute();
1616
const {project} = storeToRefs(useProjectStore());
1717
const config = useRuntimeConfig()
1818
19-
const title = computed(() => (project.value ? `LFX Insights | ${project.value.name} insights` : "LFX Insights"));
19+
const title = computed(() => (project.value ? `${project.value.name} Insights` : "LFX Insights"));
2020
const imageAlt = computed(() => (project.value ? `${project.value.name} insights` : "LFX Project insights"));
2121
const description = computed(() => (project.value
22-
? `Explore ${project.value.name} insights`
22+
? project.value.description || `Explore ${project.value.name} insights`
2323
: "Explore LFX Project insights"));
2424
const url = computed(() => `${config.public.appUrl}${route.fullPath}`);
2525
const image = computed(() => (project.value

frontend/app/pages/project/[slug]/popularity.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ const widget = route.query?.widget
2424
const title = computed(() => {
2525
const widgetName = widget && lfxWidgets[widget as Widget]?.name?.length
2626
? lfxWidgets[widget as Widget]?.name
27-
: 'popularity insights';
28-
return `LFX Insights | ${project.value?.name} ${widgetName}`;
27+
: 'Popularity Insights';
28+
return widget ? `${project.value?.name} ${widgetName}` : `${project.value?.name} Popularity Insights`;
2929
});
3030
const imageAlt = computed(() => {
3131
const widgetName = widget && lfxWidgets[widget as Widget]?.name?.length
3232
? lfxWidgets[widget as Widget]?.name
3333
: '';
3434
return `${project.value?.name} popularity insights${widgetName ? ` - ${widgetName}` : ''}`;
3535
});
36-
const description = computed(() => `Explore ${project.value?.name} popularity insights`);
36+
const description = computed(() =>
37+
`Explore ${project.value?.name} popularity with data on stars, forks, watchers, `
38+
+ `and adoption across the open source ecosystem.`);
3739
const url = computed(() => `${config.public.appUrl}${route.fullPath}`);
3840
const image = computed(() => (project.value
3941
? `${config.public.appUrl}/api/seo/og-image?projectSlug=${project.value.slug}`

0 commit comments

Comments
 (0)