Commit graph

68 commits

Author SHA1 Message Date
Joshua Chen
4872decb42
docs: normalize CodeBlock highlighting (#6223) 2021-12-30 10:51:00 +08:00
Joshua Chen
73ee356949
docs: audit grammar issues (#6203)
* docs: audit grammar mistakes

* fix code block language

* revert change

* let's get another
2021-12-27 19:34:04 +08:00
Sébastien Lorber
b393700a61
feat: async plugin creator functions (#6166) 2021-12-22 19:10:49 +01:00
Joshua Chen
9078fd9fb2
docs: refactor & refine lifecycle API docs (#5918)
* docs: refactor & refine lifecycle API docs

* Fix links

* More writeup

* Rewording

* Rename path

* Use README

* Fix links

* Add redirects

* Do the same for latest version as well

* Move folder

* Fix broken link
2021-12-21 14:54:04 +08:00
Joshua Chen
4478dd9659
docs: make API sidebar partially autogenerated (#5917)
* docs: make API sidebar autogenerated

* fix paths
2021-11-10 14:08:50 +08:00
Thanasis Katsadas
1e0a32924b
docs(v2): Fix typo in using-plugins.md (#5750) 2021-10-20 15:38:25 +02:00
silva-nick
aebfc45627
docs(v2): fix typo in code block on Using plugins page (#4910) 2021-06-05 17:24:45 +03:00
besemuna
69be003e12
feat(v2): allow config plugins as function or [function,options] (#4618)
* feat : update PluginSchema validation

* feat : update plugin init functionality

* test : add and update tests

* fix : tests

* refactor : init.ts

* test : update test

* docs : add functional plugin docs

* fix little issues

* refactor : refactor code

* minor refactors

* simplify initPlugins code

* simplify initPlugin + add custom validation error message

* fix snapshots

* improve function plugin doc

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-05-15 19:33:05 +02:00
Alexey Pyltsyn
291a72fbae
docs(v2): use explicit heading IDs (#4460) 2021-03-19 11:00:41 +01:00
Alexey Pyltsyn
f13448d5e1
chore(v2): upgrade dependencies + require Node 12 (#4223)
* chore(v2): upgrade dependencies

* Set minimum Node.js version to 12.13

* Fix test

* Upgrade copy-text-to-clipboard

* Bump Node versions

* Update .nvmrc

* mark cacheTime as forbidded field

* Downgrade jest to v25.2.7

* Increase Node version for Windows CI

* Test fix

* Attempt to fix Windows CI

* Downgrade execa

* fix async test errors

* Upgrade execa

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-18 15:12:42 +01:00
Sébastien Lorber
d5d6e2fba2
docs(v2): Add documentation for docs multi-instance support (#3978)
* Add documentation for docs multi-instance support

* Add documentation for docs multi-instance support
2020-12-30 19:41:42 +01:00
Sébastien Lorber
8f47babb46
docs(v2): Docs refactoring and reorganization (#3831)
* stable refactor of plugins api documentation

* plugins sidebar not collapsed by default as small?

* theme docs reorg

* Refactor migration guide doc

* fix broken link
2020-11-30 14:07:08 +01:00
Roman Bug
6c6200e473
docs(v2): fix some misspellings (#3636)
Some misspellings fixed.

Co-authored-by: Roman Zhukov <romanzhukov@yandex-team.ru>
2020-10-25 18:48:28 +03:00
Christian Bromann
7f6fba9d9e
docs(v2): removed obsolete "you" identifier (#3576) 2020-10-19 09:24:51 +03: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
DeadEnglish
d1510770f4
feat(v2): add option for blog meta title #3571
* feat(blog-meta-title): add support for additional meta title

* retrocompatible blog title

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-12 13:23:54 +02:00
Rémi Doreau
d3a01458a3
feat(v2): add beforeDefaultRemarkPlugins/beforeDefaultRehypePlugins options to all md content plugins (#3467)
* fix(plugin-content-docs): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* fix(plugin-content-blog): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* fix(plugin-content-pages): add beforeDefaultRemarkPlugins + beforeDefaultRehypePlugins options

* feat(website-docs): overriding remark-rehype plugins

* fix(plugin-content): update beforeDefaultRehypePlugins/beforeDefaultRemarkPlugins types

* fix(plugin-content-docs): fix tests
2020-09-29 14:48:34 +02:00
Méril
d844ff6107
feat(v2): add an option to toggle trailing slash for urls in sitemap (#3426) 2020-09-09 15:48:47 +02:00
Sébastien Lorber
9857f7b2b5
feat(v2): officially release @docusaurus/plugin-debug (#3392)
* Add json styling to config debug

* Style debug content page

* Add style and collapse depth to json viewer

* Add style to debug layout

* Add style to metadata debug

* Add style support to registry debugger

* Remove default content if other instances are present

* Change colors for more contrast

* Add debug routes styles

* Add active link style

* Fix container css issues

* Style registry debug page

* Remove unused style modules

* Add white space to style files

* Add font scaling

* Fix prettier errors

* Add child routes to route debug

* Readd default content plugin json

* Add empty home page to debug

* Prettier

* Revert "Add empty home page to debug"
This should be included in a separate PR
This reverts commit 9c43c9f7fb.

* Set colors to dark theme

* Add plugin debug doc + minor fixes + expose global data

* more debug plugin doc

Co-authored-by: Drewbi <drewalexander986@gmail.com>
2020-09-02 15:42:34 +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
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
Anshul Goyal
f234c407f1
feat(v2): add support to ignore files in pages plugin (#3196)
* add support to ignore pages

* fix import problem

* Update website/docs/guides/creating-pages.md

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

* Revert "fix import problem"

This reverts commit 4457a2e938.

* revert

* fix slash

* forbid frontmatter

* fix formatting

* Update website/docs/guides/creating-pages.md

* Update website/src/pages/examples/_chapter1.md

* Update website/src/pages/examples/_chapter2.mdx

* Update website/src/pages/examples/markdownPageExample.md

* Update website/src/pages/examples/markdownPageExample.md

* Update website/src/pages/examples/markdownPageExample.md

* Update website/src/pages/examples/markdownPageExample.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-08-05 21:35:55 +02:00
Teik Jun
300aecb8bc
feat(v2): warn user when there are conflicting routes (#3083)
* feat(v2): add warning for path override

* feat(v2): check all routes recursively

* docs(v2): add docs for conflicting routes

* style(v2): improve comments in code

* refactor(v2): remove unused lifecycle method from docs plugin

* Revert "refactor(v2): remove unused lifecycle method from docs plugin"

This reverts commit 8b2caaa091.

* feat(v2): add option for changing duplicate path behavior

* feat(v2): decouple logging from logic and detect duplicate routes in one pass

* test(v2): fix failing tests

* test(v2): add tests for duplicateRoutes

* test(v2): add test for handleDuplicateRoutes

* style(v2): add else statement

* docs(v2): modify documentation for duplicate routes

* docs(v2): move doc into guides folder

* fix(v2): fix broken links

* docs(v2): move docs for docusaurus config into api folder

* style(v2): add comments

* refactor(v2): extract getFinalRoutes

* refactor(v2): scope getFinalRoutes to docusaurus package

* test(v2): remove obsolete snapshots

* docs(v2): remove some docs

* fix(v2): rerun github actions

* docs(v2): change slug of docs in api folder

* refactor(v2): extract out a reportMessage method

* refactor(v2): extract getAllFinalRoutes

* test(v2): replace snapshots with actual value

* style(v2): remove unnecessary comment and change type

* chore(v2): remove unused dependency

* style(v2): remove unused code

* Update packages/docusaurus/src/server/utils.ts

* Update website/docs/guides/creating-pages.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-07-31 21:14:49 +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
Xuqian
4af25cd597
feat(v2): support custom description for blog-only mode (#2359)
* feat: support custom description on blog page

resolve conflicts

* feat(v2): allow additional props to pass to route components

resolve conflicts

* Update blogDescription feature

* Update doc for blogDescription

* Remove test blogDescription config

* Fix blogDescription schema validation

* Fix minor errors

Co-authored-by: Xuqian <zxuqian@163.com>
2020-07-30 15:41:15 +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
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
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
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
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
slorber
f6d1b2b9ca add type comments to createRedirects doc 2020-06-03 20:09:56 +02:00
slorber
812daa8af5 improve doc 2020-06-03 18:13:10 +02:00
slorber
4e8b361d00 remove github pages mention for server-side redirects 2020-06-03 15:17:02 +02:00
Sébastien Lorber
c251eaf7b8
Update website/docs/using-plugins.md
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-06-03 12:55:09 +02:00
slorber
67f88c12e7 doc typo 2020-06-01 17:38:49 +02:00
slorber
b8168e2287 document @docusaurus/plugin-client-redirects in migration guide + fix doc typo 2020-06-01 17:33:20 +02:00
slorber
d6afb44082 add doc for @docusaurus/plugin-client-redirects 2020-05-27 16:14:18 +02:00
Yangshun Tay
2dbd0488d7 docs(v2): document beforeDefaultRemarkPlugins and beforeDefaultRehypePlugins 2020-05-23 06:12:24 +08:00
Alexey Pyltsyn
fc161b8455
docs(v2): various improvements (#2768) 2020-05-18 11:37:53 +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
Noah Silvera
a8ab0d661e
docs(v2): mention that plugin-ideal-image only perform compression on a production build (#2572)
* Add a note that `plugin-ideal-image` only perform compression on a production build. 

In reference to https://github.com/facebook/docusaurus/issues/2571

* Update using-plugins.md

* Update using-plugins.md

* Update using-plugins.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-04-10 10:48:20 +08:00
Noah Silvera
dcf91ebfe4
docs(v2): fix syntax error for plugin config (#2570)
* Fix syntax error for plugin config

* Update using-plugins.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-04-10 10:43:02 +08:00
Fanny
5e664a1f26
feat(v2): add edit url in post page (#2524)
* Add edit page url in docs

* feat(v2): Create EditPage component

* feat(v2): Improve component

* Add test

* çhore(v2): update description

* çhore(v2): update url

* fix(v2): test

* fix(v2): test

* feat(v2): change the prop of EditPage component

* chore(v2): Remove packages

* feat(v2): Update old tests

* chore(v2): fix package

* fix(v2): fix editUrl

* docs(v2): document editUrl

* --

* --

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-04-05 17:34:48 +08:00
José Renan
95fdfe7e15
feat(v2): add blog post estimated reading time (#2531)
* feat: add estimated reading time to blog posts

* docs: add showReadingTime on plugin docs

* test: update plugin-content-blog tests to cover readingTime

* Update index.js

* Update using-plugins.md

* Update index.js

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-04-05 15:08:42 +08:00
Yangshun Tay
3dd83be988
docs(v2): proofread docs (#2527) 2020-04-04 14:05:59 +08:00
Yangshun Tay
36ea74504e
docs(v2): use codeblock title syntax instead of comments (#2473) 2020-03-29 01:08:50 +08:00