Skip to content

Commit 6fc0e2a

Browse files
committed
chore: added date to doc pages and added doc pages
1 parent e31d180 commit 6fc0e2a

File tree

13 files changed

+335
-16
lines changed

13 files changed

+335
-16
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<script>
2+
</script>
3+
4+
<script setup>
5+
import { computed } from 'vue'
6+
import { Separator, useForwardProps } from 'reka-ui'
7+
import { reactivePick } from '@vueuse/core'
8+
import { tv } from 'tailwind-variants'
9+
import { useAppConfig } from '#imports'
10+
import theme from '#build/ui/separator'
11+
12+
const props = defineProps({
13+
as: { type: null, required: false },
14+
label: { type: String, required: false },
15+
icon: { type: String, required: false },
16+
avatar: { type: Object, required: false },
17+
color: { type: null, required: false },
18+
size: { type: null, required: false },
19+
type: { type: null, required: false },
20+
orientation: { type: null, required: false, default: 'horizontal' },
21+
class: { type: null, required: false },
22+
ui: { type: null, required: false },
23+
decorative: { type: Boolean, required: false }
24+
})
25+
const slots = defineSlots()
26+
const appConfig = useAppConfig()
27+
const rootProps = useForwardProps(reactivePick(props, 'as', 'decorative', 'orientation'))
28+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.separator || {} })({
29+
color: props.color,
30+
orientation: props.orientation,
31+
size: props.size,
32+
type: props.type
33+
}))
34+
</script>
35+
36+
<template>
37+
<Separator
38+
v-bind="rootProps"
39+
:class="ui.root({ class: [props.ui?.root, props.class] })"
40+
>
41+
<div
42+
:class="[
43+
ui.border({ class: props.ui?.border }),
44+
{
45+
'max-w-2': label || icon || avatar || !!slots.default
46+
}
47+
]"
48+
/>
49+
50+
<template v-if="label || icon || avatar || !!slots.default">
51+
<div
52+
:class="ui.container({ class: props.ui?.container })"
53+
class="text-muted"
54+
>
55+
<slot>
56+
<span
57+
v-if="label"
58+
:class="ui.label({ class: props.ui?.label })"
59+
>{{ label }}</span>
60+
<UIcon
61+
v-else-if="icon"
62+
:name="icon"
63+
:class="ui.icon({ class: props.ui?.icon })"
64+
/>
65+
<UAvatar
66+
v-else-if="avatar"
67+
:size="props.ui?.avatarSize || ui.avatarSize()"
68+
v-bind="avatar"
69+
:class="ui.avatar({ class: props.ui?.avatar })"
70+
/>
71+
</slot>
72+
</div>
73+
74+
<div :class="ui.border({ class: props.ui?.border })" />
75+
</template>
76+
</Separator>
77+
</template>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<script setup lang="ts">
2+
export interface FileCardProps {
3+
icon: string
4+
name: string
5+
description: string
6+
to: string
7+
toCode: string
8+
}
9+
10+
const props = defineProps<FileCardProps>()
11+
</script>
12+
13+
<template>
14+
<div class="flex flex-1">
15+
<UPageCard
16+
variant="ghost"
17+
:to="props.to"
18+
class="flex-1"
19+
>
20+
<template #body>
21+
<UUser
22+
:name="props.name"
23+
:description="props.description"
24+
size="xl"
25+
class="gap-4"
26+
>
27+
<template #avatar>
28+
<UIcon
29+
:name="props.icon"
30+
class="size-6"
31+
/>
32+
</template>
33+
</UUser>
34+
</template>
35+
</UPageCard>
36+
37+
<UButton
38+
variant="link"
39+
size="lg"
40+
:to="props.toCode"
41+
class="min-w-12 sm:min-w-16 items-center justify-center"
42+
>
43+
<UTooltip text="Open source on GitHub">
44+
<UIcon
45+
name="i-lucide-code-xml"
46+
class="size-5"
47+
/>
48+
</UTooltip>
49+
</UButton>
50+
</div>
51+
</template>

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@ const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
1818
1919
const title = page.value.seo?.title || page.value.title
2020
const description = page.value.seo?.description || page.value.description
21+
const timeZone = ref()
22+
23+
const date = computed(() => {
24+
if (!page.value?.date || !timeZone.value) {
25+
return undefined
26+
}
27+
28+
const _date = new Date(page.value?.date)
29+
const _dateString = _date.toLocaleDateString('en-US', {
30+
year: 'numeric',
31+
month: '2-digit',
32+
day: '2-digit',
33+
timeZone: timeZone.value
34+
})
35+
const _timeString = _date.toLocaleTimeString('en-US', {
36+
hour: '2-digit',
37+
minute: '2-digit',
38+
timeZone: timeZone.value,
39+
timeZoneName: 'short'
40+
})
41+
42+
return `Updated at ${_timeString} (${_dateString})`
43+
})
2144
2245
useSeoMeta({
2346
title,
@@ -27,6 +50,10 @@ useSeoMeta({
2750
})
2851
2952
defineOgImageComponent('Saas')
53+
54+
onMounted(() => {
55+
timeZone.value = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
56+
})
3057
</script>
3158

3259
<template>
@@ -42,7 +69,10 @@ defineOgImageComponent('Saas')
4269
:value="page"
4370
/>
4471

45-
<USeparator v-if="surround?.length" />
72+
<DateSeparator
73+
v-if="surround?.length"
74+
:label="date"
75+
/>
4676

4777
<UContentSurround :surround="surround" />
4878
</UPageBody>

content.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ const collections = {
127127
}),
128128
docs: defineCollection({
129129
type: 'page',
130-
source: '1.docs/**/*'
130+
source: '1.docs/**/*',
131+
schema: z.object({
132+
date: z.date()
133+
})
131134
}),
132135
download: defineCollection({
133136
type: 'page',
@@ -158,7 +161,7 @@ const collections = {
158161
blog: defineCollection({
159162
type: 'page',
160163
source: '4.blog.yml',
161-
schema: createBaseSchema().extend({
164+
schema: z.object({
162165
image: createImageSchema().optional()
163166
})
164167
}),

content/1.docs/1.user/1.index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Introduction
3-
description: Welcome to our User Guide
3+
description:
4+
date:
45
---
56

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
22
title: Installation
3-
description: Get started with the installation of our software.
3+
description:
4+
date:
45
---
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Introduction
3-
description: Welcome to our Developer Guide
3+
description:
4+
date:
45
---
56

content/1.docs/2.developer/2.installation.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: Setup
3+
description: This guide walks you through setting up your system to build and use our library on Linux, macOS, and Windows.
4+
date: 2025-09-15T15:47:46Z
5+
---
6+
7+
## Prerequisites
8+
9+
Before starting, make sure you have:
10+
11+
- Administrator or sudo access
12+
- A terminal or PowerShell environment
13+
- A C++ toolchain available for your platform
14+
15+
---
16+
17+
## Linux Setup
18+
19+
### 1. Install Required Packages
20+
21+
Open your terminal and install the following packages using your system's package manager.
22+
23+
<details>
24+
<summary><strong>Debian/Ubuntu (APT)</strong></summary>
25+
26+
```bash
27+
sudo apt update
28+
sudo apt install git cmake ninja-build pkg-config build-essential libgl1-mesa-dev mesa-common-dev libglm-dev
29+
```
30+
31+
</details>
32+
33+
<details>
34+
<summary><strong>Arch (Pacman)</strong></summary>
35+
36+
```bash
37+
sudo pacman -Syu
38+
sudo pacman -S git cmake ninja pkgconf base-devel mesa
39+
```
40+
41+
</details>
42+
43+
<details>
44+
<summary><strong>Fedora/RHEL (YUM/DNF)</strong></summary>
45+
46+
```bash
47+
sudo yum update -y
48+
sudo yum install -y git cmake ninja-build pkgconfig gcc-c++ mesa-libGL-devel mesa-libGLU-devel glm-devel
49+
```
50+
51+
</details>
52+
53+
---
54+
55+
## macOS Setup
56+
57+
### 1. Install Homebrew (if not installed)
58+
59+
```bash
60+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
61+
```
62+
63+
### 2. Install Required Packages
64+
65+
```bash
66+
brew update
67+
brew install git cmake ninja pkg-config
68+
```
69+
70+
### 3. Install Xcode Command Line Tools
71+
72+
Check if installed:
73+
74+
```bash
75+
xcode-select -p
76+
```
77+
78+
If not, install:
79+
80+
```bash
81+
xcode-select --install
82+
```
83+
84+
Also, make sure you accept the license:
85+
86+
```bash
87+
sudo xcodebuild -license accept
88+
```
89+
90+
---
91+
92+
## Windows Setup
93+
94+
### 1. Install Dependencies
95+
96+
Manually install the following:
97+
98+
- [Git for Windows](https://git-scm.com/download/win)
99+
- [CMake](https://cmake.org/download)
100+
- [Microsoft Visual Studio 2022 or newer](https://visualstudio.microsoft.com/downloads)
101+
- Include the "Desktop development with C++" workload
102+
- [Vcpkg (optional)](https://github.com/microsoft/vcpkg) — for managing C++ libraries
103+
104+
> After installation, restart PowerShell or Command Prompt to ensure dependencies are on the PATH.
105+
106+
### 2. Initialize Git Submodules
107+
108+
```powershell
109+
git submodule update --init --recursive
110+
```
111+
112+
---
113+
114+
## Verifying Installation
115+
116+
To confirm everything is ready:
117+
118+
```bash
119+
git --version
120+
cmake --version
121+
ninja --version
122+
```
123+
124+
On Windows, also confirm that Visual Studio tools like `cl.exe` or `msbuild` are available from your terminal.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Build
3+
description:
4+
date:
5+
---
6+

0 commit comments

Comments
 (0)