Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(website): update docusaurus to latest version #5181

Merged
merged 1 commit into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions website/core/Footer.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
const React = require('react');
/**
* 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.
*/

const githubButton = (
<a
className="github-button"
href="https://github.com/facebook/jest"
data-icon="octicon-star"
data-count-href="/facebook/jest/stargazers"
data-count-api="/repos/facebook/jest#stargazers_count"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star this project on GitHub"
>
Star
</a>
);
const React = require('react');

class Footer extends React.Component {
render() {
Expand Down Expand Up @@ -87,7 +80,17 @@ class Footer extends React.Component {
<h5>More</h5>
<a href={this.props.config.baseUrl + 'blog'}>Blog</a>
<a href="https://github.com/facebook/jest">GitHub</a>
{githubButton}
<a
className="github-button"
href={this.props.config.repoUrl}
data-icon="octicon-star"
data-count-href="/facebook/jest/stargazers"
data-show-count={true}
data-count-aria-label="# stargazers on GitHub"
aria-label="Star facebook/jest on GitHub"
>
Star
</a>
</div>
</section>

Expand Down
11 changes: 7 additions & 4 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_comment": "This file is auto-generated by write-translations.js",
"localized-strings": {
"next": "Next",
"previous": "Previous",
Expand Down Expand Up @@ -35,9 +36,9 @@
"Blog": "Blog",
"GitHub": "GitHub",
"Introduction": "Introduction",
"API Reference": "API Reference",
"Guides": "Guides",
"Framework Guides": "Framework Guides",
"Guides": "Guides"
"API Reference": "API Reference"
},
"pages-strings": {
"Find what you're looking for in our detailed documentation and guides.\\n\\n- Learn how to [get started](/jest/docs/en/getting-started.html) with Jest.\\n- [Troubleshoot](/jest/docs/en/troubleshooting.html) problems with Jest.\\n- Learn how to [configure Jest](/jest/docs/en/configuration.html).\\n- Look at the full [API Reference](/jest/docs/en/api.html).|no description given": "Find what you're looking for in our detailed documentation and guides.\\n\\n- Learn how to [get started](/jest/docs/en/getting-started.html) with Jest.\\n- [Troubleshoot](/jest/docs/en/troubleshooting.html) problems with Jest.\\n- Learn how to [configure Jest](/jest/docs/en/configuration.html).\\n- Look at the full [API Reference](/jest/docs/en/api.html).",
Expand Down Expand Up @@ -79,6 +80,8 @@
"Who's using Jest?|no description given": "Who's using Jest?",
"Jest is used by teams of all sizes to test web applications, node.js services, mobile apps, and APIs.|no description given": "Jest is used by teams of all sizes to test web applications, node.js services, mobile apps, and APIs.",
"More Jest Users|no description given": "More Jest Users",
"Help Translate|recruit community translators for your project": "Help Translate"
"Help Translate|recruit community translators for your project": "Help Translate",
"Edit this Doc|recruitment message asking to edit the doc source": "Edit",
"Translate this Doc|recruitment message asking to translate the docs": "Translate"
}
}
}
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"rename-version": "docusaurus-rename-version"
},
"dependencies": {
"docusaurus": "^1.0.0-beta.4"
"docusaurus": "^1.0.3"
},
"devDependencies": {
"crowdin-cli": "^0.3.0"
Expand Down
6 changes: 2 additions & 4 deletions website/pages/en/help.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const React = require('react');
Expand Down
59 changes: 27 additions & 32 deletions website/pages/en/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

const React = require('react');

const CompLibrary = require('../../core/CompLibrary.js');
const Marked = CompLibrary.Marked; /* Used to read markdown */
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;

Expand All @@ -19,20 +17,6 @@ const translation = require('../../server/translation.js');

const siteConfig = require(process.cwd() + '/siteConfig.js');

const githubButton = (
<a
className="github-button"
href="https://github.com/facebook/jest"
data-icon="octicon-star"
data-count-href="/facebook/jest/stargazers"
data-count-api="/repos/facebook/jest#stargazers_count"
data-count-aria-label="# stargazers on GitHub"
aria-label="Star facebook/jest on GitHub"
>
Star
</a>
);

class Button extends React.Component {
render() {
return (
Expand Down Expand Up @@ -104,7 +88,17 @@ class HomeSplash extends React.Component {
</div>
</div>
<div className="githubButton" style={{minHeight: '20px'}}>
{githubButton}
<a
className="github-button"
href={this.props.config.repoUrl}
data-icon="octicon-star"
data-count-href="/facebook/jest/stargazers"
data-show-count={true}
data-count-aria-label="# stargazers on GitHub"
aria-label="Star facebook/jest on GitHub"
>
Star
</a>
</div>
</div>
</div>
Expand All @@ -120,17 +114,17 @@ class Index extends React.Component {
.filter(user => {
return user.pinned;
})
.map(user => {
.map((user, i) => {
return (
<a href={user.infoLink}>
<a href={user.infoLink} key={i}>
<img src={user.image} title={user.caption} />
</a>
);
});

return (
<div>
<HomeSplash language={this.props.language} />
<HomeSplash language={this.props.language} config={siteConfig} />
<div className="mainContainer">
<Container padding={['bottom', 'top']}>
<GridBlock
Expand Down Expand Up @@ -174,14 +168,15 @@ class Index extends React.Component {
layout="fourColumn"
/>
</Container>

<div
className="productShowcaseSection paddingBottom"
style={{textAlign: 'center'}}
>
<h2>
<translate>Zero configuration testing platform</translate>
</h2>
<Marked>
<MarkdownBlock>
<translate>
Jest is used by Facebook to test all JavaScript code including
React applications. One of Jest's philosophies is to provide an
Expand All @@ -190,7 +185,7 @@ class Index extends React.Component {
writing more tests, which in turn results in more stable and
healthy code bases.
</translate>
</Marked>
</MarkdownBlock>
</div>

<Container padding={['bottom', 'top']} background="light">
Expand Down Expand Up @@ -266,15 +261,15 @@ class Index extends React.Component {
<translate>Try it out!</translate>
</h2>
<div>
<Marked>
<MarkdownBlock>
<translate>
You can try out a real version of Jest using
[repl.it](https://repl.it/languages/jest). Consider a
function, `add()`, that adds two numbers. We can use a
basic test in `add-test.js` to verify that 1 + 2 equals 3.
Hit \"run\" to try it out!
</translate>
</Marked>
</MarkdownBlock>
</div>
</div>
<div className="jest-repl">
Expand Down Expand Up @@ -302,6 +297,7 @@ class Index extends React.Component {
]}
/>
</Container>

<Container padding={['bottom', 'top']} background="light">
<GridBlock
contents={[
Expand Down Expand Up @@ -340,7 +336,7 @@ class Index extends React.Component {
<translate>Watch Talks about Jest</translate>
</h2>
<div>
<Marked>
<MarkdownBlock>
<translate>
The Jest core team and contributors regularly speak about
Jest and Delightful JavaScript Testing. Check out our
Expand All @@ -350,7 +346,7 @@ class Index extends React.Component {
Testing](https://www.youtube.com/watch?time_continue=416&v=HAuXJVI_bUs)
at React Conf 2017.
</translate>
</Marked>
</MarkdownBlock>
</div>
</div>
</div>
Expand All @@ -363,15 +359,15 @@ class Index extends React.Component {
<translate>Learn how to test JavaScript with </translate>
</h2>
<div>
<Marked>
<MarkdownBlock>
<translate>
In this
[video](https://egghead.io/lessons/javascript-test-javascript-with-jest)
by [Kent C. Dodds](https://twitter.com/kentcdodds) you
will learn how to install Jest and write your first unit
test.
</translate>
</Marked>
</MarkdownBlock>
</div>
</div>
<div className="video">
Expand All @@ -395,7 +391,6 @@ class Index extends React.Component {
<a
className="button"
href={siteConfig.baseUrl + this.props.language + '/users.html'}
target="_self"
>
<translate>More Jest Users</translate>
</a>
Expand Down
4 changes: 2 additions & 2 deletions website/pages/en/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const siteConfig = require(process.cwd() + '/siteConfig.js');

class Users extends React.Component {
render() {
const showcase = siteConfig.users.map(user => {
const showcase = siteConfig.users.map((user, i) => {
return (
<a href={user.infoLink}>
<a href={user.infoLink} key={i}>
<img src={user.image} title={user.caption} />
</a>
);
Expand Down
8 changes: 6 additions & 2 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ const users = [
},
];

const repoUrl = 'https://github.com/facebook/jest';

const siteConfig = {
title: 'Jest',
tagline: '🃏 Delightful JavaScript Testing',
Expand All @@ -255,15 +257,15 @@ const siteConfig = {
projectName: 'jest',
repo: 'facebook/jest',
users,
editUrl: 'https://github.com/facebook/jest/edit/master/docs/',
editUrl: repoUrl + '/edit/master/docs/',
headerLinks: [
{doc: 'getting-started', label: 'Docs'},
{doc: 'api', label: 'API'},
{page: 'help', label: 'Help'},
{blog: true, label: 'Blog'},
{languages: true},
{search: true},
{href: 'https://github.com/facebook/jest', label: 'GitHub'},
{href: repoUrl, label: 'GitHub'},
],
headerIcon: 'img/jest.svg',
footerIcon: 'img/jest-outline.svg',
Expand All @@ -280,6 +282,8 @@ const siteConfig = {
secondaryColor: '#7f2c39',
prismColor: 'rgba(153, 66, 79, 0.03)',
},
scripts: ['https://buttons.github.io/buttons.js'],
repoUrl,
};

module.exports = siteConfig;
Loading