feat(v2): createData plugin API (#1400)

* feat(v2): createModule plugin api

* remove unused stuff

* address review, createModule -> createData

* link.link -> link.url

* remove youtube page

* update yarn.lock
This commit is contained in:
Endilie Yacop Sucipto 2019-04-27 14:13:53 +07:00 committed by GitHub
parent 195e934858
commit b3cf9c62d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 164 additions and 349 deletions

View file

@ -13,13 +13,9 @@ module.exports = {
baseUrl: '/',
url: 'https://docusaurus-2.netlify.com',
headerLinks: [
{doc: 'installation', label: 'Docs'},
{page: 'youtube', label: 'Youtube'},
{blog: true, label: 'Blog'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
},
{url: 'docs/installation', label: 'Docs'},
{url: 'blog', label: 'Blog'},
{url: 'feedback/', label: 'Feedback'},
],
headerIcon: 'img/docusaurus.svg',
favicon: 'img/docusaurus.ico',

View file

@ -16,7 +16,6 @@
"@docusaurus/plugin-sitemap": "^2.0.0-alpha.11",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-youtube": "^7.9.0"
"react-dom": "^16.8.4"
}
}

View file

@ -1,39 +0,0 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable */
import React from 'react';
import Head from '@docusaurus/Head';
import YouTube from 'react-youtube';
export default class Player extends React.Component {
render() {
const opts = {
height: '390',
width: '640',
playerVars: {
autoplay: 1,
},
};
return (
<div>
<Head>
<title>My Youtube</title>
</Head>
<div className="container margin-vert--xl text--center">
{/* this is a React-youtube component */}
<YouTube videoId="d9IxdwEFk1c" opts={opts} onReady={this._onReady} />
</div>
</div>
);
}
_onReady(event) {
// access to player in all event handlers via event.target
event.target.playVideo();
}
}