Skip to content

Commit

Permalink
docs: migrate nuxt ui pro (wattanx#34)
Browse files Browse the repository at this point in the history
* docs: migrate nuxt ui pro

* docs: add search
  • Loading branch information
wattanx authored Jan 13, 2024
1 parent 32da4d3 commit 2d4ab8f
Show file tree
Hide file tree
Showing 27 changed files with 3,942 additions and 4,380 deletions.
1 change: 1 addition & 0 deletions docs/.nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports.autoImport=true
79 changes: 55 additions & 24 deletions docs/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,61 @@
import { version as pkgVersion } from "../package.json";

export default defineAppConfig({
docus: {
title: "Nuxt Panda CSS",
description: "Panda CSS module for Nuxt.",
socials: {
github: "wattanx/nuxt-pandacss",
ui: {
primary: "green",
gray: "slate",
footer: {
bottom: {
left: "text-sm text-gray-500 dark:text-gray-400",
wrapper: "border-t border-gray-200 dark:border-gray-800",
},
},
github: {
branch: "main",
repo: "wattanx/nuxt-pandacss",
owner: "wattanx",
edit: true,
},
aside: {
level: 0,
collapsed: false,
exclude: [],
},
main: {
padded: true,
fluid: true,
},
seo: {
siteName: "Nuxt PandaCSS",
},
header: {
logo: {
alt: "",
light: "",
dark: "",
},
header: {
logo: true,
showLinkIcon: true,
exclude: [],
fluid: true,
pkgVersion,
search: true,
colorMode: true,
links: [
{
icon: "i-simple-icons-github",
to: "https://github.com/wattanx/nuxt-pandacss",
target: "_blank",
"aria-label": "Docs template on GitHub",
},
],
},
footer: {
credits: "Copyright © 2023",
colorMode: false,
links: [
{
icon: "i-simple-icons-nuxtdotjs",
to: "https://nuxt.com",
target: "_blank",
"aria-label": "Nuxt Website",
},
],
},
toc: {
title: "Table of Contents",
bottom: {
title: "Community",
links: [
{
icon: "i-heroicons-star",
label: "Star on GitHub",
to: "https://github.com/wattanx/nuxt-pandacss",
target: "_blank",
},
],
},
},
});
48 changes: 48 additions & 0 deletions docs/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<script setup lang="ts">
import type { ParsedContent } from "@nuxt/content/dist/runtime/types";
const { seo } = useAppConfig();
const { data: navigation } = await useAsyncData("navigation", () =>
fetchContentNavigation()
);
const { data: files } = useLazyFetch<ParsedContent[]>("/api/search.json", {
default: () => [],
server: false,
});
useHead({
meta: [{ name: "viewport", content: "width=device-width, initial-scale=1" }],
link: [{ rel: "icon", href: "/favicon.ico" }],
htmlAttrs: {
lang: "en",
},
});
useSeoMeta({
ogSiteName: seo?.siteName,
twitterCard: "summary_large_image",
});
provide("navigation", navigation);
</script>

<template>
<div>
<Header />

<UMain>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</UMain>

<Footer />

<ClientOnly>
<LazyUDocsSearch :files="files" :navigation="navigation" />
</ClientOnly>

<UNotifications />
</div>
</template>
23 changes: 23 additions & 0 deletions docs/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
const { footer } = useAppConfig();
</script>

<template>
<UFooter>
<template #left>
{{ footer.credits }}
</template>

<template #right>
<UColorModeButton v-if="footer?.colorMode" />
<template v-if="footer?.links">
<UButton
v-for="(link, index) of footer?.links"
:key="index"
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
/>
</template>
</template>
</UFooter>
</template>
42 changes: 42 additions & 0 deletions docs/components/Header.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script setup lang="ts">
import type { NavItem } from "@nuxt/content/dist/runtime/types";
const navigation = inject<NavItem[]>("navigation", []);
const { header } = useAppConfig();
</script>

<template>
<UHeader>
<template #logo>
<Logo class="h-6" />
<span class="text-xs font-thin">v{{ header.pkgVersion }}</span>
</template>

<template v-if="header?.search" #center>
<UDocsSearchButton class="hidden lg:flex" />
</template>

<template #right>
<UDocsSearchButton
v-if="header?.search"
:label="null"
class="lg:hidden"
/>

<UColorModeButton v-if="header?.colorMode" />
<template v-if="header?.links">
<UButton
v-for="(link, index) of header.links"
:key="index"
v-bind="{ color: 'gray', variant: 'ghost', ...link }"
/>
</template>
</template>
<template #panel>
<UNavigationTree :links="mapContentNavigation(navigation)" />
</template>
</UHeader>
</template>
28 changes: 28 additions & 0 deletions docs/components/Logo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<svg viewBox="0 0 1565 201" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z"
fill="currentColor"
/>
<path
d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z"
fill="currentColor"
/>
<path
d="M591 91.9998V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V91.9998H514C517.412 91.9998 520.769 92.6218 523 94.9998C525.231 97.2457 526 98.565 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.565 563.769 96.3778 566 93.9998C567.96 91.9105 570.028 91.9597 573 91.9998C573.411 92.0053 574.586 91.9998 575 91.9998H591Z"
fill="currentColor"
/>
<path
d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z"
fill="currentColor"
/>
<path
d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2.00001 170.001C0.226985 173.04 0.00154882 176.488 7.60805e-06 179.999C-0.0015336 183.51 0.229654 186.959 2.00001 190C3.77036 193.04 6.93246 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z"
fill="#00DC82"
/>
<path
d="M840 199.23V61H894.534C905.021 61 913.952 63.0023 921.332 67.0072C928.71 70.9668 934.334 76.479 938.205 83.5435C942.12 90.5627 944.077 98.6621 944.077 107.842C944.077 117.021 942.096 125.12 938.139 132.14C934.178 139.159 928.44 144.626 920.925 148.541C913.457 152.456 904.412 154.413 893.794 154.413H859.034V130.992H889.069C894.693 130.992 899.328 130.025 902.973 128.09C906.661 126.11 909.407 123.388 911.206 119.923C913.052 116.413 913.976 112.386 913.976 107.842C913.976 103.252 913.052 99.2473 911.206 95.8273C909.407 92.3626 906.661 89.6852 902.973 87.7953C899.283 85.8605 894.603 84.8931 888.934 84.8931H869.226V199.23H840ZM989.297 201.187C982.684 201.187 976.79 200.04 971.616 197.745C966.442 195.405 962.346 191.963 959.331 187.418C956.36 182.828 954.876 177.114 954.876 170.274C954.876 164.515 955.934 159.678 958.048 155.763C960.164 151.848 963.042 148.698 966.687 146.314C970.333 143.929 974.473 142.129 979.108 140.914C983.787 139.699 988.692 138.844 993.821 138.349C999.85 137.719 1004.71 137.134 1008.4 136.594C1012.09 136.009 1014.77 135.154 1016.43 134.03C1018.1 132.904 1018.93 131.24 1018.93 129.035V128.63C1018.93 124.355 1017.58 121.048 1014.88 118.708C1012.23 116.368 1008.44 115.198 1003.54 115.198C998.366 115.198 994.247 116.346 991.189 118.641C988.128 120.89 986.105 123.725 985.112 127.145L958.521 124.985C959.87 118.685 962.526 113.241 966.487 108.651C970.444 104.017 975.552 100.462 981.806 97.9872C988.107 95.4675 995.395 94.2075 1003.68 94.2075C1009.43 94.2075 1014.95 94.8823 1020.21 96.2323C1025.52 97.5822 1030.22 99.6744 1034.32 102.509C1038.46 105.344 1041.72 108.989 1044.1 113.443C1046.49 117.853 1047.68 123.14 1047.68 129.305V199.23H1020.41V184.853H1019.6C1017.94 188.093 1015.71 190.95 1012.92 193.425C1010.13 195.855 1006.78 197.767 1002.87 199.162C998.951 200.512 994.427 201.187 989.297 201.187ZM997.533 181.343C1001.76 181.343 1005.5 180.511 1008.74 178.846C1011.98 177.136 1014.52 174.841 1016.37 171.962C1018.21 169.082 1019.13 165.82 1019.13 162.175V151.173C1018.23 151.758 1016.99 152.298 1015.42 152.793C1013.89 153.243 1012.16 153.67 1010.22 154.075C1008.29 154.436 1006.35 154.773 1004.42 155.088C1002.48 155.358 1000.73 155.605 999.151 155.83C995.779 156.325 992.832 157.113 990.311 158.193C987.792 159.273 985.835 160.735 984.438 162.58C983.044 164.38 982.345 166.629 982.345 169.329C982.345 173.244 983.763 176.236 986.599 178.306C989.477 180.331 993.123 181.343 997.533 181.343ZM1098.74 139.294V199.23H1069.99V95.5575H1097.39V113.848H1098.61C1100.9 107.819 1104.75 103.049 1110.15 99.5395C1115.55 95.985 1122.09 94.2075 1129.79 94.2075C1136.99 94.2075 1143.27 95.7823 1148.62 98.9322C1153.97 102.082 1158.14 106.582 1161.11 112.431C1164.08 118.236 1165.56 125.165 1165.56 133.22V199.23H1136.81V138.349C1136.85 132.005 1135.23 127.055 1131.95 123.5C1128.66 119.901 1124.14 118.101 1118.38 118.101C1114.51 118.101 1111.09 118.933 1108.12 120.598C1105.2 122.263 1102.91 124.693 1101.24 127.887C1099.62 131.037 1098.79 134.839 1098.74 139.294ZM1226.42 200.917C1218.55 200.917 1211.42 198.892 1205.03 194.842C1198.68 190.748 1193.64 184.741 1189.91 176.821C1186.22 168.857 1184.38 159.093 1184.38 147.528C1184.38 135.649 1186.29 125.772 1190.11 117.898C1193.94 109.979 1199.02 104.062 1205.37 100.147C1211.76 96.1873 1218.75 94.2075 1226.36 94.2075C1232.16 94.2075 1237 95.1974 1240.87 97.1772C1244.78 99.112 1247.93 101.542 1250.32 104.467C1252.75 107.347 1254.59 110.181 1255.85 112.971H1256.73V61H1285.42V199.23H1257.07V182.626H1255.85C1254.5 185.506 1252.59 188.363 1250.12 191.198C1247.68 193.987 1244.51 196.305 1240.6 198.15C1236.73 199.995 1232.01 200.917 1226.42 200.917ZM1235.54 178.036C1240.17 178.036 1244.09 176.776 1247.28 174.256C1250.52 171.692 1252.99 168.115 1254.71 163.525C1256.46 158.935 1257.34 153.558 1257.34 147.393C1257.34 141.229 1256.48 135.874 1254.77 131.33C1253.06 126.785 1250.59 123.275 1247.35 120.801C1244.11 118.326 1240.17 117.088 1235.54 117.088C1230.81 117.088 1226.83 118.371 1223.59 120.935C1220.35 123.5 1217.9 127.055 1216.23 131.6C1214.57 136.144 1213.74 141.409 1213.74 147.393C1213.74 153.423 1214.57 158.755 1216.23 163.39C1217.94 167.979 1220.39 171.579 1223.59 174.189C1226.83 176.754 1230.81 178.036 1235.54 178.036ZM1338.62 201.187C1332 201.187 1326.11 200.04 1320.93 197.745C1315.76 195.405 1311.67 191.963 1308.65 187.418C1305.68 182.828 1304.19 177.114 1304.19 170.274C1304.19 164.515 1305.25 159.678 1307.37 155.763C1309.48 151.848 1312.36 148.698 1316.01 146.314C1319.65 143.929 1323.79 142.129 1328.43 140.914C1333.11 139.699 1338.01 138.844 1343.14 138.349C1349.17 137.719 1354.03 137.134 1357.72 136.594C1361.41 136.009 1364.09 135.154 1365.75 134.03C1367.42 132.904 1368.25 131.24 1368.25 129.035V128.63C1368.25 124.355 1366.9 121.048 1364.2 118.708C1361.54 116.368 1357.76 115.198 1352.86 115.198C1347.68 115.198 1343.57 116.346 1340.51 118.641C1337.45 120.89 1335.42 123.725 1334.43 127.145L1307.84 124.985C1309.19 118.685 1311.85 113.241 1315.81 108.651C1319.77 104.017 1324.87 100.462 1331.13 97.9872C1337.43 95.4675 1344.71 94.2075 1352.99 94.2075C1358.75 94.2075 1364.27 94.8823 1369.53 96.2323C1374.84 97.5822 1379.54 99.6744 1383.64 102.509C1387.78 105.344 1391.04 108.989 1393.42 113.443C1395.81 117.853 1397 123.14 1397 129.305V199.23H1369.73V184.853H1368.92C1367.26 188.093 1365.03 190.95 1362.24 193.425C1359.45 195.855 1356.1 197.767 1352.18 199.162C1348.27 200.512 1343.75 201.187 1338.62 201.187ZM1346.85 181.343C1351.08 181.343 1354.82 180.511 1358.06 178.846C1361.3 177.136 1363.84 174.841 1365.68 171.962C1367.53 169.082 1368.45 165.82 1368.45 162.175V151.173C1367.55 151.758 1366.31 152.298 1364.74 152.793C1363.21 153.243 1361.48 153.67 1359.54 154.075C1357.61 154.436 1355.67 154.773 1353.74 155.088C1351.8 155.358 1350.05 155.605 1348.47 155.83C1345.1 156.325 1342.15 157.113 1339.63 158.193C1337.11 159.273 1335.15 160.735 1333.76 162.58C1332.36 164.38 1331.67 166.629 1331.67 169.329C1331.67 173.244 1333.08 176.236 1335.92 178.306C1338.8 180.331 1342.44 181.343 1346.85 181.343Z"
fill="#00DC82"
/>
</svg>
</template>
31 changes: 31 additions & 0 deletions docs/components/OgImage/OgImageDocs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script lang="ts" setup>
defineOptions({
inheritAttrs: false,
});
defineProps({
title: {
type: String,
required: true,
},
description: {
type: String,
required: true,
},
});
</script>

<template>
<div
class="w-full h-full flex flex-col justify-center text-center bg-slate-900 p-8"
>
<div class="relative">
<h1 class="text-8xl mb-4 text-white">
{{ title }}
</h1>
<p class="text-5xl text-gray-200 leading-tight">
{{ description }}
</p>
</div>
</div>
</template>
Loading

0 comments on commit 2d4ab8f

Please sign in to comment.