Commit graph

3486 commits

Author SHA1 Message Date
Hob Adams
33bb9087cf
feat(v2): add accessible label for Algolia search button (#3138)
The button doesn't contain text which fails lighthouse a11y tests + isn't nice for screen readers.
2020-07-28 18:08:40 +08:00
Sébastien Lorber
a1db6f7d75
feat(v2): add themeConfig validation to algolia theme (#3133)
* Algolia theme option validation

* validateThemeConfig

* remove useless runtime check
2020-07-27 18:12:56 +02:00
Teik Jun
2159c4fcfb
fix(v2): make config validation less strict (#3120)
* fix(v2): make navbar title validation less strict

* fix(v2): fix validation for rehype plugin

* fix(v2): allow empty string for routeBasePath

* fix(v2): fix validation for stylesheets and scripts field

* fix(v2): rerun CI

* fix(v2): relax check for stylesheet href
2020-07-27 13:58:24 +02:00
Sébastien Lorber
41d5ac63fd
chore(v2): remove old versions (#3130) 2020-07-27 18:38:53 +08:00
Sébastien Lorber
3b16fb15e9
docs(v2): publish changes after release (#3116) 2020-07-27 12:17:59 +02:00
Sébastien Lorber
0eb9c207cf
chore(v2): v2.0.0.alpha-59 release (#3114)
* alpha 59 release preparation

* v2.0.0-alpha.59
2020-07-24 16:22:51 +02:00
slorber
886dee7874 chore(v2): prettier doc 2020-07-24 15:27:25 +02:00
Teik Jun
a9109fba7b
docs(v2): add documentation for migration command (#3026)
* docs(v2): add docs for migration command

* docs(v2): fix admonitions

* docs(v2): make minor changes to instructions

* docs(v2): add information about option flags

* docs(v2): put migration docs in guide folder

* fix(v2): fix broken links

* fix(v2): fix more broken links

* docs(v2): fix a broken link again

* fix(v2): rerun github action

* Update website/docs/guides/migrating-from-v1-to-v2.md

* Update website/docs/guides/migrating-from-v1-to-v2.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2020-07-24 15:15:26 +02:00
Sébastien Lorber
a0ef8939a1
chore(v2): ability to test the migration cli easily (#3113)
* ability to test the migration cli easily

* add node scripts to help test migration cli (locally + CI)

* add test for frontmatter quotify

* more tests for shouldQuotifyFrontMatter

* typo

* updated yarn lock
2020-07-24 15:07:24 +02:00
Sébastien Lorber
6aec331963
broken links: we should ignore folders when looking for existing files in the build folder (#3107) 2020-07-24 13:49:29 +02:00
Anshul Goyal
a78f703366
feat(v2): v1-v2 migration cli automate migration from v1 to v2 (#3015)
* add poc for migration tool

* fix version

* fix path

* fix some type error

* fix type errors

* fix commad

* delete package.lock.json

* ignore lib folder in eslint

* ignore lib in prettier

* fix missing version

* fix sidebar in next

* use primaey color

* fix navbar link

* fix footer

* sanatize front-matter for gray-matter

* add e2e test

* fixworkflow

* add unit test

* chore(v2): fix eslint error

* refactor(v2): use descriptive variable names

* refactor(v2): refactor createProjectStructure

* refactor(v2): refactor migrateDocusaurusProject

* refactor(v2): fix eslint errors

* fix(v2): fix mistake

* use path.join

* remove console.log

* try automate migrating md file to mdx

* fix types not found

* fix types

* remove unused fixture

* use package.json for version

* add support for pages

* add support

* sanitize fortmatter only in case of special character

* chore(v2): add color to dependencies

* feat(v2): initialize config with range of color and add logs

* chore(v2): add glob dependency

* fix(v2): fix color generation

* fix(v2): fix type issue

* feat(v2): add all unknown fields to customFields

* fix(v2): fix css mistake

* fix lerna

* fix(v2): fix github actions

* feat(v2): add option flag for migrating pages

* fix special character

* remove depulicate build

* fix test

* remove unwanted file

* fix frontmatter

* remove unused file

* rerun the test

* fix links

* feat(v2): filter out more fields from customFields

* feat(v2): filter out deprecated fields from customFields

* fix items

* fix types

* merge master

* revert docs

* fix doc

* fix broken link

* fix test

* test

* fix ci

* fix ci

* fix ci

* fix ci

* fix frontmatter

* log custom fields

Co-authored-by: teikjun <teikjunhci@gmail.com>
2020-07-24 12:52:16 +02:00
Sébastien Lorber
0ecd71ec06
fix(v2): navbar items: href/to validation is too strict (not retrocompatible) (#3106) 2020-07-24 12:49:15 +02:00
Sébastien Lorber
f926178e63
fix(v2): baseUrl is wrongly appended to anchor links (#3112)
* fix baseurl being wrongly appended to anchor links

* fix baseurl being wrongly appended to anchor links
2020-07-24 18:40:24 +08:00
Daniel Hochman
08a726e154
docs(v2): add clutch to showcase (#3094) 2020-07-24 09:01:59 +08:00
Sébastien Lorber
9fab79c975
fix(vfix docs instance path (#3108) 2020-07-23 19:43:25 +02:00
Sébastien Lorber
2c5675cbc1
feat(v2): add docusaurus script for npm users (#3105) 2020-07-24 00:37:02 +08:00
Ayan Banerjee
0f8a64428c
docs(v2):Add azure-pipelines CI guide (#3101)
Closes https://github.com/facebook/docusaurus/issues/1208
2020-07-23 17:36:45 +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
336c3e54da
fix(v2): netlify.toml shouldn't affect v1 site deployment config (#3099)
* netlify.toml shouldn't affect v1 site deployment config

* try to fix netlify setup

* try to fix netlify setup

* try to fix netlify setup
2020-07-23 11:51:28 +02:00
Ayan Banerjee
cbe3c7775b
docs(v1): Add azure-pipelines CI guide (#3098)
Closes https://github.com/facebook/docusaurus/issues/1208
2020-07-23 11:42:14 +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
dependabot[bot]
4bc50e4a52
chore(deps): bump lodash from 4.17.15 to 4.17.19 (#3068)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-21 19:14:26 +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
f4434b2e42
feat(v2): absolute slugs and slug resolution system (#3084)
* rework slug to allow absolute slugs and slug resolution

* add slug metadata tests

* refactor docs metadata test + fix slug bugs

* fix tests

* fix docs tests failing due to randomness + update snapshot

* add test for addLeadingSlash
2020-07-21 18:26:30 +02:00
Sébastien Lorber
6730590c1e
refactor(v2): async md image transformer + pathname protocol as an escape hatch (#3087)
* async md image transformer + pathname protocol as an escape hatch

* make error messages computer agnostic by using relative paths

* fix error message relative path
2020-07-21 17:45:06 +02:00
Arsalan Khattak
3e22c1ae5c
doc(v2): replace heading position (#3086) 2020-07-21 17:40:36 +02:00
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
Mahfoudh Arous
6a511b805a
docs(v1): fixing few typos and enhancing few sentences clarity (#3082) 2020-07-20 16:48:37 +02:00
Jordan Liu
3cfbf4b70d
docs: Updated link for #docusaurus-2-dev discord (#3078) 2020-07-20 11:59:15 +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
Frida Hjelm
5d08ef8ef1
fix(v2): classify link hrefs with protocol identifier as internal (#3063) 2020-07-15 19:05:33 +02:00
Sam Zhou
7660005db8
chore(v2): Adopt corejs 3 and only import at entry point (#3055) 2020-07-14 09:36:00 +08:00
Teik Jun
f947036595
feat(v2): notify users when docusaurus version is outdated (#3032)
* feat(v2): notify users when docusaurus version is outdated

* style(v2): add comments

* fix(v2): fix spacing in message

* feat(v2): make update notifier work on first run
2020-07-13 15:51:11 +02:00
Sam Zhou
3ebe245b55
feat(v2): Collect plugin versions to allow them to be inspected in debug plugin (#3050) 2020-07-13 15:46:48 +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
Deepak Giri
04fc4190f9
feat(v2): Support keywords meta in blog posts (#3038)
* #3036: support rendering  meta tag for blog posts (only in theme-classic)

* #3036: add keywords in an existing blog post
2020-07-09 17:02:00 +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
Teik Jun
e5afd1866d
fix(v2): change description for blog post paginator (#3029) 2020-07-08 17:10:40 +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
Sébastien Lorber
9265de982b
chore(v2): refactor scripts + add theme-classic watchmode (#2998) 2020-07-01 18:30:44 +02:00
Sam Zhou
cf5babd5c1
chore(v2): Add E2E test for yarn v2 (#3008)
* chore(v2): Add E2E test for yarn v2

* Remove root node_modules to prevent them from accessible in e2e test

The purpose of e2e test is to ensure that the docusaurus inited website can stand on its own. The root node_modules remain accessible according to how node resolution works and it might interfere with the test. Remove them for safety.

* Add @mdx-js/react to docusaurus init templates
2020-07-01 12:06:03 +02:00