From 9b5266aa7ed558d18c8ee661b9450f1d5a795fd7 Mon Sep 17 00:00:00 2001 From: Endi Date: Wed, 11 Dec 2019 03:47:13 +0700 Subject: [PATCH] docs(v2): fix pages routing inaccurate info (#2110) * docs(v2): fix pages routing inaccurate info * fix CI --- package.json | 3 ++- website/docs/creating-pages.md | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2ad9c365210d..c74c688e4ef1 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,8 @@ "git add" ], "*.md": [ - "yarn prettier-docs" + "yarn prettier-docs", + "git add" ] }, "husky": { diff --git a/website/docs/creating-pages.md b/website/docs/creating-pages.md index 0afcfdb9c528..e8dbc01d2590 100644 --- a/website/docs/creating-pages.md +++ b/website/docs/creating-pages.md @@ -45,10 +45,10 @@ Each page doesn't come with any styling. You will need to import the `Layout` co If you are familiar with other static site generators like Jekyll and Next, this routing approach will feel familiar to you. Any JavaScript file you create under `/src/pages/` directory will be automatically converted to a website page, following the `/src/pages/` directory hierarchy. For example: -- `/src/pages/index.js` → `/` -- `/src/pages/test.js` → `/test` +- `/src/pages/index.js` → `` +- `/src/pages/foo.js` → `/foo` - `/src/pages/foo/test.js` → `/foo/test` -- `/src/pages/foo/index.js` → `/foo` +- `/src/pages/foo/index.js` → `/foo/` In this component-based development era, it is encouraged to co-locate your styling, markup and behavior together into components. Each page is a component, and if you need to customize your page design with your own styles, we recommend co-locating your styles with the page component in its own directory. For example, to create a "Support" page, you could do one of the following: