docusaurus/v1/website/pages/en/about-slash.js
Dom Corvasce 61078e38a9 feat: Allow modifying docs url prefix (#914)
* Allow other routes than /docs in the URL

siteConfig.js has a new mandatory field named *docsRoute* which default
value is 'docs' and that can be customized by the user.

This change will allow users who uses the library to host guides and
tutorials to customize their websites by assign 'docsRoute' values
like 'tutorials' or 'guides'.

Fixes #879

* Make "docsRoute" field optional

* Isolate docsRoute login in getDocsRoute function

* Rename docsRoute to docsUrl

* Run prettier

* Remove old folders

* fix: Restore docusaurus reference link

* fix: Add `docsUrl` param fallback. Refactor multiple function calls

* Fix linting errors

* Update description for docsUrl field

* Reduce redundant calls to getDocsUrl

* Replace a missed use case for `docsUrl` instead of the function call

* Move `getDocsUrl` out from `server/routing.js` to `server/utils.js`

**Why?**
Because `routing.js` is exporting all router RegEx's, and the
`getDocsUrl` suffices more as a util

* WiP: Align leading slashes and fix routing around `docsUrl`

Checklist:
- [x] Added `removeDuplicateLeadingSlashes` util to make sure there is only
one leading slash
- [-] Fix edge cases for routing:
  - [x] `docsUrl: ''`
  - [ ] `docsUrl: '/'`
  - [ ] make it work with languages
  - [ ] make it work with versioning

* Make leading slashes canonical cross routing and generated links

This ensures correct routing for customized `baseUrl` and `docsUrl`.

- Changed all routing functions to take `siteConfig` instead of
`siteConfig.baseUrl`
- Updated tests accordingly

* Alternative fallback for `docsUrl`

* rework/ fix implementation

* cleanup

* refactor and add docs for config props

* fix typo

* fix broken url
2018-11-28 15:34:16 +08:00

73 lines
2.6 KiB
JavaScript

/**
* 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 react/jsx-no-comment-textnodes */
const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');
const Container = CompLibrary.Container;
const translate = require('../../server/translate.js').translate;
class AboutSlash extends React.Component {
render() {
const {config: siteConfig} = this.props;
return (
<div className="pageContainer">
<Container className="mainContainer documentContainer postContainer">
<h1>
<translate>About Slash</translate>
</h1>
<img
src={`${siteConfig.baseUrl}img/docusaurus.svg`}
alt="Docusaurus"
/>
<p>
Slash is the official mascot of Docusaurus. You will find different
variations of her throughout the{' '}
<a href="https://docusaurus.io">website</a>, whether she is moving
fast on her scooter or writing documentation at her standing desk.
At Facebook, we have actual Slash plushies -- and you never know,
you may see these plushies at various events and conferences in the
future.
</p>
</Container>
<Container className="mainContainer">
<h2>
<translate>Birth of Slash</translate>
</h2>
<img
src={`${siteConfig.baseUrl}img/slash-birth.png`}
alt="Birth of Slash"
/>
<p>
The team sat in a conference room trying to come up with a name for
the project. Dinosaurs became a theme, finally landing on
Docusaurus, combining documentation with those many dinosaurs that
end in "saurus". Of course, we needed a logo for our new project.
Eric sat down and designed a logo that was quite beyond the norm of
our normal open source project logos, but yet was just so awesome,
we had to use it. We needed a name for this cute Docusaur. "Marky"
for markdown? "Docky" for documentation? No, "Slash" for the normal
way someone starts code documentation in many programming languages{' '}
<code>//</code> or <code>/*</code> or <code>///</code>. And Slash
was born.
</p>
</Container>
<br />
</div>
);
}
}
AboutSlash.defaultProps = {
language: 'en',
};
AboutSlash.title = 'About Slash';
module.exports = AboutSlash;