Skip to content

Commit ab34fce

Browse files
committed
feat: added policies route
1 parent af9d798 commit ab34fce

File tree

11 files changed

+530
-368
lines changed

11 files changed

+530
-368
lines changed

app/pages/docs/[...slug].vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const date = computed(() => {
3939
timeZoneName: 'short'
4040
})
4141
42-
return `Updated at ${_timeString} (${_dateString})`
42+
return `${_timeString} (${_dateString})`
4343
})
4444
4545
useSeoMeta({
@@ -49,7 +49,7 @@ useSeoMeta({
4949
ogDescription: description
5050
})
5151
52-
defineOgImageComponent('Saas')
52+
// defineOgImageComponent('Saas')
5353
5454
onMounted(() => {
5555
timeZone.value = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'

app/pages/policies/[name].vue

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<script setup lang="ts">
2+
const route = useRoute()
3+
const { data: page } = await useAsyncData(`page-${route.path}`, () => queryCollection('policies').path(route.path).first())
4+
5+
if (!page.value) {
6+
throw createError({ statusCode: 404, statusMessage: 'Page not found.', fatal: true })
7+
}
8+
9+
const title = page.value.seo?.title || page.value.title
10+
const description = page.value.seo?.description || page.value.description
11+
const timeZone = ref()
12+
13+
const headline = computed(() => {
14+
if (!page.value?.date || !timeZone.value) {
15+
return undefined
16+
}
17+
18+
const _date = new Date(page.value?.date)
19+
const _dateString = _date.toLocaleDateString('en-US', {
20+
year: 'numeric',
21+
month: '2-digit',
22+
day: '2-digit',
23+
timeZone: timeZone.value
24+
})
25+
const _timeString = _date.toLocaleTimeString('en-US', {
26+
hour: '2-digit',
27+
minute: '2-digit',
28+
timeZone: timeZone.value,
29+
timeZoneName: 'short'
30+
})
31+
32+
return `${_timeString} (${_dateString})`
33+
})
34+
35+
useSeoMeta({
36+
title,
37+
ogTitle: title,
38+
description,
39+
ogDescription: description
40+
})
41+
42+
// defineOgImageComponent('Saas')
43+
44+
// if (page.value.image?.src) {
45+
// defineOgImage({
46+
// url: page.value.image.src
47+
// })
48+
// } else {
49+
// defineOgImageComponent('myOgImage', {
50+
// headline: 'Blog'
51+
// })
52+
// }
53+
54+
onMounted(() => {
55+
timeZone.value = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
56+
})
57+
</script>
58+
59+
<template>
60+
<UContainer>
61+
<UPageHeader
62+
:title="page?.title"
63+
:headline="headline"
64+
/>
65+
66+
<ContentRenderer
67+
v-if="page"
68+
:value="page"
69+
/>
70+
</UContainer>
71+
</template>

app/pages/privacy-policy.vue

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/pages/terms-of-service.vue

Lines changed: 0 additions & 9 deletions
This file was deleted.

bun.lock

Lines changed: 431 additions & 343 deletions
Large diffs are not rendered by default.

content.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ const collections = {
181181
date: z.date(),
182182
badge: z.object({ label: z.string().nonempty() })
183183
})
184+
}),
185+
policies: defineCollection({
186+
type: 'page',
187+
source: 'policies/*.md',
188+
schema: z.object({
189+
date: z.string()
190+
})
184191
})
185192
}
186193

content/4.blog/1.getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Our New Website
3-
description: "We are excited to announce the launch of our new website, designed to enhance your experience and provide better access to our resources."
3+
description: We are excited to announce the launch of our new website, designed to enhance your experience and provide better access to our resources.
44
image:
55
src: /assets/images/blog/website-example.png
66
date: 2025-06-15

content/app.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ footer:
4646
copyright: Copyright © 2025 ProjectM Visualizer. All rights reserved.
4747
links:
4848
- label: Privacy Policy
49-
to: /privacy-policy
49+
to: /policies/privacy-policy
5050
target: _blank
51-
- label: Terms of Service
52-
to: /terms-of-service
51+
- label: Imprint
52+
to: /policies/imprint
5353
target: _blank
5454
socialButtons:
5555
- ariaLabel: Youtube

content/policies/imprint.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Imprint
3+
description: This is the imprint page for our website, providing legal information and contact details.
4+
date: 2025-10-17
5+
---
6+
7+
## Imprint

content/policies/privacy-policy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Privacy Policy
3+
description: This is the privacy policy page for our website, outlining how we handle user data and privacy.
4+
date: 2025-10-17
5+
---
6+
7+
## Privacy Policy

0 commit comments

Comments
 (0)