Commit graph

82 commits

Author SHA1 Message Date
Yangshun Tay
e8e3f42685
ESLintify Part 1 (#837)
* ESLint-ify

* Allow empty try/catch

* Escape regexp
2018-07-08 09:13:18 -07:00
Endilie Yacop Sucipto
3566483aa5 Fix wrong sitemap for alternate URL (#828) 2018-07-04 11:13:30 -07:00
Endilie Yacop Sucipto
21dcea2a31
Integrate eslint & precommit to codebase (#815)
* add eslint, precommit & refactor

* fix exit code 127

* modify contributing.md & add package-lock

* use .eslintrc.js
2018-07-01 12:27:31 +08:00
Endilie Yacop Sucipto
e9eef39760
Fix & refactor server routing + add tests (#799)
* 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
2018-06-29 16:15:34 +08:00
Endilie Yacop Sucipto
66b2033546
Fix bad routing regex for docs & blogs (#795)
* fix bad routing regex for docs & blogs

* extract to routing.js & add test

* add more test case

* address code review

* prettier
2018-06-24 14:10:32 +07:00
Yangshun Tay
1094dbd352
CSS revamp - Improve typography and overall styling (#757)
* Improve CSS code

* Fix blog layout

* Fix

* Refactor onPageNav

* More fixes

* Fix docs nav

* Use alternative hack

* Tweak clearfix
2018-06-19 21:46:15 -07:00
=^._.^=
62a2c7c1a5 Add option to disable live reload server during development (#766)
* add option to disable live reload server

* change live to watch, fix incorrect argument parsing code

* Update api-commands.md
2018-06-14 23:51:03 -07:00
Rémi Doreau
a77ae958db Duplicate code in readMetadata.js & versionFallback.js #725 (#726)
* Duplicate code in readMetadata.js & versionFallback.js #725

* Putting back package-lock.json

* Rename lib/server/utilsMetadata.js -> lib/server/metadataUtils.js

* Update splitHeader + extractMetadata

* Update prettier
2018-06-12 12:25:23 +08:00
Endilie Yacop Sucipto
c47af6be4b Enable custom meta description for custom pages (#752) 2018-06-10 09:35:30 -07:00
Endilie Yacop Sucipto
46661c8f1e Fix Express.js regex for docs & blog (#739) 2018-06-07 09:01:41 -07:00
Endilie Yacop Sucipto
d04b3ca87b Enable sub-directories in docs/ (#705) 2018-06-07 07:41:28 -07:00
Endilie Yacop Sucipto
31f0c27f81 Enable clean / extension-less url (#677) 2018-06-06 13:37:49 -07:00
Endilie Yacop Sucipto
b00e9d14e2 Fix assets not found in Express server (#720) 2018-06-02 11:28:04 -07:00
Endilie Yacop Sucipto
72f4f36939 Enable setting of title for custom pages
* allowing custom title on page component

* Update about-slash.js

* Update help.js

* Update users.js

* Update versions.js
2018-05-30 21:37:38 -07:00
artiebits
b5fd7bae73 Don't watch node_modules dir in dev server mode (#702)
* add a negate pattern for a watcher

* replace hardcoded docs path with getDocsPath()
2018-05-25 22:34:03 -07:00
Amy Lam
f9a09072e3 Add LiveReload (#663) 2018-05-17 16:17:56 -07:00
Yangshun Tay
1a6f2fc51c Add open in browser functionality (#643) 2018-05-07 09:46:14 -07:00
Erin Teo
5771549e75 Rename latestVersion to defaultVersion (#639)
* Rename lastVersion to defaultVersion

* Added defaultVersionShown to site-config doc

* Remove defaultVersionShown from siteConfig

* Update api-site-config.md
2018-05-05 17:24:39 -07:00
Sviatoslav
9c98142fea Ensure anchor links are unique per document (#574) 2018-05-03 19:36:12 -07:00
Yangshun Tay
d3fd347d21
Regenerate blog metadata on request to blog (#590) 2018-04-22 20:46:16 -07:00
Yangshun Tay
946e2cef90
Add <doctype HTML> to HTML pages (#566)
* Add doctype to static rendering

* Set content-type for CSS
2018-04-15 15:50:43 -07:00
Joel Marcey
bc777a8e65
Remove slash from join path in server.js 2018-03-13 09:12:30 -07:00
Sunny Luo
4a4fea7d8a Fix wrong versioned_docs file path (#501) 2018-03-13 09:05:26 -07:00
Joel Marcey
cbdab2ba11
Use Path module functions and properties in server and generate (#490) 2018-03-12 16:01:40 -07:00
Elian Ibaj
48ee457ec9 Add active link classes to site navigation menu (#463) 2018-03-04 08:53:31 -08:00
Sunny Luo
4a10be8002 Fix wrong latestVersion in server.js (#464) 2018-02-19 19:50:05 -08:00
Joel Marcey
8c71572d7a Remove rogue console.log for the status code 2018-01-29 21:05:28 -08:00
Joel Marcey
c81609d393
Send status code to server response for redirects (#408)
Also simplified the logic a bit to reduce duplication

Closes #404
2018-01-23 13:13:25 -08:00
jonathan-cowling
a241a46669 Make font-family as configurable parameter(#220) (#294)
We look for fonts object within siteConfig.js
2018-01-21 19:54:52 -08:00
Richard Zhang
e8599c05a8 Remove duplicate blog.xml route (#364) 2018-01-11 16:42:39 -08:00
Dániel Tar
654916ae98 Fix build on Windows (#381)
Use `path.dirName` instead of a `file.replace` on regex'd replaced string
2018-01-08 15:44:50 -08:00
Joel Marcey
665b2da09f Prettier fix for ce338fff64 2017-12-20 10:07:57 -08:00
Ricky Vetter
ce338fff64
Merge pull request #275 from rickyvetter/wrapPagesHTML
add wrapPagesHTML which renders html snippets in pages inside of a header + footer
2017-12-20 10:05:21 -08:00
Joel Marcey
db65f4b7fd Prettier fix for b96fae035f 2017-12-20 10:03:24 -08:00
António Afonso
b96fae035f Guard against lack of layouts in siteConfig.js (#330)
If a document states a `layout` in its header but `layouts` doesn't exist in `siteConfig.js` the doc would not render.
2017-12-20 09:55:10 -08:00
Richard Zhang
a5e963dba1 Issue 305 broken link because of language fixes (#322)
* 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
2017-12-19 17:44:43 -08:00
Joel Marcey
18c9a2ab31 Revert "Fixing Issue 305 - broken links because of language (#316)"
This reverts commit 7dc6c6c2da.
2017-12-19 09:23:41 -08:00
Richard Zhang
7dc6c6c2da Fixing Issue 305 - broken links because of language (#316)
* 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
2017-12-19 09:20:32 -08:00
Kunall Banerjee
c60131fdb4 cleanup startup logs (#291) 2017-12-16 16:51:52 -08:00
Hector Ramos
a7d81c629d Resolve conflicts 2017-12-12 12:49:02 -08:00
Ricky Vetter
c22203523f use faded primaryColor background for inline code snippets instead of link color (#276) 2017-12-12 12:46:52 -08:00
Ricky Vetter
786fdbb136 add wrapPagesHTML which renders html snippets in pages inside of a header + footer 2017-12-11 21:46:07 -08:00
Héctor Ramos
65421db62e Add Prettier Formatting (#258)
* 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
2017-12-04 19:21:02 -08:00
Joel Marcey
dc0c1390c4 [WIP] Allow custom subpath for docs within the "docs" folder
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
2017-11-08 20:16:05 -08:00
Héctor Ramos
09354ab738 [BREAKING] Rename Marked to MarkdownBlock (#162)
* Switch to Remarkable

* Clean up references to custom code blocks

* Remove valdiateDOMNesting warning

* Add syntax highlighting

* Add Reason support

* Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs

* Completely remove Prism and associated CSS rules

* Support loading plugins and scripts

* Remove CSS rules, allowing Highlight.js theme to be used entirely

* Remove unnecessary webplayer script

* Rename Marked to MarkdownBlock

* Rename Marked to MarkdownBlock

* Remove Marked.js
2017-10-30 15:47:13 -07:00
Héctor Ramos
b832176dc6 [markdown] Switch to Remarkable (#153)
* Switch to Remarkable
* Clean up references to custom code blocks
* Remove valdiateDOMNesting warning
* Add syntax highlighting
* Add Reason support
* Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs
* Completely remove Prism and associated CSS rules
* Support loading plugins and scripts
* Remove CSS rules, allowing Highlight.js theme to be used entirely
* Remove unnecessary webplayer script
2017-10-24 09:45:21 -07:00
Christopher Chedeau
57251a22c0 Ability to tweak the prism language (#146)
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]*(?=\()/,
    });
  },
```
2017-10-19 08:21:00 -07:00
Eric Nakagawa
a4695a3083 Code cleanups for consistency & adds Docusaurus to meta tags (#138)
* Add a made with Docusaurus meta tag

* Code cleanups and changes for clarity

* Add back pages string extraction
2017-10-18 14:40:16 -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
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