Commit graph

2682 commits

Author SHA1 Message Date
ylemkimon
64293bf87f
fix(v2): add missing lodash.flatmap dependency (#3191) 2020-08-03 12:13:32 +02:00
ylemkimon
96631736ee
fix(v2): add missing dependencies to chalk and lodash (#3192) 2020-08-03 12:12:57 +02:00
Sam Zhou
5c3a00727c
fix(v2): Add a missing whitespace before prompt to use npm run serve (#3188) 2020-08-02 16:28:39 +08:00
Sébastien Lorber
15896a21fe
chore(v1): release v1.14.5 (#3184) 2020-08-01 16:03:21 +02:00
Sébastien Lorber
48b996773c
chore(v2): prepare v2.0.0.alpha-61 release (#3182)
* alpha 61 release

* doc prettier

* v2.0.0-alpha.61
2020-08-01 15:24:46 +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
62c61c9d8e
fix(v2): fix markdown images always using webpack url-loader (#3180)
* fix markdown images always using file-loader + move assets to a dedicated subfolder

* update snapshot
2020-07-31 20:50:39 +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
Drew Alexander
53b28d2bb2
feat(v2): dark mode toggle customization (#3127)
* Add dark/light style fields to config

* Update yarn.lock

* Remove css content

* Add documentation

* Add icon fields to toggle component

* Add config validation fields

* Remove changes from docusaurus.config

* Add unicode documentation example

* Fix default values

* Add color mode config default

* Add lodash to theme-classic

* Change themeConfigSchema name to match other packages

* Add themeConfig color-mode tests

* Add default config merge function

* Remove unneeded object merging

* Add more documentation
2020-07-31 15:39:12 +02:00
François Chalifour
e442ac95ee
feat(v2): improve Algolia search accessibility (#3166)
* feat(v2): improve Algolia search accessbility

* fix(v2): make sure to import modal before opening
2020-07-31 15:37:10 +02:00
Faizan
d560a52ef2
fix(v2): tab label showing outline & background when clicked (#3171)
* fix: tab label showing outline & background when clicked

* show outline when tab pressed otherwise do not

* listen to all keyboard keys* for outline

* quick fix on typo

* edits on handleMouseEvent func
2020-07-31 15:34:46 +02:00
Sébastien Lorber
68f4bd00f4
fix(v2): fix link items refusing attributes like target, rel etc... (#3168) 2020-07-30 15:46:33 +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
Bucky Maler
e9a2b1d9c6
fix(v2): inability for users to pin their docusaurus version (#3162) 2020-07-30 14:44:39 +02:00
Sébastien Lorber
1083454dbd
chore(v2): prepare v2.0.0.alpha-60 release (#3154)
* alpha 60

* v2.0.0-alpha.60

* update publish guide
2020-07-29 17:45:54 +02:00
Teik Jun
e7ec93b0b9
test(v2): add tests for config validation (#3142)
* test(v2): add tests for correctly defined fields

* test(v2): add test for remarkPlugins and rehypePlugins validation

* test(v2): modify tests and comments
2020-07-29 16:23:11 +02:00
Sébastien Lorber
d28a29f2c9
fix(v2): BrowserOnly should not return undefined (#3149) 2020-07-28 20:17:47 +02:00
Sébastien Lorber
e1b2963f31
fix(v2): absolute Links should be automatically prefixed by baseurl (#3143)
* put back the automatic withBaseUrl call, but only for urls starting with / (because useBaseUrl behavior is buggy and forces relative links to absolute links)

* fix Link typo
2020-07-28 19:40:34 +02:00
slorber
4247fc4bb1 remove automatic withBaseUrl in Link 2020-07-28 17:16:29 +02:00
Sébastien Lorber
d25d4b08f6
fix(v2): remove buggy routesLoaded + deprecate routesLoaded lifecycle (#3141)
* remove bad deletion of docs / if conflicting with a page

* deprecate routesLoaded
2020-07-28 14:28:14 +02:00
Sébastien Lorber
ac757e9dff
feat(v2): add validation escape hatch (#3134)
* add isValidationDisabledEscapeHatch system

* add bug reporting hint for validation errors

* typo
2020-07-28 14:27:47 +02:00
Bartosz Kaszubowski
aa7430e168
feat(v1): add 'slugPreprocessor' config option to allow users customize the hash links (#3124)
* fix(v1): remove HTML content from hash links

* fix one more test

* rewrite changes as new feature to prevent breaking changes
2020-07-28 14:17:28 +02:00
Sébastien Lorber
d1a27efe8c
fix(v2): navbar, allow unknown attributes (#3140) 2020-07-28 12:52:01 +02:00
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
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
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
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
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
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
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
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
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