mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 20:17:50 +02:00
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:
parent
195e934858
commit
b3cf9c62d5
18 changed files with 164 additions and 349 deletions
|
@ -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',
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue