Commit Graph

215 Commits

Author SHA1 Message Date
Ricky Vetter fd05bb3239 More consistent headers (#140)
* More consistent headers

* Clean up mobile blog posts styles
2017-10-18 13:04:29 -07:00
Eric Nakagawa 967970eaa5 Generates a file that redirects from /docs/file.html to /docs/en/folder.html when languages are enabled (languages.js is present) (#137) 2017-10-18 12:56:14 -07:00
Eric Nakagawa bcba05ae03 Adds sitemap.xml. Adds 'Help Translate' to translatable strings. Error messages and fn name cleanups. (#136)
* added a note about needing more than one language to be enabled to allow for a drop down

* Removing debug statements

* Add 'Help Translate' to translatable strings, improves error messages around missing translated strings, calls write-translations on some routes

* Adds sitemap.xml to live server and build. Versioning not supported. -- Also did some file name and module cache cleanups.
2017-10-18 12:55:58 -07:00
Ricky Vetter 30eea17a24 upstream small screen header changes (#141) 2017-10-18 12:44:28 -07:00
Ricky Vetter 768ed88978 Add option to avoid indexing site (#142) 2017-10-18 11:35:30 -07:00
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
Christopher Chedeau 5693eba5d1 Allow for header and empty body (#127)
My hack of checking if the body was empty wasn't correct :(

```js
---
id: String
title: String
layout: stdlib
---
```

The above would be treated as pure content. Now it's working properly :)
2017-10-18 10:16:30 -07:00
Ricky Vetter 967d0b7f3c Make some changes to font size/spacing (#134) 2017-10-18 10:01:06 -07:00
Ricky Vetter e85e0822e5 Use fixed position on mobile nav (#133) 2017-10-18 09:58:41 -07:00
Ricky Vetter e723d21113 normalize header padding (#132) 2017-10-18 09:53:08 -07:00
Ricky Vetter e466c60481 Remove author name when unused (#131) 2017-10-18 09:52:23 -07:00
Ricky Vetter fe938cd5b4 align search bar better (#130) 2017-10-18 09:51:16 -07:00
Ricky Vetter 3ec5da2b4e Remove active item bolding in sidebar (#122) 2017-10-12 14:21:34 +01:00
Ricky Vetter 524c577788 Add more robust font stack (#121) 2017-10-12 14:12:26 +01:00
Eric Nakagawa 8ac191a331 Fixes #104 by providing a useful error message.
Next step will be to run 'write-translations' on 'yarn start' and 'yarn build' (#119)
2017-10-06 12:16:27 -07:00
Joel Marcey 77535d80f2 The complete move to MIT license (#115)
- headers in .js files
- update README and LICENSE year

Testing:

grep BSD, Patents, patents turned up nothing
2017-10-05 11:14:49 -07:00
Joel Marcey 01ebbb1512 Check for required folders based upon headerLinks right up front (#111)
I was getting this error when running the examples:

```
Error: It looks like you've enabled language support, but haven't provided translated files. The document with id: 'en-doc1' doesn't exist.
```

However, this error was an indirect result of me not renaming the `docs-examples-from-docusaurus` directory to `docs` since I had `doc` in my
`headerLinks` in the example siteConfig.js.

So let's check the headerLinks and make sure we have the required directories.

Here is an example of the error if I try to load a Docusaurus site just after running `npm run examples` without having renamed the directories.

```
Error: You have 'doc' in your headerLinks, but no 'docs' folder exists one level up from 'website' folder. Are you running the examples? If so, make sure you rename 'docs-examples-from-docusaurus' to 'docs'.
    at /Users/joelm/dev/test/website/node_modules/docusaurus/lib/core/nav/HeaderNav.js:226:15
:
:
```

Test Plan: Tested a local package in verdaccio
2017-10-05 11:14:27 -07:00
Héctor Ramos 14dfcff769 Support algoliaOptions object as value in siteConfig.js (#113) 2017-10-04 19:13:30 -07:00
Joel Marcey 56e7c41893 Case sensitive requires 2017-10-04 09:17:07 -07:00
Héctor Ramos 053f384cfe Add web player files (#112) 2017-10-04 09:10:33 -07:00
Héctor Ramos 419a11af3e Extend Marked.js in order to support React Native's code players (#109)
* Extend Marked.js to support SnackPlayer and the WebPlayer, as used in React Native
2017-10-04 08:56:55 -07:00
Ricky Vetter 9c7d8e55a9 add sourceCodeButton to site config (#93) 2017-10-03 15:20:35 -07:00
Eric Nakagawa 3b5db4bbf8 2 bug fixes (#98)
* Merge fix

* Updating lock file.

* Bug fix for rss feed truncation...

* Fixes infinite recursive loop for #89

* Removed use of module cache invalidator from feed.js

* Replaced 'latest' babel presets with 'env'

* Ignore temp build folder

* Adding back new truncation logic for RSS

* Updating yarn lock
2017-09-28 14:46:29 -07:00
Eric Nakagawa dc835770a0 RSS/ATOM Feed added, Prism changes, and global Copyright notice. (#94)
* Add Reason support to Prism.js

* Add XML/ATOM feed. Generates for both localhost and build script. Adds meta links to feeds to all html files.

* Updated /core/Footer.js to pull from siteConfig
2017-09-27 12:49:09 -07:00
Eric Nakagawa 0c66a898b6 Add Reason support to Prism.js (#92) 2017-09-26 10:29:09 -07:00
Eric Nakagawa effd1113ad Merge pull request #88 from ericnakagawa/master
Removed a redundant feature, added an error message to help troubleshooting building localized sites.
2017-09-26 10:22:43 -07:00
Héctor Ramos 45f6ef8fd9 Blog enhancements (#80)
* Small CSS adjustments.

* Blog adjustments.

* Add support for Prism in the blog
2017-09-25 12:53:54 -07:00
Héctor Ramos a484893c4f Small CSS adjustments. (#79) 2017-09-25 12:52:58 -07:00
Eric Nakagawa b241ed4404 Prints an console error if /blog/ folder has no files. 2017-09-25 12:11:37 -07:00
Eric Nakagawa a86af92e7c Remove customCssFileName as any css file in /static/css gets appended to end of main.css 2017-09-25 11:35:35 -07:00
Eric Nakagawa e71b4d902e Provide a more useful error in event someone tries to build site but hasn't provided localized files 2017-09-25 11:35:35 -07:00
Eric Nakagawa 376ad77361 Add a class to logo image in header 2017-09-25 10:01:34 -07:00
Eric Nakagawa 0dce734a1d Rearrange custom.css line 2017-09-22 11:42:19 -07:00
Eric Nakagawa 9c6fe348d6 Add support for a custom CSS file that is configurable from siteConfig.js 2017-09-22 11:31:29 -07:00
Eric Nakagawa 89285e7693 Fixes 2 additional console errors. One in HeaderNav and one in Index component. 2017-09-20 14:45:55 -07:00
Eric Nakagawa a83e16308b Fixes one warning in console for React.DOM.* usage. 2017-09-20 14:45:55 -07:00
Frank Li b88d4ac014 Add docusaurus-init package and update copy-examples.js (#70)
* Add docusaurus-init package and update copy-examples.js

* Use yarn by default
2017-09-06 13:00:45 -07:00
Héctor Ramos f803dcbc8e Handle non-standard code blocks gracefully
Prior to this change, Docusaurus would encounter an error when trying to parse a ```SnackPlayer ``` codeblock in Prism.js. These code blocks are unique to the React Native site as of this writing. A proper long term fix would be to handle SnackPlayer properly as we do in the React Native website, but until then let's avoid crashing when we encounter these types of blocks.
2017-08-25 11:11:07 -07:00
Frank Li 9e0fc32ab0 Remove unused file 2017-08-17 10:53:00 -07:00
Frank Li 34ad3fac8b Fix examples script for Windows 2017-08-16 20:33:07 -07:00
Frank Li 1f1d1448b2 Update publish script to create gh-pages branch if it does not exist 2017-08-16 17:36:00 -07:00
Frank Li 37174fd305 Add ssh option to publish script 2017-08-16 16:42:31 -07:00
Frank Li cfc6030d23 Fix replacement of relative doc links 2017-08-16 16:17:33 -07:00
Frank Li b035d41838 Update publish script 2017-08-16 15:35:19 -07:00
Frank Li 3032f464c0 Update publish script 2017-08-16 15:22:36 -07:00
Frank Li feb2fb41d0 Fix publish script to work in Docusaurus itself 2017-08-16 15:12:26 -07:00
Frank Li 999187889e Fix examples gitignore 2017-08-16 15:02:48 -07:00
Joel Marcey c64db63046 Forgot tag closing in noindex 2017-08-16 13:55:14 -07:00
Joel Marcey 1bfd8f8475 Block search engines indexing until launch 2017-08-16 13:54:13 -07:00
Frank Li 43ef3c8142 Add comments 2017-08-15 16:55:38 -07:00
Frank Li 3463ee50ee Merge pull request #66 from facebookexperimental/rename-versions
Add script to rename existing version
2017-08-15 11:13:59 -07:00
Frank Li 6b6910988b Small fix to headerNav 2017-08-14 14:49:17 -07:00
Frank Li e2cdb44bfb Add script to rename existing version 2017-08-14 14:02:56 -07:00
Frank Li ae4c577237 Fix to metadata ids 2017-08-14 10:19:01 -07:00
Frank Li 433f422632 Fix header nav require 2017-08-11 12:03:33 -07:00
Frank Li 2e33758bef Clean up cache removal function 2017-08-11 11:39:04 -07:00
Frank Li 065b8938b2 Merge pull request #64 from facebookexperimental/color-configs
Update color configurations
2017-08-10 17:00:25 -07:00
Eric Nakagawa 19b5710734 Slight css tweaks for landing page images 2017-08-10 16:39:29 -07:00
Frank Li 098d585031 Delete unnecessary comments from Head.js 2017-08-10 16:34:54 -07:00
Frank Li b864aa8a16 Merge pull request #60 from facebookexperimental/update-examples
Update example files and examples script
2017-08-10 16:34:00 -07:00
Frank Li 06254ae021 Ensure .gitignore file gets copied by examples script 2017-08-10 16:33:38 -07:00
Frank Li 074ac07837 Small fix 2017-08-10 16:10:30 -07:00
Frank Li 4646fc98c5 Update color configurations 2017-08-10 16:03:43 -07:00
Frank Li 964e9e2108 Update doc metadata to use file name as id fallback and id as title fallback 2017-08-10 14:51:34 -07:00
Frank Li db7a7394b3 Merge pull request #61 from facebookexperimental/error-messages
Add better error messages for most common cases
2017-08-10 13:46:58 -07:00
Frank Li 56b5554799 Merge pull request #26 from JoelMarcey/cname
Write CNAME file if custom domain
2017-08-10 11:37:25 -07:00
Frank Li c0792044b2 Update CNAME file generation 2017-08-10 11:34:40 -07:00
Frank Li c8e4dc343c Change sidebar_title to sidebar_label 2017-08-09 17:10:07 -07:00
Frank Li 18bcc59fd0 Merge branch 'master' of https://github.com/facebookexperimental/Docusaurus 2017-08-09 16:25:25 -07:00
Frank Li 91fe923cf7 Fix variable declaration 2017-08-09 16:25:18 -07:00
Frank Li 88359ea845 Update messages for versioning 2017-08-09 16:17:39 -07:00
Frank Li cdea25eceb Merge branch 'master' of https://github.com/facebookexperimental/Docusaurus 2017-08-09 15:50:34 -07:00
Frank Li 374ca9b86c Change sidebar.json to sidebars.json in versionFallback.js 2017-08-09 15:50:20 -07:00
Frank Li b256d2f8d9 Initial changes to error messages 2017-08-09 15:43:30 -07:00
Frank Li 0c10287f84 Update blog header link 2017-08-09 14:21:32 -07:00
Frank Li c3a971f2eb Update example files and examples script 2017-08-09 14:18:17 -07:00
Frank Li ac3cc01830 Change babel options 2017-08-09 13:10:04 -07:00
Frank Li d17daaf1c3 Fix babel errors 2017-08-09 13:03:46 -07:00
Frank Li d2eaf04ec7 Fix markdown html link replacement 2017-08-08 15:44:51 -07:00
Frank Li 94a3265aab Fix blog metadata 2017-08-08 14:58:41 -07:00
Frank Li be9ebe3cf8 Merge pull request #53 from facebookexperimental/header-links
Update headerLinks API
2017-08-08 14:13:54 -07:00
Frank Li 22cadc48fc Clean up 2017-08-08 14:01:43 -07:00
Frank Li 6c2b29fd87 Fix document edit link 2017-08-08 13:51:24 -07:00
Frank Li 090aa4c903 Merge branch 'master' into header-links 2017-08-08 13:48:24 -07:00
Frank Li 6ca90610f4 Update headerLinks API 2017-08-08 13:46:11 -07:00
Frank Li 8c70286ad0 Fix usage of sidebars.json for versioning 2017-08-08 13:38:37 -07:00
Frank Li b94dbff181 Fix versioning bugs 2017-08-08 11:44:30 -07:00
Frank Li 9ddd2f5ea4 Merge branch 'master' into versioning 2017-08-08 11:39:23 -07:00
Frank Li cf5ee95a48 Minor cleanup 2017-08-08 11:38:07 -07:00
Frank Li 4b96408fa5 Rename sidebar.json to sidebars.json 2017-08-07 17:25:52 -07:00
Frank Li 09ca732402 Allow document not in sidebar.json to be displayed 2017-08-07 15:15:09 -07:00
Frank Li fd01449db2 Fix version.js script for when there are no versions yet 2017-08-07 12:04:35 -07:00
Frank Li b4e9a068ab Update server to provide message with full link 2017-08-07 11:08:37 -07:00
Frank Li 63e3e31117 Merge branch 'master' of https://github.com/facebookexperimental/Docusaurus into website 2017-08-07 10:28:52 -07:00
Frank Li de2897f108 Allow for extra algoliaOptions for search 2017-08-04 14:44:23 -07:00
Frank Li 5c3f74ddcc Fix removal of semver usage 2017-08-04 12:57:43 -07:00
Frank Li 63043c041a Add version header link and change current docs to be version 'next' 2017-08-04 12:41:13 -07:00
Frank Li 9eb6ff2034 Update write-translations.js to find versioned sidebar category names 2017-08-04 10:44:54 -07:00
Frank Li 67592dcf8a Use versions.json file and move versioned, translated docs into translated_docs 2017-08-03 15:58:56 -07:00
Frank Li d3e3d209a4 Add comments for new versioning files 2017-08-03 11:14:56 -07:00