Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve page metadata #23

Merged
merged 3 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
</template>

<script setup lang="ts">
useSeoMeta({
title: 'Manjaro – The Linux for People and Organizations',
useHead({
titleTemplate: '%s – Manjaro',
})
useServerSeoMeta({
ogTitle: 'Manjaro Linux Official',
description: 'This page provides an overview of Manjaro Linux, an open source operating system designed for ease of use. Learn about its features, installation, and support options. Get the most out of Manjaro Linux with the latest news, downloads, and tips from our helpful community.',
ogImage: 'https://manjaro.org/meta-image.jpg',
Expand Down
6 changes: 5 additions & 1 deletion pages/contribute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

<script setup lang="ts">
useHead({
title: 'Contribute' + ' – manjaro.org',
title: 'Contribute',
})
useServerSeoMeta({
ogTitle: 'Contribute to Manjaro',
description: 'Learn ways how you can help the Manjaro Linux project.',
})

const route = useRoute()
Expand Down
6 changes: 5 additions & 1 deletion pages/donate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
import { ref } from 'vue'

useHead({
title: 'Donate' + ' – manjaro.org',
title: 'Donate',
})
useServerSeoMeta({
ogTitle: 'Donate to Manjaro',
description: 'Help the Manjaro project with a financial contribution.',
})

const arch = defineModel({ type: String, default: 'x86' })
Expand Down
6 changes: 5 additions & 1 deletion pages/dpp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@

<script setup lang="ts">
useHead({
title: 'Device Partner Program' + ' – manjaro.org',
title: 'Device Partner Program',
})
useServerSeoMeta({
ogTitle: 'Manjaro Device Partner Program',
description: 'Design and market your hardware device together with Manjaro.',
})
</script>
14 changes: 9 additions & 5 deletions pages/enterprise.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</div>
<div class="flex flex-col justify-center md:pr-8 xl:pr-0 lg:max-w-lg">
<div class="max-w-xl">
<p class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase rounded-full bg-teal-accent-400">
<p class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase">
We Make It Work
</p>
<h2 class="text-2xl font-medium mb-4">
Expand All @@ -122,7 +122,7 @@
<div class="bg-slate-100 dark:bg-slate-900">
<div class="px-4 py-8 lg:py-12 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24 lg:px-8">
<div class="max-w-xl mb-10 md:mx-auto sm:text-center lg:max-w-2xl md:mb-12">
<p class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase rounded-full bg-teal-accent-400">
<p class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase">
Our Solutions
</p>
<h2 class="text-2xl font-medium mb-4">
Expand Down Expand Up @@ -243,7 +243,7 @@
class="px-4 pb-10 mx-auto sm:max-w-xl md:max-w-full lg:max-w-screen-xl md:px-24"
>
<div class="max-w-xl mb-6 md:mx-auto sm:text-center lg:max-w-2xl">
<p class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase rounded-full bg-teal-accent-400">
<p class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase">
Contact Us
</p>
<h2 class="text-2xl font-medium">
Expand All @@ -263,7 +263,7 @@
</div>
<div class="px-6 py-8 border border-t-0 dark:border-gray-700 rounded-b sm:px-8">
<p class="mb-5">
Reach out to discuss your needs and how we can help your buisness to make effective use of Manjaro Linux and other open-source software.
Reach out to discuss your needs and how we can help your business to make effective use of Manjaro Linux and other open-source software.
</p>
<div class="flex justify-center gap-4">
<button
Expand Down Expand Up @@ -296,6 +296,10 @@

<script setup lang="ts">
useHead({
title: 'Enterprise Services' + ' – manjaro.org',
title: 'Enterprise Services',
})
useServerSeoMeta({
ogTitle: 'Manjaro Enterprise Services',
description: 'The Manjaro company supports businesses with the setup and management of their Manjaro Linux systems.',
})
</script>
8 changes: 6 additions & 2 deletions pages/help.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<section class="body-font">
<div class="px-4 pt-8 mx-auto md:max-w-full lg:max-w-screen-xl">
<div class="flex flex-col text-center w-full mb-12">
<h2 class="text-xs text-primary tracking-widest font-medium title-font mb-1">
<h2 class="inline-block px-3 py-px mb-4 text-xs font-semibold tracking-wider text-primary uppercase">
Help Resources
</h2>
<h1 class="text-3xl font-medium title-font mb-4">
Expand Down Expand Up @@ -146,6 +146,10 @@

<script setup lang="ts">
useHead({
title: 'Help' + ' – manjaro.org',
title: 'Help',
})
useServerSeoMeta({
ogTitle: 'Manjaro Help Resources',
description: 'Get help for your Manjaro install through various free resources.',
})
</script>
2 changes: 1 addition & 1 deletion pages/imprint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script setup lang="ts">
useHead({
title: 'Imprint' + ' – manjaro.org',
title: 'Imprint',
})

const route = useRoute()
Expand Down
7 changes: 7 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,10 @@
</div>
</div>
</template>

<script setup lang="ts">
useHead({
title: 'Manjaro – The Linux for People and Organizations',
titleTemplate: '',
})
</script>
2 changes: 1 addition & 1 deletion pages/mailing-lists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@

<script setup lang="ts">
useHead({
title: 'Mailing Lists' + ' – manjaro.org',
title: 'Mailing Lists',
})
</script>
10 changes: 9 additions & 1 deletion pages/news/[year]/[title].vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,19 @@ if (!data.value) {
throw createError({ statusCode: 404, statusMessage: 'Page Not Found', fatal: true })
}

const imgPath = route.path + '/' + data.value.image
const imgPath = route.path.replace(/\/$/, '') + '/' + data.value.image
const author = getAuthors(data.value.authors)[0]
const authorPicture = getAuthorPicture(data.value.authors[0])

useHead({
title: data.value.title + ' | Manjaro News',
titleTemplate: '',
})
useServerSeoMeta({
ogTitle: data.value.title,
description: data.value.description,
ogImage: 'https://manjaro.org' + imgPath,
twitterCard: 'summary_large_image',
twitterImage: 'https://manjaro.org' + imgPath,
})
</script>
23 changes: 6 additions & 17 deletions pages/news/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,20 @@
import { useTimeAgo } from '@vueuse/core'

useHead({
title: 'News' + ' – manjaro.org',
title: 'News',
})
useServerSeoMeta({
ogTitle: 'Manjaro News',
description: 'Articles about development and organization of the Manjaro project.',
})

const getImagePath = (path: string, file: string) => {
return path + '/' + file
}

const props = defineProps({ pageNumber: { type: Number, required: true } })
const postsPerPage = 10

const allPostsCountResponse = await useAsyncData('news-items-all',
() => queryContent('/news').count())

const allPostsCount = allPostsCountResponse.data.value!
const totalPages = Math.ceil(allPostsCount / postsPerPage)

if (props.pageNumber < 1 || props.pageNumber > totalPages) {
showError({ statusCode: 404, statusMessage: 'Page Not Found', fatal: true })
}

const { data } = await useAsyncData(`news-items-list-${props.pageNumber}`, () =>
const { data } = await useAsyncData('news-items-list', () =>
queryContent('/news')
.sort({ date: -1 })
.skip((props.pageNumber - 1) * postsPerPage)
.limit(postsPerPage)
.find(),
)
</script>
6 changes: 5 additions & 1 deletion pages/partners.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@

<script setup lang="ts">
useHead({
title: 'Partners' + ' – manjaro.org',
title: 'Partners',
})
useServerSeoMeta({
ogTitle: 'Manjaro Partners',
description: 'Esteemed companies that partnered up and support the Manjaro project.',
})
</script>
2 changes: 1 addition & 1 deletion pages/privacy-policy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script setup lang="ts">
useHead({
title: 'Privacy Policy' + ' – manjaro.org',
title: 'Privacy Policy',
})

const route = useRoute()
Expand Down
6 changes: 5 additions & 1 deletion pages/products/download/arm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@
import desktops from '~/assets/desktops.json'

useHead({
title: 'Download ARM' + ' – manjaro.org',
title: 'Download ARM',
})
useServerSeoMeta({
ogTitle: 'Manjaro ARM Image Downloads',
description: 'Choose from major Linux Desktop environments to run Manjaro on a multitude of ARM devices.',
})

const { data } = await useFetch('https://gitlab.manjaro.org/api/v4/projects/12597/repository/files/file-info.json/raw', {
Expand Down
6 changes: 5 additions & 1 deletion pages/products/download/x86.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
import desktops from '~/assets/desktops.json'

useHead({
title: 'Download' + ' – manjaro.org',
title: 'Download X86',
})
useServerSeoMeta({
ogTitle: 'Manjaro Image Downloads',
description: 'Choose from major Linux Desktop environments to run Manjaro on your computer.',
})

const { data } = await useFetch('https://gitlab.manjaro.org/api/v4/projects/12597/repository/files/file-info.json/raw', {
Expand Down
6 changes: 5 additions & 1 deletion pages/products/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@

<script setup lang="ts">
useHead({
title: 'Products' + ' – manjaro.org',
title: 'Products',
})
useServerSeoMeta({
ogTitle: 'Get Manjaro Linux',
description: 'Buy a device with Manjaro preinstalled or download an image to install Manjaro on your current device.',
})

const { data: devices } = await useAsyncData('/products/devices',
Expand Down
6 changes: 5 additions & 1 deletion pages/team/former.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
import team from '~/assets/team/former.json'

useHead({
title: 'Former Team Members' + ' – manjaro.org',
title: 'Former Team Members',
})
useServerSeoMeta({
ogTitle: 'Former Manjaro Team Members',
description: 'A list of awesome people who were part of the Manjaro Team in the past.',
})

const sortedTeam = team.sort((a, b) => a.pos - b.pos)
Expand Down
6 changes: 5 additions & 1 deletion pages/team/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
import team from '~/assets/team/current.json'

useHead({
title: 'Team' + ' – manjaro.org',
title: 'Team',
})
useServerSeoMeta({
ogTitle: 'The Manjaro Team',
description: 'Get to know the people behind Manjaro.',
})

const sortedTeam = team.sort((a, b) => a.pos - b.pos)
Expand Down
2 changes: 1 addition & 1 deletion pages/terms-of-use.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script setup lang="ts">
useHead({
title: 'Terms of Use' + ' – manjaro.org',
title: 'Terms of Use',
})

const route = useRoute()
Expand Down