Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit ae92f03

Browse files
committed
docs: add test fixture to generated docs site
Note that the test fixture isn't working correctly; ssrRefs aren't being injected. See #44
1 parent 5ea3231 commit ae92f03

File tree

6 files changed

+26
-5
lines changed

6 files changed

+26
-5
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module.exports = {
66
themeConfig: {
77
repo: 'nuxt-community/composition-api',
88
editLinks: true,
9-
docsDir: 'docs',
10-
sidebarDepth: 2,
119
sidebar: {
1210
'/': [
1311
{
@@ -29,7 +27,7 @@ module.exports = {
2927
{
3028
title: 'Examples',
3129
collapsable: false,
32-
children: ['/examples/useFetch'],
30+
children: ['/examples/useFetch', '/examples/live'],
3331
},
3432
],
3533
},

docs/examples/live.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
---
3+
4+
# Live sites
5+
6+
- [Live site demonstrating `useFetch`](/example)
7+
- [Test fixture used in project](/fixture)

docs/examples/useFetch.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@
44
# useFetch
55

66
<Example name="nuxt-community/composition-api/tree/master/example" />
7-
8-
[Live example site](/example)

now.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"src": "docs/package.json",
55
"use": "@now/static-build"
66
},
7+
{
8+
"src": "package.json",
9+
"use": "@now/static-build"
10+
},
711
{
812
"src": "example/package.json",
913
"use": "@now/static-build"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"lint:all:prettier": "yarn lint:prettier \"**/*.{js,json,ts,vue}\"",
4141
"lint:eslint": "eslint --fix",
4242
"lint:prettier": "prettier --write --loglevel warn",
43+
"now-build": "rm -rf .nuxt && NOW_BUILD=true nuxt generate -c test/fixture/nuxt.config.js",
4344
"prepare": "yarn build",
4445
"prepublishOnly": "yarn lint && yarn test",
4546
"release": "release-it",

test/fixture/nuxt.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ module.exports = {
55
rootDir: resolve(__dirname, '../..'),
66
buildDir: resolve(__dirname, '.nuxt'),
77
srcDir: __dirname,
8+
...(process.env.NOW_BUILD === 'true'
9+
? {
10+
generate: {
11+
dir: 'dist/fixture',
12+
},
13+
router: {
14+
base: '/fixture/',
15+
},
16+
build: {
17+
publicPath: 'fixture',
18+
},
19+
}
20+
: {}),
821
buildModules: [
922
process.env.NODE_ENV === 'test'
1023
? require('../..').default

0 commit comments

Comments
 (0)