docusaurus/lib/core
Christopher Chedeau a26bba14c6 Add the ability to provide custom layout (#128)
* Add the ability to provide custom layout

When I designed the system, I added the ability to provide a custom layout that would use arbitrary JavaScript to render some custom pages. This is why files are called "DocsLayout.js", "BlogPostLayout.js"... This ability to customize it was [ripped out](https://github.com/facebook/react-native/blob/master/website/server/convert.js#L78) during the migration to Docusaurus but I need it for the project I'm working on right now (that should remain unnamed!).

This adds back the ability to do it in a way that fits the third party system. In order to provide a new layout:

1) Add a `layout` field in the header of your markdown file:

```js
---
layout: mylayout
---
```

2) In your `siteConfig`, add

```js
  layouts: {
    mylayout: function({React, Marked}) {
      return class extends React.Component {
        render() {
           return React.createElement('div', {}, this.props.metadata.layout);
         }
      }
    }
  }
```

I think that it's a reasonable to add and would unblock me :)

* Update DocsLayout.js
2017-10-18 10:20:13 -07:00
..
nav The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
BlogPageLayout.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
BlogPost.js Remove author name when unused (#131) 2017-10-18 09:52:23 -07:00
BlogPostLayout.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
BlogSidebar.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
CompLibrary.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Container.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Doc.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
DocsLayout.js Add the ability to provide custom layout (#128) 2017-10-18 10:20:13 -07:00
DocsSidebar.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
GridBlock.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Head.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Header.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Marked.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Prism.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
Site.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
SnackPlayer.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
toSlug.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
unindent.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00
WebPlayer.js The complete move to MIT license (#115) 2017-10-05 11:14:49 -07:00