Commit graph

117 commits

Author SHA1 Message Date
iAmir
8f2d898f22
feat(v2): onBrokenMarkdownLinks config (#3658)
* refactor(v2): move `reportMessage` from `core/src/server/utils` to `utils` package

* feat(v2): handle broken markdown links by using onBrokenLinks prop from siteconfig

* feat(v2): add a new site config prop called `onBrokenMarkdownLinks`

works like onBrokenLinks, but only for markdown links

* feat(v2): add `onBrokenMarkdownLinks` to API docs

* some changes regarding test issues after adding `onBrokenMarkdownLink`

* Update website/versioned_docs/version-2.0.0-alpha.66/api/docusaurus.config.js.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-10-31 18:04:56 +01:00
Alexey Pyltsyn
14cdd72ae4
feat(v2): add ability to hide doc sidebar (#3615)
* feat(v2): add ability to hide doc sidebar

* Use relative imports
2020-10-22 11:23:15 +02:00
Sébastien Lorber
e4c1626106
feat(v2): blog sidebar (#3593)
* blog sidebar POC

* polish blog post sidebar

* add doc for blogSidebarCount

* Update packages/docusaurus-theme-classic/src/theme/BlogSidebar/styles.module.css

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-16 19:12:05 +02:00
Fanny
4760e1225b
feat(v2): Extract npm2yarn plugin (#3469)
* chore(v2): add dependency

* test(v2): Add npm2yarn tests

* feat(v2): Move npm2yarn to a new remark plugin

* remark npm2yarn plugin => ready to release

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-15 19:30:12 +02:00
Sébastien Lorber
aed1ce7850
chore(v2): enable new contextual search feature (#3591) 2020-10-15 15:34:04 +02:00
Sébastien Lorber
21264f5ed0
feat(v2): contextual search, dynamic Algolia facetFilters (#3550)
* POC of contextual search dynamic filters

* fix useSearchTags bugs

* contextual search should use preferred version  (persisted in storage)

* Contextual search: make system decoupled from algolia + wire proper meta tags and facet filters

* rework doc tag + minor refactorings

* update snapshots

* polish contextual search

* add Algolia validateThemeConfig tests
2020-10-15 12:16:30 +02:00
Alexey Pyltsyn
39d6787471
fix(v2): use absolute path to manifest file (#3554)
* fix(v2): use absolute path to manifest file

* Use base url
2020-10-08 18:27:26 +02:00
Sébastien Lorber
649882d867
feat(v2): version dropdown before/after items + move site "All Versions" link (#3548)
* add dropdownItemsAfter option + reorg a bit docusaurus site navbar

* fix isActive  react warning

* Update theme-classic.md

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-07 19:58:00 +03:00
Sébastien Lorber
5b79f2ebc2
feat(v2): site client modules (#3545)
* site client modules

* Update website/docs/api/docusaurus.config.js.md

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-07 14:44:14 +03:00
Sébastien Lorber
9ba28a378f
feat(v2): doc navbar item type (#3539)
* provide DocNavbarItem type

* update snapshots

* Fix Docusaurus tabs CSS

* revert navbar tabs css/style changes, instead apply simple navbar__link--active class + make it configurable

* Update website/docs/theme-classic.md

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>

* add dropdownActiveClassDisabled option

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-07 14:42:24 +03:00
Sébastien Lorber
85ff9bd33a
chore(v2): v2 website should make it easy to contribute to upstream docs (#3506)
* To incitate to contribute to upstream docs, we could set the upstream docs the main docs so that editUrl will modify upstream docs in priority

* add unreleased label instead of next
2020-10-01 16:13:11 +02:00
Bartosz Kaszubowski
ae2c063929
feat(v2): allow to use array of files in customCss field (#3474)
* feat(v2): allow to use array of files in customCss field

* customCss array:
- fix bug (push instead of concat)
- update docs
- add theme config validation + tests

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-09-28 18:15:41 +02:00
Ash
37989a00c3
fix(v2): Correctly resolve sw.js path on windows (#3436)
* fix(v2): Correctly resolve sw.js path on windows

* Just fixing the icons too

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-09-11 15:19:11 +02:00
Sébastien Lorber
21852948ce
feat(v2): ability to add/override theme html metadatas (#3406)
* ability to add/override theme html metadatas
see https://github.com/facebook/docusaurus/issues/3024

* refactor/fix validateThemeConfig tests
2020-09-04 16:36:56 +02:00
Sébastien Lorber
0baf3c2e54
fix(v2): DocSearch should keep working after a new release (part 2/2) (#3397) 2020-09-03 17:28:24 +02:00
Sébastien Lorber
9c34f68a7a
fix(v2): DocSearch should keep working after a new release (#3393)
* We should create an alias for searching last version of docs on DocSearch/Algolia, so that on new version publish, search still works even if new version is not already indexed (https://github.com/facebook/docusaurus/issues/3391)

* commit missing snapshot

* update after algolia changes

* put back facetFilters: [`version:${versions[0]}`] until latest facet is indexed
2020-09-03 14:35:46 +02:00
Sébastien Lorber
a4769e3f30
fix(v2): alpha 62 doc fixes (#3381)
* deprecated nextVersionLabel option

* useActivePlugin failfast option

* remove deprecated option nextVersionLabel

* routeBasePath: '' should be forbidden

* routeBasePath: '' should be forbidden

* Docs: do not show version badge if there is only 1 version: https://github.com/facebook/docusaurus/issues/3362

* allow sidebars file to not exist: fallback to empty sidebars
https://githu.com/facebook/docusaurus/issues/3366
2020-09-01 16:31:33 +02:00
Sébastien Lorber
d8cfabb66a
feat(v2): docs options.onlyIncludeVersions (#3373)
* docs options.onlyIncludeVersions

* adapt docsVersionDropdown if we render a single version

* fix bad error message

* fix netlify deploy when versioning is disabled
2020-08-31 17:08:24 +02:00
Sébastien Lorber
ae877f2990
feat(v2): docs version configuration: lastVersion, version.{path,label} (#3357)
* add new docs versioning options

* Add some tests for new versioning options

* Add some docs for version configurations

* try to fix broken link detection after /docs/ root paths have been removed on deploy previews

* improve dev/deploypreview versioning configurations

* disable custom current version path, as it produces broken links

* readVersionDocs should not be order sensitive

* fix versions page according to versioning config

* fix versions page according to versioning config
2020-08-28 18:37:49 +02:00
Fanny
8c05aa8e94
feat(v2): bootstrap theme, preset, template, CI previews (#2981)
* fix(v2): doc sidebar

* chore(v2): prettier

* fix(v2): docs navbar path

* fix(v2): fix error about activepath

* chore(v2): prettier

* feat(v2): change active color

* feat(v2): Add bootstrap doc

* docs(v2): Update preset

* doc(v2): finish bootstrap documentation

* chore(v2): run lint

* doc(v2): update hook

* fix theme bootstrap layout (far from perfect)

* Try to fix bootstrap theme and deploy it!

* fix netlify error

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-08-17 20:18:37 +02:00
Sébastien Lorber
fe281a8ebe
feat(v2): debug pages + debug layout + ability to debug content (#3229)
* improve debug plugin:
- add multiple debug pages + debug layout
- ability to debug plugin contentLoaded data

* add missing dependency

* fix broken test

* improve content rendering a bit

* create basic DebugJsonView

* fix ReactJson SSR issues
2020-08-07 11:47:43 +02:00
Sébastien Lorber
0a33a52301
fix(v2): deprecate docs homePageId in favor of frontmatter "slug: /" (#3228)
* homePageId => deprecated

* docs prettier
2020-08-06 18:31:50 +02:00
Sébastien Lorber
59f705ee66
feat(v2): blog + docs multi-instance plugins (#3204)
* stable createData namespacing + second-blog dogfooding

* Docs: support multi-instance + make community docs a separate instance

* tests: add 2nd docs instance to versioned site

* fix docs version cli tests

* fix docs versioning cli

* typo

* team: add link to my site

* better extendCli integration

* fix metadata tests

* tests for versioned site with second docs instance

* move some validation code to utils-validation

* fix missing dependency

* fix bad compiled output due to importing constants in ./client folder

* make docs tests easier to maintain

* refactors

* prevent lodash imports in client bundle

* redirect old community docs to new urls
2020-08-05 18:27:55 +02:00
Sébastien Lorber
7cceee7e38
feat(v2): markdown pages (#3158)
* markdown pages POC

* add remark admonition, mdx provider, yarn2npm...

* pluginContentPages md/mdx tests

* pluginContentPages md/mdx tests

* add relative file path test link to showcase link problem

* fix Markdown pages issues after merge

* fix broken links found in markdown pages

* fix tests

* factorize common validation in @docusaurus/utils-validation

* add some documentation

* add using plugins doc

* minor md pages fixes
2020-07-31 16:04:56 +02:00
François Chalifour
298522ff66
feat(v2): introduce DocSearch v3 search (#2815)
* feat(v2): introduce DocSearch v3 search

* chore(deps): update @docsearch/react

* refactor: use arrow functions in callbacks

* fix: display warning when `algolia` config is missing

* feat: add link to search page

* chore: delete unused style file

* feat(website): specify DocSearch primary color

* fix(search): add "all" word

* feat(search): add `generateSearchPageHref` hook

* chore(deps): update @docsearch/react

* fix(website): remove `hitsPerPage` search parameter

* fix(search): use `baseUrl`

* fix(search): rename `generateSearchPageLink`

* fix(search): fix scroll position on mobile

* fix(search): update query on URL change

* fix(search): close DocSearch modal on See More click

* refactor(search): use `useSearchQuery` to update query from URL

* feat(search): support `/` keyboard shortcut

* fix(search): forward Algolia config to DocSearch

* chore(search): update `@docsearch/react`

* fix(search): encode search value to search page

* fix(search): use `withBaseUrl` on links

* feat(search): attach Docusaurus version to user agents

* docs(docsearch): update DocSearch section

* chore(deps): update @docsearch/react

* feat(search): apply search styles to website

* docs(search): update DocSearch doc

* chore(deps): update @docsearch/react

* chore: update lock file

* chore(deps): update algoliasearch

* fix(website): remove special character in CSS

* docs(search): remove special character in CSS
2020-07-23 14:36:38 +02:00
Sébastien Lorber
811c7ae4e9
fix(v2): fix recent baseurl issues (#3093)
* try to fix the baseUrl related issues

* fix some newly detected broken links

* fix baseurl and broken link issues

* try to configure netlify to use baseUrl deployment

* add proper netlify settings?

* add proper netlify settings?

* add proper netlify settings?

* test commit

* try to fix the redirects

* cleanup working conf

* minor redirect fix
2020-07-22 19:55:40 +02:00
Sébastien Lorber
27f384a67c
refactor(v2): improve navbar menu + generated config should be normalized (#3088)
* improve navbar menu

* fix errors due to forcePrependBaseUrl being normalized to true

* fix TS errors
2020-07-22 11:56:28 +02:00
Sébastien Lorber
8ff28e3fe4
feat(v2): broken links detection (#3059)
* add broken links checker

* polish

* finalize broken links detection feature

* note broken links is only for prod build

* fix broken link on template

* fix test snapshot

* fix bad merge
2020-07-21 19:13:34 +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
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
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
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
slorber
c964a1e3b6 add introduction redirect 2020-06-10 17:22:08 +02: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
slorber
00a79f69c7 Add chalk non-blocking errors + fix config bug 2020-06-03 19:28:57 +02:00
slorber
77c7ac0ddb add more redirect tests to d2 site config 2020-06-03 18:15:12 +02:00
slorber
e057bbd662 add proper redirect config for tests 2020-06-03 17:55:46 +02:00
slorber
c224efb8a1 Add better options validation error 2020-06-03 17:53:54 +02:00
slorber
362573a391 Merge branch 'master' into feature/client-side-redirects 2020-05-27 16:51:04 +02:00
Alexey Pyltsyn
2105700fb7
refactor(v2): various tweaks to website (#2816) 2020-05-27 20:56:59 +08:00
slorber
0c330df5cc fix template import issue 2020-05-25 20:06:52 +02:00
slorber
fd47ca1925 feat(v2): docusaurus-plugin-client-redirects 2020-05-22 20:15:16 +02:00
Alexey Pyltsyn
05c3aa31f4
fix(v2): do not highlight root docs path in navbar (#2778) 2020-05-20 16:49:11 +08:00
Alexey Pyltsyn
c7baa125e6
chore(v2): mention about docs home page in init templates (#2763)
* chore(v2): mention about docs home page in init templates

* use home page id for docs

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-05-18 13:14:06 +08:00
Alexey Pyltsyn
00a8e9e365
feat(v2): allow home page for docs (#2652)
* feat(v2): allow home page for docs

* Refactor

* Remove debugging info 🤦‍♂️

* Add sort routes for first test case

* Sort child routes for consistency
2020-05-17 17:48:02 +08:00
Alexey Pyltsyn
7389a60514
fix(v2): add a11y support for dropdown (#2672)
* fix(v2): add a11y support for dropdown

* fix(v2): add aria-label for navbar GH link
2020-04-27 14:17:55 +03:00
Alexey Pyltsyn
c0e531e5d9
feat(v2): add ability to specify CSS class for navbar item (#2660)
* feat(v2): add ability to specify CSS class for navbar item

* Fix linting issues
2020-04-27 02:21:36 +08:00
Sam Zhou
41b3c66f5e
fix(v2): fix copyright footer (#2640)
* fix(v2): Fix copyright footer

* Run prettier
2020-04-22 08:52:59 +03:00