* Fix bad routing regex for sitemap & feed
* add tests for sitemap & feed
* use next middleware function if file nto found
* add pages routing & test
* refactor + add more test for page routing
* extension-less url routing + test
* refactor out requestFile
* add dot routing + test to handle special case like http://localhost:3000/blog/2018/05/27/1.13.0
* exit properly
* add more test for sitemap
* update nits from my phone
* without having having to worry about site design.
Let me know if double having is intentional
* distinguish case of no translation and en lang
* prettier recommends
* distinguish case of no translation and en lang
* prettier recommends
* merge with latest origin/master changes
* typo
* link with language fixes
* do not show language dropdown if only one enabled
* check translation outside of LanguageDropDown.render
* without having having to worry about site design.
Let me know if double having is intentional
* distinguish case of no translation and en lang
* prettier recommends
* distinguish case of no translation and en lang
* prettier recommends
* merge with latest origin/master changes
* typo
* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs
* Remove trailing-comma as we are using Node 6 on Circle
* Use latest Node 6 LTS version in Circle
* Remove unused test
e.g.,
The default is
`docs/*.md`
This allows
`docs/somedir/*.md`
or
`docs/somedir/anotherdir/*.md`
Notes:
- All URLs are still /docs/*.html (i.e. the subpath does not get preserved in the link).
- Files in `translated_docs`, if any, will still only be one level
- This should not affect translations or versioning
I want to be able to tweak the default tokenizer for syntax highlighting. The current one isn't as good as it could be.
With this PR, I would be able to add this to the siteConfig and it would give me the Prism access so that I can get proper syntax highlighting:
```js
prism: function(Prism) {
Prism.languages.javascript = Prism.languages.extend("javascript", {
keyword: /\b(alias|as|async|await|base class|...|with)\b/,
constant: /\b[A-Z][a-zA-Z0-9_]*\b/,
builtin: /\bopen_file|...|invariant_violation|invariant|getcwd\b/,
function: /\b[_$a-z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/,
});
},
```
* 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.
* 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