Commit graph

760 commits

Author SHA1 Message Date
Anshul Goyal
3155dc30dc
feat(v2): support for adding relative images and handling broken image links (#3069)
* all relative path in image url

* throw error if file doesn't present

* better error

* add @docusaurus/core to deps

* fix test
2020-07-21 15:27:45 +02:00
Sébastien Lorber
15e73daae7
feat(v2): global data + useGlobalData + docs versions dropdown (#2971)
* doc components initial simplification

* doc components initial simplification

* add docContext test

* Add poc of global data system + use it in the theme

* Revert "doc components initial simplification"

This reverts commit f657b4c4

* revert useless changes

* avoid loosing context on docs switch

* fix docs tests

* fix @generated/globalData ts declaration / es import

* typo

* revert bad commit

* refactor navbar in multiple parts + add navbar item types validation + try to fix remaining merge bugs

* add missing watch mode for plugin debug

* fix docs global data integration, move related hooks to docs plugin + convert to TS

* change versions link label

* fix activeClassName react warning

* improve docs global data system + contextual navbar dropdown

* fix bug preventing the deployment

* refactor the global data system to namespace automatically by plugin name + plugin id

* proper NavbarItem comp

* fix tests

* fix snapshot

* extract theme config schema in separate file + rename navbar links to navbar items

* minor typos

* polish docs components/api

* polish useDocs api surface

* fix the docs version suggestions comp + data

* refactors + add docsClientUtils unit tests

* Add documentation

* typo

* Add check for duplicate plugin ids detection

* multi-instance: createData plugin data should be namespaced by plugin instance id

* remove attempt for multi-instance support
2020-07-21 11:16:08 +02:00
Anshul Goyal
a51a56ec42
feat(v2): add support for serve command (#3080)
* add support for serve command

* add serve to init

* use existing choosePort function

* add --host

* add more docs

* add docs to deployment
2020-07-20 19:00:37 +02:00
Vandré Leal
020a48e7f6
docs(v2): showcase Runlet (#3076) 2020-07-19 23:55:47 +08:00
Sébastien Lorber
1272ab83fb
feat(v2): useDocusaurusContext().siteMetadata (#3058) 2020-07-16 12:46:21 +02:00
Anshul Goyal
a3849860ae
fix(v2):pass siteConfig as prop to pages (#3025)
* pass config as prop to pages

* use existing file

* Update packages/docusaurus-plugin-content-pages/src/index.ts

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-07-09 18:57:41 +02:00
Teik Jun
11751c20b0
docs(v2): correct the documentation for doc-only mode (#3040) 2020-07-09 17:15:23 +02:00
Paul Cowgill
233737ec3d
docs(v2): showcase user Tasit (#3034)
* Add Tasit to users showcase

* Add Tasit docs screenshot

* Update users.js

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-07-09 08:29:25 +08:00
Sébastien Lorber
a8b2e59a48
feat(v2): add useBaseUrlUtils() hook (#3033)
* add useBaseUrlUtils

* fix code highlighted lines
2020-07-08 17:51:59 +02:00
Jeremy Asuncion
9b3da59886
feat(v2): Plugin for Offline/PWA support (#2205)
* implement PWA plugin

* added pwa support for docusaurus website

* moved sw registration to client module

* moved compile function to webpack util

* build sw using webpack and render pwa popup

* implement @theme/PwaReloadPopup

* update website sw to use modules

* updated pwa readme

* fix header lint errors

* apply code formatting

* cache files only for mobile, saveData, or installed pwa

* added comments about clearing registrations

* fixed prettier error

* updated pwa README

* fix README JS

* move /blog => /blog/index.html logic to else branch

* add `alwaysPrecache` option

* updated docusaurus-plugin-pwa version

* added pwa to using-plugins.md

* review fixes

* re-disable restricted-globals to use self in service worker

* useless doc

* Update packages/docusaurus-plugin-pwa/README.md

Co-authored-by: Reece Dunham <me@rdil.rocks>

* Update packages/docusaurus-plugin-pwa/README.md

* update a bit pwa doc + minor refactors

* minor refactors + add workbox debug mode

* env PWA_ prefix

* typo

* minor refactor

* fix file output

* add serve:v2:ssl yarn command

* minor pwa fixes

* typo

* add dynamic import comment in SW

* comment

* let the PWA plugin implement its reload popup on his own

* pwa: add Joi options validation

* pwa plugin should have its own webpack/babel custom setup

* PWA:
- debug logs
- better SW params system
- offline mode activation strategies
- docs

* add pwa install gif

* pwa: popup -> reloadPopup + minor refactors

* fix process.env reading + better debug log

* minor fixes

* minor changes

* minor changes

Co-authored-by: slorber <lorber.sebastien@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: Reece Dunham <me@rdil.rocks>
2020-07-08 12:32:41 +02:00
Ben Gubler
46f794b2ba
docs(v2): showcase Eta (#3022) 2020-07-05 11:43:08 +08:00
Sébastien Lorber
8aa6ef47e4
feat(v2): configureWebpack merge strategy + use file-loader for common asset types (#2994)
* Add some default asset loaders
Add webpack merge strategy feature to enable plugins to prepend some webpack configuration (like the ideal image plugin that should override the default image loader)

* Add documentation for using assets from markdown

* add path prefix for webpack file loader

* renaming

* document Merge strategies

* rename mergeStrategies -> mergeStrategy
2020-07-01 19:06:02 +02:00
Sébastien Lorber
a5b2b6056b
feat(v2): add disableVersioning config to docs plugin (#2989)
* add disableVersioning config to docs plugin

* fix test

* fix test
2020-07-01 19:03:59 +02:00
Teik Jun
086d1b7135
fix(v2): fix broken links on versions page (#3017)
* fix(v2): fix broken links on versions page

* fix(v2): fix broken link to remark and rehype
2020-07-01 12:04:53 +02:00
Sébastien Lorber
c2bb03ab00
fix(v2): refactor color mode system (#3012)
* refactor color mode system to enable all possibilities

* fix destructuring bug

* colorMode validation + deprecation + minor name changes + doc

* rename method noFlashColorMode

* fix doc wording

* docs wording

* docs wording

* re-enable theme config merging/normalization + colorMode fixes

* document theme normalization

* code review changes
2020-06-30 12:21:20 +02:00
Teik Jun
2e055f4ae2
fix(v2): make client-redirect-plugin not baseUrl sensitive (#3010)
* feat(v2): use relative routes path in postBuild hook

* feat(v2): use relativeRoutesPath in other methods and modify tests

* fix(v2): fix D2 client redirects and tests

* feat(v2): add tests for relativeRoutesPaths

* fix(v2): fix some typos in configValidation

* fix(v2): fix an eslint warning and restart github action

* refactor(v2): create a removePrefix method

* refactor(v2): inline unnecessary method
2020-06-29 18:38:28 +02:00
Sam Zhou
ec3c281952
docs(v2): Document TypeScript support (#2997) 2020-06-26 12:09:21 +02:00
Alexey Pyltsyn
bdffd28b9f
feat(v2): allow skipping build docs for next version (#2877)
* feat(v2): allow skipping build docs for next version

* Refactor

* Refactor

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-06-25 17:21:05 +02:00
ehsan jso
8304e8253c
docs(v2): Fix typo in markdown-features (#2973)
* Fix typo in markdown-features

The code needed to be in npm syntax in order to work with npm2yarn

* Update markdown-features.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-06-25 17:05:51 +02:00
Rian Finnegan
65ce107331
docs(v2): showcase Amphora Data (#2991)
Co-authored-by: Rian Finnegan <rian@amphoradata.com>
2020-06-25 16:24:07 +02:00
Sam Zhou
5ccd24cc1f
feat(v2): Support swizzling TypeScript components (#2671)
* feat(v2): Support swizzling TypeScript components

* Add tsc --noEmit to tsc script in theme-classic

Now everything can pass the type checker! (although still a lot of any)

* Add tsconfig and types.d.ts to website

Improve developer experience.

As an example, I converted NotFound to tsx

* Apply type annotation suggestions

* Do not fallback to `getThemePath` if getTypeScriptThemePath is undefined

* Fix tsc

* Add module declaration for @theme-original/*

* Move babel cli to root package.json
2020-06-25 16:07:30 +02:00
Sébastien Lorber
20930dc837
docs(v2): add plugin redirects production build note (#2983)
* add plugin redirects production build note

* Update using-plugins.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-24 20:13:32 +02:00
Anshul Goyal
81d855355e
feat(v2): option and config validation life cycle method for official plugins (#2943)
* add validation for blog plugin

* fix wrong default component

* fix test and add yup to package.json

* remove console.log

* add validation for classic theme and code block theme

* add yup to packages

* remove console.log

* fix build

* fix logo required

* replaced yup with joi

* fix test

* remove hapi from docusuars core

* replace joi with @hapi/joi

* fix eslint

* fix remark plugin type

* change remark plugin validation to match documentation

* move schema to it's own file

* allow unknown only on outer theme object

* fix type for schema type

* fix yarn.lock

* support both commonjs and ES modules

* add docs for new lifecycle method
2020-06-24 20:08:16 +02:00
slorber
ce10646606 document that docs/blog-only modes should delete the existing homepage 2020-06-23 18:29:19 +02:00
Colin Diesh
4aa77651d3
docs(v2): update docs about creating a new plugin #2963 2020-06-19 15:32:36 +02:00
matbub
56067e4add
docs(v2): fix typos in plugin-content-pages example (#2967) 2020-06-19 14:17:28 +08:00
matbub
459b2c56fd
docs(v2): fix typo in plugin-content-pages example (#2966)
fixed grammar error in @docusaurus/plugin-content-pages example from 'blog' to 'page'
2020-06-19 12:57:35 +08:00
Yangshun Tay
73c835b518
docs(v2): rename 2.0.0-alpha.57 to 2.0.0-alpha.58 (#2958) 2020-06-18 16:10:52 +02:00
slorber
16ba6e54b6 v2.0.0-alpha.58 2020-06-18 14:02:26 +02:00
Marius Andra
162870d251
docs: mention posthog-docusaurus plugin (#2957) 2020-06-18 19:30:42 +08:00
Sébastien Lorber
38c8478e75
chore(v2): prepare v2.0.0.alpha-57 release (#2954)
* chore(v2): prepare v2.0.0.alpha-57 release

* update changelog

* fix changelog
2020-06-18 01:04:57 +08:00
Teik Jun
955e656496
docs(v2): add require.resolve to plugin imports on all pages (#2946) 2020-06-17 01:06:16 +08:00
Tom Brien
e97d2eab5a
docs(v2): wrap all plugin imports in require.resolve() (#2941)
* Wrap all plugin imports in require.resolve()

As per breaking change in 2.0.0-alpha0.56

* Wrap plugins in next version

* Revert "Wrap plugins in next version"

This reverts commit 5afa06e243.
2020-06-16 22:47:07 +08:00
Drew Alexander
d365b7424b
docs(v2): add useThemeContext note (#2934)
* docs: add note to useThemeContext api docs

* Update example usage
2020-06-15 12:39:17 +02:00
Drew Alexander
c341f457fb
docs(v2): add router implementation note (#2935) 2020-06-15 12:37:49 +02:00
Teik Jun
8eed245000
docs(v2): add documentation for multiple blogs (#2933)
* docs(v2): add documentation for multiple blogs

* docs(v2): fix typos of docusaurus

* docs(v2): make the same changes in the latest version of documentation

* docs(v2): remove an empty blockquote

* docs(v2): improve documentation for multiple blogs
2020-06-15 03:18:37 +08:00
Sam Zhou
729b3cae9b
feat(v2): Allow configuring babel via babel.config.js (#2903)
* feat(v2): Allow configuring babel via docusaurus.config.js

* Use api.caller feature from babel to avoid expose isServer to users

* Remove unused optional config key

* Make babel loader resolve and require config file
2020-06-12 11:03:00 +08:00
Sébastien Lorber
68a1bb1ebf
Merge pull request #2793 from slorber/feature/client-side-redirects
feat(v2): docusaurus-plugin-client-redirects
2020-06-10 17:36:57 +02:00
slorber
c964a1e3b6 add introduction redirect 2020-06-10 17:22:08 +02:00
Yangshun Tay
3e43955df6 docs(v2): fix typo in ExecutionEnvironment example 2020-06-09 21:52:24 +08:00
Anshul Goyal
c97fd9f1d7
docs(v2): fix GitHub action workflow in documentation (#2910) 2020-06-09 16:29:55 +08:00
Alexey Pyltsyn
afe9ff91a4
chore(v2): replace classnames with clsx (#2895) 2020-06-07 13:40:06 +08:00
Alexey Pyltsyn
36cf2eca87
refactor(v2): synchronize yarn/npm command on site (#2897) 2020-06-06 16:49:49 +08:00
Sébastien Lorber
1003a15d1f
polish(v2): improve Docusaurus 1 to 2 migration developer experience (#2884)
* improve markdown parsing errors by adding file path to error

* typo commit

* Add default nav item position to right (as v1)

* improve error when sidebar references unexisting document

* parseMarkdownFile: improve errors by providing hint about using "" to avoid parsing errors, if using special characters

* improve subcategory migration error for Unknown sidebar item type

* improve unrecognizedFields error

* typo

* fix inline snapshots

* improve the migration docs

* improve the migration docs

* improve migration doc

* Update migrating-from-v1-to-v2.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-06-06 11:16:50 +08:00
Sam Zhou
8aa520c314
fix(v2): Do not automatically change tab when a non-existing option is selected (#2893) 2020-06-06 11:11:42 +08:00
Paul Glezen
4278cebf67
docs(v2): fix typo in command on installation page (#2886)
* Fix installation.md typo

Checking the docusaurus version should be done with

```
npx docusaurus --version
```

not 

```
npm docusaurus --version
```

otherwise it prints the version of `npm` instead of `docusaurus`.

* docs: Fixed installation.md for checking version.

Specifying `npm` for the version will yield the version of NPM
instead of docusaurus itself.  Use `npx` for the docusaurus version.
2020-06-06 04:14:53 +03:00
Yangshun Tay
2d8abe150f
docs(v2): make .nojekyll warning more obvious (#2887) 2020-06-05 10:22:06 +08:00
Sébastien Lorber
953abd8154
feat(v2): allow adding components to react-live scope (#2826)
* feat(v2): add components to react-live scope (#2807)

* fix admonition issue + improve react-live scope doc

* fix again admonition :(

* remove forwarding of mdx components to react-live scope (for now)

* remove useless dep
2020-06-04 15:18:42 +03:00
slorber
a02f90c064 Merge branch 'master' into feature/client-side-redirects 2020-06-04 11:42:00 +02:00
Alexey Pyltsyn
5c6670b94e fix(v2): fix broken URL to introduction 2020-06-04 03:38:01 +03:00