Skip to content

Commit a0db9c9

Browse files
Merge pull request #68 from Relaticle/feature/docs-migration
Feature/docs migration
2 parents 9b4ed76 + 4f6e3bd commit a0db9c9

33 files changed

+26068
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["3.x", "2.x", "1.x"]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/deploy-docs.yml'
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build-v3:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout 3.x
26+
uses: actions/checkout@v6
27+
with:
28+
ref: '3.x'
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v6
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
cache-dependency-path: 'docs/package.json'
36+
37+
- name: Install dependencies
38+
working-directory: ./docs
39+
run: npm ci
40+
41+
- name: Build v3 documentation
42+
working-directory: ./docs
43+
run: npm run generate
44+
env:
45+
NUXT_APP_BASE_URL: /custom-fields/
46+
NUXT_SITE_URL: https://relaticle.github.io
47+
DOCS_VERSION: v3
48+
49+
- name: Upload v3 artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: docs-v3
53+
path: ./docs/.output/public
54+
retention-days: 1
55+
56+
build-v2:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout 2.x
60+
uses: actions/checkout@v6
61+
with:
62+
ref: '2.x'
63+
64+
- name: Setup Node.js
65+
uses: actions/setup-node@v6
66+
with:
67+
node-version: '20'
68+
cache: 'npm'
69+
cache-dependency-path: 'docs/package.json'
70+
71+
- name: Install dependencies
72+
working-directory: ./docs
73+
run: npm ci
74+
75+
- name: Build v2 documentation
76+
working-directory: ./docs
77+
run: npm run generate
78+
env:
79+
NUXT_APP_BASE_URL: /custom-fields/v2/
80+
NUXT_SITE_URL: https://relaticle.github.io
81+
DOCS_VERSION: v2
82+
83+
- name: Upload v2 artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: docs-v2
87+
path: ./docs/.output/public
88+
retention-days: 1
89+
90+
build-v1:
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Checkout 1.x
94+
uses: actions/checkout@v6
95+
with:
96+
ref: '1.x'
97+
98+
- name: Setup Node.js
99+
uses: actions/setup-node@v6
100+
with:
101+
node-version: '20'
102+
cache: 'npm'
103+
cache-dependency-path: 'docs/package.json'
104+
105+
- name: Install dependencies
106+
working-directory: ./docs
107+
run: npm ci
108+
109+
- name: Build v1 documentation
110+
working-directory: ./docs
111+
run: npm run generate
112+
env:
113+
NUXT_APP_BASE_URL: /custom-fields/v1/
114+
NUXT_SITE_URL: https://relaticle.github.io
115+
DOCS_VERSION: v1
116+
117+
- name: Upload v1 artifact
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: docs-v1
121+
path: ./docs/.output/public
122+
retention-days: 1
123+
124+
merge-and-deploy:
125+
runs-on: ubuntu-latest
126+
needs: [build-v3, build-v2, build-v1]
127+
environment:
128+
name: github-pages
129+
url: ${{ steps.deployment.outputs.page_url }}
130+
steps:
131+
- name: Setup Pages
132+
uses: actions/configure-pages@v5
133+
134+
- name: Download v3 artifact
135+
uses: actions/download-artifact@v4
136+
with:
137+
name: docs-v3
138+
path: ./combined
139+
140+
- name: Download v2 artifact
141+
uses: actions/download-artifact@v4
142+
with:
143+
name: docs-v2
144+
path: ./combined/v2
145+
146+
- name: Download v1 artifact
147+
uses: actions/download-artifact@v4
148+
with:
149+
name: docs-v1
150+
path: ./combined/v1
151+
152+
- name: Add .nojekyll file
153+
run: touch ./combined/.nojekyll
154+
155+
- name: Upload combined artifact
156+
uses: actions/upload-pages-artifact@v4
157+
with:
158+
path: ./combined
159+
160+
- name: Deploy to GitHub Pages
161+
id: deployment
162+
uses: actions/deploy-pages@v4

docs/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
.eslintcache
21+
22+
# Local env files
23+
.env
24+
.env.*
25+
!.env.example
26+
27+
# npm pack
28+
*.tgz
29+
30+
# Temp files
31+
.tmp
32+
.profile
33+
*.0x
34+
35+
#VSC
36+
.history
37+
.wrangler

docs/app.config.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
export default defineAppConfig({
2+
docus: {
3+
title: 'Custom Fields',
4+
description: 'Add dynamic custom fields to your Filament admin panels without writing database migrations.',
5+
header: {
6+
logo: {
7+
alt: 'Custom Fields Logo',
8+
}
9+
}
10+
},
11+
seo: {
12+
title: 'Custom Fields',
13+
description: 'Add dynamic custom fields to your Filament admin panels without writing database migrations.',
14+
},
15+
github: {
16+
repo: 'custom-fields',
17+
owner: 'Relaticle',
18+
edit: true,
19+
rootDir: 'docs'
20+
},
21+
socials: {
22+
discord: 'https://discord.gg/b9WxzUce4Q'
23+
},
24+
ui: {
25+
colors: {
26+
primary: 'violet',
27+
neutral: 'zinc'
28+
}
29+
},
30+
uiPro: {
31+
pageHero: {
32+
slots: {
33+
container: 'flex flex-col lg:grid py-16 sm:py-20 lg:py-24 gap-16 sm:gap-y-2'
34+
}
35+
}
36+
},
37+
toc: {
38+
title: 'On this page',
39+
bottom: {
40+
title: 'Ecosystem',
41+
edit: 'https://github.com/Relaticle/custom-fields',
42+
links: [
43+
{
44+
icon: 'i-simple-icons-laravel',
45+
label: 'FilaForms',
46+
to: 'https://filaforms.app',
47+
target: '_blank'
48+
},
49+
{
50+
icon: 'i-lucide-layout-kanban',
51+
label: 'Flowforge',
52+
to: 'https://relaticle.github.io/flowforge/',
53+
target: '_blank'
54+
}
55+
]
56+
}
57+
}
58+
})

docs/components/AppHeader.vue

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
<script setup lang="ts">
2+
import { useDocusI18n } from '#imports'
3+
4+
const appConfig = useAppConfig()
5+
const site = useSiteConfig()
6+
7+
const { localePath, isEnabled, locales } = useDocusI18n()
8+
9+
const links = computed(() => appConfig.github && appConfig.github.url
10+
? [
11+
{
12+
'icon': 'i-simple-icons-github',
13+
'to': appConfig.github.url,
14+
'target': '_blank',
15+
'aria-label': 'GitHub',
16+
},
17+
]
18+
: [])
19+
20+
const currentVersion = computed(() => appConfig.versioning?.current || 'v3')
21+
const isOldVersion = computed(() => currentVersion.value !== 'v3')
22+
</script>
23+
24+
<template>
25+
<div class="sticky top-0 z-50">
26+
<!-- Version Warning Banner -->
27+
<div
28+
v-if="isOldVersion"
29+
class="bg-amber-100 dark:bg-amber-900/50 text-amber-800 dark:text-amber-200 px-4 py-2 text-center text-sm border-b border-amber-200 dark:border-amber-800"
30+
>
31+
You are viewing documentation for Custom Fields {{ currentVersion }}.
32+
<a
33+
href="/custom-fields/"
34+
class="underline font-medium hover:text-amber-900 dark:hover:text-amber-100"
35+
>
36+
View the latest version (v3) &rarr;
37+
</a>
38+
</div>
39+
40+
<!-- Original Docus Header -->
41+
<UHeader
42+
:ui="{ center: 'flex-1' }"
43+
:to="localePath('/')"
44+
:title="appConfig.header?.title || site.name"
45+
>
46+
<AppHeaderCenter />
47+
48+
<template #title>
49+
<AppHeaderLogo class="h-6 w-auto shrink-0" />
50+
</template>
51+
52+
<template #right>
53+
<AppVersionSwitcher />
54+
<AppHeaderCTA />
55+
56+
<template v-if="isEnabled && locales.length > 1">
57+
<ClientOnly>
58+
<LanguageSelect />
59+
60+
<template #fallback>
61+
<div class="h-8 w-8 animate-pulse bg-neutral-200 dark:bg-neutral-800 rounded-md" />
62+
</template>
63+
</ClientOnly>
64+
65+
<USeparator
66+
orientation="vertical"
67+
class="h-8"
68+
/>
69+
</template>
70+
71+
<UContentSearchButton class="lg:hidden" />
72+
73+
<ClientOnly>
74+
<UColorModeButton />
75+
76+
<template #fallback>
77+
<div class="h-8 w-8 animate-pulse bg-neutral-200 dark:bg-neutral-800 rounded-md" />
78+
</template>
79+
</ClientOnly>
80+
81+
<template v-if="links?.length">
82+
<UButton
83+
v-for="(link, index) of links"
84+
:key="index"
85+
v-bind="{ color: 'neutral', variant: 'ghost', ...link }"
86+
/>
87+
</template>
88+
</template>
89+
90+
<template #toggle="{ open, toggle }">
91+
<IconMenuToggle
92+
:open="open"
93+
class="lg:hidden"
94+
@click="toggle"
95+
/>
96+
</template>
97+
98+
<template #body>
99+
<AppHeaderBody />
100+
</template>
101+
</UHeader>
102+
</div>
103+
</template>

docs/components/AppHeaderLogo.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script setup lang="ts">
2+
const appConfig = useAppConfig()
3+
</script>
4+
5+
<template>
6+
<UColorModeImage
7+
v-if="appConfig.docus?.header?.logo?.dark || appConfig.docus?.header?.logo?.light"
8+
:light="appConfig.docus?.header?.logo?.light || appConfig.docus?.header?.logo?.dark"
9+
:dark="appConfig.docus?.header?.logo?.dark || appConfig.docus?.header?.logo?.light"
10+
:alt="appConfig.docus?.header?.logo?.alt || appConfig.docus?.title"
11+
class="h-8 w-auto shrink-0"
12+
/>
13+
<span v-else class="text-lg font-semibold">
14+
{{ appConfig.docus?.title || 'Custom Fields' }}
15+
</span>
16+
</template>

0 commit comments

Comments
 (0)