docus 1.0.7 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +9 -22
  2. package/app/router.options.ts +18 -0
  3. package/assets/css/fonts.css +84 -0
  4. package/assets/css/main.css +11 -0
  5. package/assets/css/tailwind.css +282 -0
  6. package/components/app/Container.vue +25 -0
  7. package/components/app/Footer.vue +40 -0
  8. package/components/app/Navbar.vue +26 -0
  9. package/components/app/NavbarLogo.vue +33 -0
  10. package/components/app/Page.vue +7 -0
  11. package/components/app/PoweredByDocus.vue +11 -0
  12. package/components/content/Alert.vue +124 -0
  13. package/components/content/BlockHero.vue +54 -0
  14. package/components/content/ButtonLink.vue +45 -0
  15. package/components/content/Card.vue +46 -0
  16. package/components/content/CardGrid.vue +23 -0
  17. package/components/content/CodeBlock.vue +47 -0
  18. package/components/content/CodeGroup.vue +135 -0
  19. package/components/content/CopyButton.vue +49 -0
  20. package/components/content/List.vue +5 -0
  21. package/components/content/NeedContribution.vue +23 -0
  22. package/components/content/ReadMore.vue +25 -0
  23. package/components/content/Sandbox.vue +102 -0
  24. package/components/content/TabsHeader.vue +44 -0
  25. package/components/content/Terminal.vue +64 -0
  26. package/components/content/VideoPlayer.vue +115 -0
  27. package/components/docs/DocsAside.vue +21 -0
  28. package/components/docs/DocsAsideTree.vue +102 -0
  29. package/components/docs/DocsHero.vue +39 -0
  30. package/components/docs/DocsPage.vue +22 -0
  31. package/components/docs/DocsPageContent.vue +31 -0
  32. package/components/docs/DocsToc.vue +74 -0
  33. package/components/globals/Icon.vue +24 -0
  34. package/components/globals/Logo.vue +3 -0
  35. package/components/globals/NuxtImg.vue +45 -0
  36. package/components/globals/SocialIcons.vue +45 -0
  37. package/components/globals/ThemeSelect.vue +35 -0
  38. package/components/icons/IconAlgolia.vue +8 -0
  39. package/components/icons/IconArrowLeft.vue +10 -0
  40. package/components/icons/IconArrowRight.vue +10 -0
  41. package/components/icons/IconBadgeCheck.vue +14 -0
  42. package/components/icons/IconCheck.vue +10 -0
  43. package/components/icons/IconCheckCircle.vue +10 -0
  44. package/components/icons/IconChevronRight.vue +12 -0
  45. package/components/icons/IconClipboardCheck.vue +14 -0
  46. package/components/icons/IconClipboardCopy.vue +14 -0
  47. package/components/icons/IconCodeSandbox.vue +8 -0
  48. package/components/icons/IconCopy.vue +17 -0
  49. package/components/icons/IconDots.vue +10 -0
  50. package/components/icons/IconEdit.vue +18 -0
  51. package/components/icons/IconExclamationCircle.vue +12 -0
  52. package/components/icons/IconExclamationTriangle.vue +10 -0
  53. package/components/icons/IconExternalLink.vue +12 -0
  54. package/components/icons/IconGit.vue +7 -0
  55. package/components/icons/IconGitHub.vue +10 -0
  56. package/components/icons/IconHeart.vue +9 -0
  57. package/components/icons/IconInformationCircle.vue +10 -0
  58. package/components/icons/IconLighthouse.vue +83 -0
  59. package/components/icons/IconLine.vue +10 -0
  60. package/components/icons/IconMarkdown.vue +13 -0
  61. package/components/icons/IconMenu.vue +12 -0
  62. package/components/icons/IconMenuAlt.vue +10 -0
  63. package/components/icons/IconMinus.vue +10 -0
  64. package/components/icons/IconMoon.vue +10 -0
  65. package/components/icons/IconNuxt.vue +14 -0
  66. package/components/icons/IconNuxtContent.vue +20 -0
  67. package/components/icons/IconNuxtLabs.vue +21 -0
  68. package/components/icons/IconPlus.vue +10 -0
  69. package/components/icons/IconPuzzle.vue +8 -0
  70. package/components/icons/IconSSG.vue +7 -0
  71. package/components/icons/IconSearch.vue +12 -0
  72. package/components/icons/IconSun.vue +10 -0
  73. package/components/icons/IconTocBack.vue +21 -0
  74. package/components/icons/IconTocCurrent.vue +21 -0
  75. package/components/icons/IconTocNext.vue +8 -0
  76. package/components/icons/IconTranslate.vue +14 -0
  77. package/components/icons/IconTwitter.vue +8 -0
  78. package/components/icons/IconVite.vue +30 -0
  79. package/components/icons/IconVue.vue +6 -0
  80. package/components/icons/IconVueTelescope.vue +11 -0
  81. package/components/icons/IconWindi.vue +17 -0
  82. package/components/icons/IconX.vue +12 -0
  83. package/components/icons/IconXCircle.vue +10 -0
  84. package/components/icons/IconZap.vue +8 -0
  85. package/components/prose/ProseA.vue +66 -0
  86. package/components/prose/ProseBlockquote.vue +21 -0
  87. package/components/prose/ProseCode.vue +68 -0
  88. package/components/prose/ProseCodeInline.vue +38 -0
  89. package/components/prose/ProseEm.vue +11 -0
  90. package/components/prose/ProseH1.vue +22 -0
  91. package/components/prose/ProseH2.vue +22 -0
  92. package/components/prose/ProseH3.vue +24 -0
  93. package/components/prose/ProseH4.vue +24 -0
  94. package/components/prose/ProseHr.vue +13 -0
  95. package/components/prose/ProseImg.vue +30 -0
  96. package/components/prose/ProseLi.vue +31 -0
  97. package/components/prose/ProseOl.vue +16 -0
  98. package/components/prose/ProseP.vue +14 -0
  99. package/components/prose/ProseStrong.vue +14 -0
  100. package/components/prose/ProseTable.vue +13 -0
  101. package/components/prose/ProseTbody.vue +5 -0
  102. package/components/prose/ProseTd.vue +11 -0
  103. package/components/prose/ProseTh.vue +11 -0
  104. package/components/prose/ProseThead.vue +11 -0
  105. package/components/prose/ProseTr.vue +11 -0
  106. package/components/prose/ProseUl.vue +15 -0
  107. package/composables/useContent.ts +156 -0
  108. package/composables/useMenu.ts +22 -0
  109. package/composables/useScrollToHeading.ts +35 -0
  110. package/composables/useScrollspy.ts +46 -0
  111. package/composables/useTheme.ts +12 -0
  112. package/layouts/default.vue +29 -0
  113. package/layouts/page.vue +11 -0
  114. package/nuxt.config.ts +151 -0
  115. package/package.json +45 -63
  116. package/pages/[...slug].vue +26 -0
  117. package/public/android-chrome-192x192.png +0 -0
  118. package/public/android-chrome-512x512.png +0 -0
  119. package/public/apple-touch-icon.png +0 -0
  120. package/public/favicon-16x16.png +0 -0
  121. package/public/favicon-32x32.png +0 -0
  122. package/public/favicon.ico +0 -0
  123. package/public/site.webmanifest +1 -0
  124. package/dist/create-docus/create-docus.js +0 -7
  125. package/dist/create-docus/helpers.js +0 -244
  126. package/dist/create-docus/index.js +0 -87
  127. package/dist/index.js +0 -10
@@ -0,0 +1,156 @@
1
+ import { withoutTrailingSlash } from 'ufo'
2
+ import type { NavItem, ParsedContent } from '@nuxt/content/dist/runtime/types'
3
+ import { computed, fetchContentNavigation, onBeforeUnmount, onMounted, queryContent, useNuxtApp, useRoute, useState } from '#imports'
4
+
5
+ let closeHook
6
+
7
+ export const useContent = () => {
8
+ const route = useRoute()
9
+
10
+ const path = computed(() => withoutTrailingSlash(route.path))
11
+
12
+ /**
13
+ * Navigation tree from root of app.
14
+ */
15
+ const navigation = useState<NavItem[]>('navigation', () => null)
16
+
17
+ /**
18
+ * Current page complete data.
19
+ */
20
+ const page = useState<ParsedContent>(`content-page-${path.value}`, () => null)
21
+
22
+ /**
23
+ * Previous and next page data.
24
+ * Format: [prev, next]
25
+ */
26
+ const surround = useState<ParsedContent[]>(`content-surround-${path.value}`, () => null)
27
+
28
+ /**
29
+ * Table of contents from parsed page.
30
+ */
31
+ const toc = computed(() => page?.value?.body?.toc?.links || [])
32
+
33
+ /**
34
+ * Content type from parsed page.
35
+ */
36
+ const type = computed(() => page.value?.meta?.type)
37
+
38
+ /**
39
+ * Next page from `surround`.
40
+ */
41
+ const next = computed(() => surround.value?.[1] || null)
42
+
43
+ /**
44
+ * Previous page from `surround`.
45
+ */
46
+ const prev = computed(() => surround.value?.[0] || null)
47
+
48
+ /**
49
+ * Page list fetching helper.
50
+ */
51
+ const fetchDir = async(path: string) => await queryContent(path).find()
52
+
53
+ /**
54
+ * Find first child link from a navigation node.
55
+ */
56
+ const findBottomLink = (link: NavItem) => {
57
+ let slug = link.slug
58
+
59
+ if (link.children && link.children.length)
60
+ slug = findBottomLink(link.children[0])
61
+
62
+ return slug
63
+ }
64
+
65
+ /**
66
+ * Find current navigation node from a path.
67
+ */
68
+ const navFromPath = (path: string, tree: NavItem[] = navigation.value) => {
69
+ for (const file of tree) {
70
+ if (file.children) {
71
+ const result = navFromPath(path, file.children)
72
+ if (result)
73
+ return result
74
+ }
75
+
76
+ if (file.slug === path)
77
+ return file
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Navigation fetching helper.
83
+ */
84
+ const fetchNavigation = async(force = false) => {
85
+ if (navigation.value !== null && !force)
86
+ return
87
+
88
+ navigation.value = await fetchContentNavigation()
89
+ }
90
+
91
+ /**
92
+ * Local page fetching helper.
93
+ */
94
+ const fetchPage = async(force = false) => {
95
+ if (page.value !== null && !force)
96
+ return
97
+
98
+ const splitted = path.value.split('/')
99
+ const directory = splitted.slice(0, splitted.length - 1).join('/')
100
+
101
+ // Get navigation node from current path
102
+ const file = navFromPath(path.value, navigation.value)
103
+
104
+ if (file && !file.children) {
105
+ // Path queried has a page (and is not a directory)
106
+ await Promise.all([
107
+ queryContent().where({ id: file.id }).findOne() as Promise<ParsedContent>,
108
+ queryContent(directory).findSurround(path.value) as Promise<ParsedContent[]>,
109
+ ]).then(([_page, _surround]) => {
110
+ page.value = _page
111
+ surround.value = _surround
112
+ })
113
+ }
114
+ else if (file) {
115
+ navigateTo(findBottomLink(file))
116
+ }
117
+ }
118
+
119
+ // Re-fetch page on change (development only)
120
+ if (process.dev) {
121
+ onMounted(
122
+ () => {
123
+ // Cleanup previous hook before registering new one.
124
+ if (closeHook)
125
+ closeHook()
126
+
127
+ const { hook } = useNuxtApp()
128
+
129
+ closeHook = hook('app:data:refresh', async() => {
130
+ await fetchNavigation(true)
131
+ await fetchPage(true)
132
+ })
133
+ },
134
+ )
135
+ onBeforeUnmount(() => closeHook && closeHook())
136
+ }
137
+
138
+ return {
139
+ // useState references
140
+ navigation,
141
+ page,
142
+ surround,
143
+ // Fetching helpers
144
+ fetchDir,
145
+ fetchPage,
146
+ fetchNavigation,
147
+ // Computed values
148
+ next,
149
+ prev,
150
+ type,
151
+ toc,
152
+ // Methods
153
+ navFromPath,
154
+ findBottomLink,
155
+ }
156
+ }
@@ -0,0 +1,22 @@
1
+ import { useState } from '#imports'
2
+
3
+ export const useMenu = () => {
4
+ // Menu visible reference
5
+ const visible = useState('menu-visible', () => false)
6
+
7
+ // Open the menu
8
+ const open = () => (visible.value = true)
9
+
10
+ // Close the menu
11
+ const close = () => (visible.value = false)
12
+
13
+ // Toggle the menu (useful for one-off buttons)
14
+ const toggle = () => (visible.value = !visible.value)
15
+
16
+ return {
17
+ open,
18
+ close,
19
+ toggle,
20
+ visible,
21
+ }
22
+ }
@@ -0,0 +1,35 @@
1
+ export const useConvertPropToPixels = (prop: string): number => {
2
+ const tempDiv = document.createElement('div')
3
+
4
+ tempDiv.style.position = 'absolute'
5
+ tempDiv.style.opacity = '0'
6
+ tempDiv.style.height = getComputedStyle(document.documentElement).getPropertyValue(prop)
7
+
8
+ document.body.appendChild(tempDiv)
9
+
10
+ const pixels = parseInt(getComputedStyle(tempDiv).height)
11
+
12
+ document.body.removeChild(tempDiv)
13
+
14
+ return pixels
15
+ }
16
+
17
+ export const useScrollToHeading = (id: string, scrollMarginCssVar: string) => {
18
+ // Use replaceState to prevent page jump when adding hash
19
+ history.replaceState({}, '', `#${id}`)
20
+
21
+ // Do not remove setTimeout (does not work in Safari)
22
+ setTimeout(() => {
23
+ const escapedId = id.replace(/\./g, '\\.')
24
+
25
+ const heading = document.querySelector(`#${escapedId}`) as any
26
+
27
+ const offset = heading.offsetTop - useConvertPropToPixels(scrollMarginCssVar)
28
+
29
+ window.scrollTo({
30
+ top: offset,
31
+ left: 0,
32
+ behavior: 'smooth',
33
+ })
34
+ })
35
+ }
@@ -0,0 +1,46 @@
1
+ import type { Ref } from 'vue'
2
+ import { onBeforeMount, onBeforeUnmount, ref, watch } from '#imports'
3
+
4
+ /**
5
+ * Scrollspy allows you to watch visible headings in a specific page.
6
+ * Useful for table of contents live style updates.
7
+ */
8
+ export const useScrollspy = () => {
9
+ const observer = ref() as Ref<IntersectionObserver>
10
+ const visibleHeadings = ref([]) as Ref<string[]>
11
+ const activeHeadings = ref([]) as Ref<string[]>
12
+
13
+ const observerCallback = (entries: IntersectionObserverEntry[]) =>
14
+ entries.forEach((entry) => {
15
+ const id = entry.target.id
16
+
17
+ if (entry.isIntersecting)
18
+ visibleHeadings.value.push(id)
19
+ else
20
+ visibleHeadings.value = visibleHeadings.value.filter(t => t !== id)
21
+ })
22
+
23
+ const updateHeadings = (headings: Element[]) =>
24
+ headings.forEach((heading) => {
25
+ observer.value.observe(heading)
26
+ })
27
+
28
+ watch(visibleHeadings, (val, oldVal) => {
29
+ if (val.length === 0)
30
+ activeHeadings.value = oldVal
31
+ else
32
+ activeHeadings.value = val
33
+ })
34
+
35
+ // Create intersection observer
36
+ onBeforeMount(() => (observer.value = new IntersectionObserver(observerCallback)))
37
+
38
+ // Destroy it
39
+ onBeforeUnmount(() => observer.value?.disconnect())
40
+
41
+ return {
42
+ visibleHeadings,
43
+ activeHeadings,
44
+ updateHeadings,
45
+ }
46
+ }
@@ -0,0 +1,12 @@
1
+ import { useRuntimeConfig } from '#imports'
2
+
3
+ export const useTheme = () => {
4
+ const { theme } = useRuntimeConfig()
5
+
6
+ return theme
7
+ }
8
+
9
+ export const classNames = (...args: any[]) => {
10
+ const classes = args.filter(Boolean).join(' ')
11
+ return classes.length ? classes : undefined
12
+ }
@@ -0,0 +1,29 @@
1
+ <script setup>
2
+ import { useContent } from '#imports'
3
+
4
+ const { page, fetchNavigation } = useContent()
5
+
6
+ await fetchNavigation()
7
+ </script>
8
+
9
+ <template>
10
+ <div class="w-full flex min-h-screen flex-col">
11
+ <Navbar />
12
+
13
+ <div class="min-h-[calc(100vh-12rem)] sm:min-h-[calc(100vh-8rem)] flex flex-col">
14
+ <DocsPage>
15
+ <template #aside>
16
+ <DocsAside v-if="page?.value?.aside || typeof page?.value?.aside === 'undefined'" />
17
+ </template>
18
+
19
+ <DocsPageContent>
20
+ <div class="max-w-none">
21
+ <NuxtPage />
22
+ </div>
23
+ </DocsPageContent>
24
+ </DocsPage>
25
+ </div>
26
+
27
+ <Footer />
28
+ </div>
29
+ </template>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="w-full flex min-h-screen flex-col">
3
+ <Navbar />
4
+
5
+ <div class="min-h-[calc(100vh-12rem)] sm:min-h-[calc(100vh-8rem)] flex flex-col ">
6
+ <NuxtPage />
7
+ </div>
8
+
9
+ <Footer />
10
+ </div>
11
+ </template>
package/nuxt.config.ts ADDED
@@ -0,0 +1,151 @@
1
+ import { fileURLToPath } from 'url'
2
+ import { defineNuxtConfig } from 'nuxt'
3
+ import colors from 'tailwindcss/colors.js'
4
+ import { resolve } from 'pathe'
5
+
6
+ const themeDir = fileURLToPath(new URL('./', import.meta.url))
7
+ const resolveThemeDir = (path: string) => resolve(themeDir, path)
8
+
9
+ export default defineNuxtConfig({
10
+ runtimeConfig: {
11
+ public: {
12
+ plausible: {
13
+ domain: process.env.PLAUSIBLE_DOMAIN,
14
+ },
15
+ theme: {
16
+ title: 'Docus',
17
+ twitter: '@docus_',
18
+ github: 'nuxtlabs/docus',
19
+ header: {
20
+ title: false,
21
+ logo: true,
22
+ },
23
+ footer: {
24
+ credits: {
25
+ icon: 'IconNuxtLabs',
26
+ text: 'Made by Nuxt Labs',
27
+ },
28
+ icons: [
29
+ {
30
+ label: 'NuxtJS',
31
+ href: 'https://nuxtjs.org',
32
+ component: 'IconNuxt',
33
+ },
34
+ {
35
+ label: 'Vue Telescope',
36
+ href: 'https://vuetelescope.com',
37
+ component: 'IconVueTelescope',
38
+ },
39
+ ],
40
+ },
41
+ },
42
+ },
43
+ },
44
+ head: {
45
+ title: 'Docus',
46
+ link: [
47
+ {
48
+ rel: 'stylesheet',
49
+ href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap',
50
+ },
51
+ { rel: 'preconnect', href: 'https://fonts.gstatic.com' },
52
+ ],
53
+ meta: [
54
+ { hid: 'og:site_name', property: 'og:site_name', content: 'Nuxt 3' },
55
+ { hid: 'og:type', property: 'og:type', content: 'website' },
56
+ ],
57
+ },
58
+ loading: {
59
+ color: '#00DC82',
60
+ },
61
+ /**
62
+ * Components
63
+ */
64
+ components: [
65
+ {
66
+ prefix: '',
67
+ path: './components/app',
68
+ global: true,
69
+ },
70
+ {
71
+ prefix: '',
72
+ path: './components/docs',
73
+ global: true,
74
+ },
75
+ {
76
+ prefix: '',
77
+ path: './components/prose',
78
+ global: true,
79
+ },
80
+ {
81
+ prefix: '',
82
+ path: './components/globals',
83
+ global: true,
84
+ },
85
+ {
86
+ prefix: '',
87
+ path: './components/content',
88
+ global: true,
89
+ },
90
+ {
91
+ prefix: '',
92
+ path: './components/icons',
93
+ global: true,
94
+ },
95
+ ],
96
+ css: [
97
+ resolveThemeDir('assets/css/main.css'),
98
+ resolveThemeDir('assets/css/fonts.css'),
99
+ resolveThemeDir('assets/css/tailwind.css'),
100
+ ],
101
+ tailwindcss: {
102
+ viewer: false,
103
+
104
+ config: {
105
+ darkMode: 'class',
106
+ theme: {
107
+ extend: {
108
+ colors: {
109
+ gray: colors.gray,
110
+ primary: colors.indigo,
111
+ },
112
+ fontFamily: {
113
+ sans: 'Inter, sans-serif',
114
+ },
115
+ },
116
+ },
117
+ plugins: [
118
+ require('@tailwindcss/typography'),
119
+ require('@tailwindcss/forms'),
120
+ require('@tailwindcss/line-clamp'),
121
+ require('@tailwindcss/aspect-ratio'),
122
+ ],
123
+ content: [
124
+ resolveThemeDir('components/**/*.{mjs,vue,js,ts}'),
125
+ resolveThemeDir('layouts/**/*.{mjs,vue,js,ts}'),
126
+ resolveThemeDir('pages/**/*.{mjs,vue,js,ts}'),
127
+ ],
128
+ safelist: [24, 36, 48, 60, 72, 84, 96, 108, 120].map(number => `pl-[${number}px]`),
129
+ cssPath: resolveThemeDir('assets/css/tailwind.css'),
130
+ },
131
+ },
132
+ content: {
133
+ highlight: {
134
+ theme: 'one-dark-pro',
135
+ preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'yaml', 'bash'],
136
+ },
137
+ },
138
+ colorMode: {
139
+ classSuffix: '',
140
+ },
141
+ /**
142
+ * Modules
143
+ */
144
+ modules: [
145
+ '@nuxt/content',
146
+ '@nuxtjs/tailwindcss',
147
+ '@nuxtjs/color-mode',
148
+ '@nuxthq/admin',
149
+ 'vue-plausible',
150
+ ],
151
+ })
package/package.json CHANGED
@@ -1,72 +1,54 @@
1
1
  {
2
+ "version": "3.0.0-beta.2",
2
3
  "name": "docus",
3
- "version": "1.0.7",
4
- "description": "The Docus CLI.",
5
- "repository": "https://github.com/docusgen/cli",
6
- "bugs": {
7
- "url": "https://github.com/docusgen/cli/issues"
8
- },
9
- "homepage": "https://github.com/docusgen/cli#readme",
10
- "author": "Yaël GUILLOUX <yael.guilloux@gmail.com>",
11
- "license": "MIT",
12
- "keywords": [
13
- "typescript",
14
- "starter"
15
- ],
16
- "main": "dist/index.js",
17
- "module": "dist/index.mjs",
18
- "types": "dist/src/index.d.ts",
19
4
  "scripts": {
20
- "dev": "jiti scripts/watch.ts --cache",
21
- "build": "unbuild",
22
- "lint": "prettier -c --parser typescript \"{src,tests}/**/*.[jt]s?(x)\"",
23
- "lint:fix": "yarn run lint --write",
24
- "test:types": "tsc --build tsconfig.json",
25
- "test:unit": "jest",
26
- "test": "yarn run test:types && yarn run test:unit"
27
- },
28
- "engines": {
29
- "node": ">=14.0.0"
5
+ "build": "nuxi build",
6
+ "dev": "nuxi dev",
7
+ "preview": "nuxi preview",
8
+ "lint": "eslint --ext .ts,.js,.vue,.css ."
30
9
  },
31
- "bin": {
32
- "create-docus": "dist/create-docus/create-docus.js"
10
+ "devDependencies": {
11
+ "@antfu/eslint-config": "^0.20.6",
12
+ "@nuxtjs/eslint-config-typescript": "^9.0.0",
13
+ "eslint": "^8.13.0",
14
+ "nuxt": "^3.0.0-rc.1",
15
+ "parse-entities": "^4.0.0",
16
+ "typescript": "^4.6.3"
33
17
  },
34
- "files": [
35
- "dist/**/*",
36
- "LICENSE",
37
- "README.md"
38
- ],
39
18
  "dependencies": {
40
- "degit": "^2.8.4",
41
- "execa": "^5.1.1",
42
- "kolorist": "^1.5.0",
43
- "minimist": "^1.2.5",
44
- "prompts": "^2.4.1"
19
+ "@iconify/vue": "^3.2.1",
20
+ "@nuxt/content": "npm:@nuxt/content-edge@latest",
21
+ "@nuxthq/admin": "npm:@nuxthq/admin-edge@latest",
22
+ "@nuxtjs/color-mode": "^3.0.2",
23
+ "@nuxtjs/tailwindcss": "^5.0.3",
24
+ "@tailwindcss/aspect-ratio": "^0.4.0",
25
+ "@tailwindcss/forms": "^0.5.0",
26
+ "@tailwindcss/line-clamp": "^0.3.1",
27
+ "@tailwindcss/typography": "^0.5.2",
28
+ "@vueuse/core": "^8.3.0",
29
+ "@vueuse/motion": "2.0.0-beta.12",
30
+ "clipboard": "^2.0.10",
31
+ "defu": "^6.0.0",
32
+ "lodash-es": "^4.17.21",
33
+ "tailwindcss": "^3.0.24",
34
+ "vue-plausible": "^1.3.1"
45
35
  },
46
- "devDependencies": {
47
- "@types/degit": "^2.8.3",
48
- "@types/jest": "^27.0.1",
49
- "@types/minimist": "^1.2.2",
50
- "@types/prompts": "^2.0.14",
51
- "chokidar": "^3.5.2",
52
- "jest": "^27.0.6",
53
- "jiti": "^1.11.0",
54
- "lint-staged": "^11.1.2",
55
- "pascalcase": "^1.0.0",
56
- "prettier": "^2.3.2",
57
- "ts-jest": "^27.0.5",
58
- "typescript": "^4.3.5",
59
- "unbuild": "^0.4.2"
60
- },
61
- "gitHooks": {
62
- "pre-commit": "lint-staged"
36
+ "main": "./nuxt.config.ts",
37
+ "exports": {
38
+ ".": {
39
+ "require": "./nuxt.config.ts",
40
+ "import": "./nuxt.config.ts"
41
+ }
63
42
  },
64
- "lint-staged": {
65
- "*.js": [
66
- "prettier --write"
67
- ],
68
- "*.ts?(x)": [
69
- "prettier --parser=typescript --write"
70
- ]
71
- }
43
+ "files": [
44
+ "README.md",
45
+ "app",
46
+ "assets",
47
+ "components",
48
+ "composables",
49
+ "layouts",
50
+ "pages",
51
+ "public",
52
+ "nuxt.config.ts"
53
+ ]
72
54
  }
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import { useContent, useRouter } from '#imports'
3
+
4
+ const router = useRouter()
5
+
6
+ const { page, fetchPage } = useContent()
7
+
8
+ await fetchPage()
9
+
10
+ if (page.value && page.value.layout)
11
+ router.currentRoute.value.meta.layout = page.value.layout
12
+ else
13
+ router.currentRoute.value.meta.layout = 'default'
14
+ </script>
15
+
16
+ <template>
17
+ <Content v-if="page" class="content" :document="page" />
18
+ </template>
19
+
20
+ <style scoped>
21
+ .content {
22
+ & > :first-child {
23
+ margin-top: 0 !important;
24
+ }
25
+ }
26
+ </style>
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- // #!/usr/bin/env node
3
- "use strict";
4
-
5
- var _index = require("./index");
6
-
7
- (0, _index.createDocus)().catch(console.log);