Skip to content

Commit

Permalink
Merge pull request zuiidea#969 from ccyanxyz/patch-1
Browse files Browse the repository at this point in the history
fix markdown code block in docs/layout.md
  • Loading branch information
superlbr authored May 4, 2019
2 parents bef5b26 + be083d8 commit 157a54b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Take a new layout named `secondary` as an example to make the route starting wit

1. Add related configuration in `src/utils/config.js`. For details, please refer to [layouts](/configuration?id=layouts).

   ```javascript
```javascript
   layouts: [
           {
               name: 'primary',
Expand All @@ -18,23 +18,23 @@ Take a new layout named `secondary` as an example to make the route starting wit
               include: [/(\/(en|zh))*\/seconday\/(.*)/],
           },
   ],
   ```
```

2. Add the `secondary` layout component to the `src/layouts/BaseLayout.js` file.

   ```javascript
```javascript
   import SecondaryLayout from './SecondaryLayout'

   const LayoutMap = {
     Primary: PrimaryLayout,
     Public: PublicLayout,
     Secondary: SecondaryLayout,
   }
   ```
```

3. Add the `SecondaryLayout.js` file to the `src/layouts/` directory.

   ```javascript
```javascript
   import React from 'react'

   export default ({ children }) => {
Expand All @@ -45,16 +45,16 @@ Take a new layout named `secondary` as an example to make the route starting wit
       </div>
     )
   }
   ```
```

4. Add a `seconday/index.js` file to the `src/pages/` directory.

   ```javascript
```javascript
   import React from 'react'

   export default ({ children }) => {
     Return <div>Seconday page Content</div>
   }
   ```
```

5. Finally, start the development mode `npm run start`, open [http://localhost:7000/seconday/](http://localhost:7000/seconday/) and you will see the page for the `seconday` layout.
5. Finally, start the development mode `npm run start`, open [http://localhost:7000/seconday/](http://localhost:7000/seconday/) and you will see the page for the `seconday` layout.

0 comments on commit 157a54b

Please sign in to comment.