Commit graph

602 commits

Author SHA1 Message Date
Alexey Pyltsyn
0360364570
fix(v2): do not focus on skip link if page refreshed (#4797)
* fix(v2): do not focus on skip link if page refreshed

* rename ref

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-05-18 15:55:11 +02:00
Sébastien Lorber
ab19070ab5
feat(v2): Add hebrew theme translations (#4811) 2021-05-18 15:22:38 +02:00
Alexey Pyltsyn
d2a455992d
fix(v2): fix minor a11y issue with headings (#4792) 2021-05-18 14:41:30 +02:00
Alexey Pyltsyn
be9f9d6df7
refactor(v2): remove transition on body element (#4795) 2021-05-18 14:38:13 +02:00
Alexey Pyltsyn
b561679fd4
fix(v2): unbreak enhanced width of doc item wrapper (#4793) 2021-05-18 12:56:09 +02:00
PsychTech
73c24ecdcb
feat(v2): add theme Danish translation (#4798) 2021-05-17 19:34:57 +02:00
Sébastien Lorber
01adf25b0f
chore(v2): TypeScript, use isolatedModules (#4790)
* Use isolatedModules

* better solution for useDocs?

* fix blog-only mode

* fix bad useDocs import
2021-05-14 15:36:55 +02:00
Sébastien Lorber
7e4d7671c8
chore(v2): prepare v2.0.0-beta.0 release (#4774)
* beta.0 version docs + changelog

* fix config for beta switch

* v2.0.0-beta.0
2021-05-12 16:07:15 +02:00
Rodrigo Moreno
b995b0742a
feat(v2): add es translations for docusaurus-theme-classic (#4762) 2021-05-11 11:03:29 +02:00
Forresst
35e17ef129
fix(v2): improve french translation for theme-classic (#4750) 2021-05-07 11:02:43 +02:00
Sébastien Lorber
0ef0d27c51
chore(v2): prepare v2.0.0.alpha-75 release (#4707)
* alpha 75

* v2.0.0-alpha.75
2021-04-30 18:41:55 +02:00
Reece Dunham
05e7250c08
feat(v2): Webpack 5, PostCSS 8 (#4089)
* Initial webpack 5 work

* It works on my machine (lol)

* Committing a bit more work

* It works - sorta

* Update packages/docusaurus/package.json

* at least fix prettier /shrug

* making more progress. build should work now, css stuff is still a bit broken

* Terser things

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Working on things

* Vendor webpack

* Repair chunks, and tests

* Rerun prettier

* Re-add client prefetching

* Update snapshots

* Update snapshots

* I hope this works

* Remove redundant dev server code

* relock

* Trying to reduce memory usage and fix things

* Dead code elim

* Search bar works!!!

* Prefetching should work again

* lock

* ts issue

* Repair snapshot

* Run prettier

* Fix the CI for now

* fix lint-prettier

* clean-css works, now for the other one

* Fix lockfile

* Fixes prettier

* Other css minification works!!!

* Add clean-css options, fix webpack versions

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Fix tests and several of the webpack loaders

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Re-add support for simple css minifier

* Update other related dependencies

* Fix lockfile

* Dev server fixups

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Simplify css things

* Update webpack, try with postcss 7

* Other cssnano repairs

* fix lockfile

* Clean up the babel preset

* Fix lockfile

* Bump RL SSR version

* Fix the build errors

* Lockfile fix

* It works again

* webpack 5 should close compiler after run

* add proper webpack5 persistent caching config

* upgrade webpack deps again

* reduce build perf timeouts to avoid build time regressions

* test if incremental build can run on netlify

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* test

* test

* test

* test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* fix existsSync() calls

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* migrate existing stats.warningsFilter to config.ignoreWarnings

* remove stats from postBuild lifecycle data doc, as it is likely unused (we'll add it back if someone ask for it)

* improve build.ts TS issues + move some sync code to async

* cleanup TS of start.ts

* fix TS error

* fix TS issues

* fix TS issues

* fix ts error

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* script cleanup

* script cleanup

* re-enable @typescript-eslint/ban-ts-comment

* Deprecate getCacheLoader / getBabelLoader but keep retrocompatibility

* useless TS

* fix and comment gca(chunkName) prefetching function

* remove deprecated mainTemplate.requireFn

* temporarily use react-loadable-ssr-addon-v5-slorber until PR merged: https://github.com/facebook/docusaurus/pull/4089

* comment unsafeCache option

* add explicit and more precise webpack targets

* splitChunks, use new type: "css/mini-extract" as it seems recommended for webpack 5

* webpack error handling:
- log error.details as documented
- keep using react-dev-utils/formatWebpackMessages for now

* fix webpack5 warnings for evalSourceMapMiddleware.js

* typo

* rename webpackHotDevClient

* make all modifications of react-dev-utils explicit with a comment

* revert LogPlugin adapter

* loader-utils update

* add useful share cache comment

* add useful comments regarding the null-loader used in SSR for css files

* upgrade webpack-merge in a retrocompatible way

* use MiniCssExtractPlugin.emit false as recommended

* use @docusaurus/responsive-loader

* revert MiniCssExtractPlugin esModule: false change

* add link to PR for custom CleanWebpackPlugin

* pwa: add fallback to env variable or webpack 5 fails to build

* upgrade to CssMinimizerPlugin 2.0

* only build en locale for windows tests

* line breaks between errors

* add useful comment

* Fix e2e tests with Yarn2 not finding new init template dependencies

* fix bad import

* disable browserslist target as webpack already tries to use browserlists if a config is found, and it is a problem for existing sites

* webpack5 TS fixes

* fix getMinimizer order (even if it does not work yet)

* update postcss to v8, fix cssnano minimizer errors

* add NavbarItem position to types (useful for QuestDB site upgrade to Webpack5)

* add webpack cache env variable to reduce risk of webpack 5 adoption

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-30 18:06:53 +02:00
Sébastien Lorber
6f29a1826a
chore(v2): prepare v2.0.0.alpha-74 release (#4690)
* alpha 74

* v2.0.0-alpha.74
2021-04-27 16:38:56 +02:00
Sébastien Lorber
8ebbc17c7b
fix(v2): fix title logic (meta vs heading) + ignore fixed anchor id syntax (#4688)
* parseMarkdownContentTitle should ignore {#my-anchor-id} syntax

* use frontMatter.title in priority for page meta title

* parseMarkdownString should ignore fixed anchor ids syntax

* docs: make the distinction between headingTitle + metaTitle more clear + add useful todo

* docs: make the distinction between headingTitle + metaTitle more clear + add useful todo

* writeHeadingIds should ignore top-level md title like "# Title"
=> we are not supposed to create anchor links for h1 headers

* update tests

* fix doc tests
2021-04-27 15:44:46 +02:00
Sébastien Lorber
bca796545b
chore(v2): update infima (#4689) 2021-04-27 15:39:07 +02:00
Alexey Pyltsyn
5b6dcbdfd1
refactor(v2): align external icon on right (#4682) 2021-04-26 19:22:07 +02:00
Sam Zhou
2dcbd50b60
fix(v2): Unbreak blog post title by handling title fallback in LayoutHead (#4667)
* fix(v2): Unbreak blog post title

* Revert "fix(v2): Unbreak blog post title"

This reverts commit d21444b6fb.

* Move title fallback to LayoutHead

* Make SEO component only render title when not null
2021-04-22 19:04:34 +02:00
Sébastien Lorber
4d49945775
chore(v2): prepare v2.0.0.alpha-73 release (#4628)
* add changelog

* add alpha 73

* run prettier on versions file (+ ignore it as we don't care much and it's annoying when releasing)

* v2.0.0-alpha.73
2021-04-16 12:48:10 +02:00
Sébastien Lorber
93bd8fec7b
chore(v2): update Infima to alpha.22 (#4627) 2021-04-16 11:28:34 +02:00
Sébastien Lorber
38a1003233
refactor(v2): toggleResponsiveSidebar => more stable callback (#4626) 2021-04-16 10:27:16 +02:00
Alexey Pyltsyn
42d02369d8
fix(v2): center align content if no sidebar exists (#4621) 2021-04-16 10:20:49 +02:00
Marco Enrico
70574618e9
feat(v2): Add Filipino default translations to theme (#4624)
* Create fil.json

Add default Filipino translations.

* Update packages/docusaurus-theme-classic/codeTranslations/fil.json

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-04-16 10:07:43 +02:00
Alexey Pyltsyn
41aede985e
fix(v2): restore toggle responsive sidebar button (#4620) 2021-04-16 00:50:19 +03:00
Sébastien Lorber
073fdeae8e
refactor(v2): rename class main-docs-wrapper to docs-wrapper (#4619) 2021-04-15 18:56:41 +02:00
Sébastien Lorber
2d89d5c84f
refactor(v2): simplify and optimize sidebar (#4617)
* safe sidebar refactor

* simplify and optimize a bit the sidebar code
2021-04-15 18:43:38 +02:00
Steven Hansel
cd47d8a815
feat(v2): add unique page/wrapper className to each theme pages (#4511)
* chore: add theme classnames for blog pages

* fix: component syntax error in blog pages

* style: fix camelcase issue with theme class names

* chore: add theme classnames for doc page and mdx page

* chore: make wrapper classnames in blog and doc page into constants

* chore: add main wrapper theme class name for layout component

* fix: change wrong theme classnames and improve naming

* chore: add wrapper theme class name for mdx page

* docs: add docs for theme class names

* docs: use raw-loader to import documentation and add some comments

* docs: provide more detail to comment

* chore: rename ThemeClassname.ts to ThemeClassName.ts

Co-authored-by: Lisa Chandra <52909743+lisa761@users.noreply.github.com>
Co-authored-by: Javid <singularity.javid@gmail.com>
2021-04-15 18:36:40 +02:00
Sébastien Lorber
db79d462ab
feat(v2): auto-generated sidebars, frontmatter-less sites (#4582)
* POC of autogenerated sidebars

* use combine-promises utility lib

* autogenerated sidebar poc working

* Revert "autogenerated sidebar poc working"

This reverts commit c81da980

* POC of auto-generated sidebars for community docs

* update tests

* add initial test suite for autogenerated sidebars + fix some edge cases

* Improve autogen sidebars: strip more number prefixes in folder breadcrumb + slugs

* fix typo!

* Add tests for partially generated sidebars + fix edge cases + extract sidebar generation code

* Ability to read category metadatas file from a file in the category

* fix tests

* change position of API

* ability to extract number prefix

* stable system to enable position frontmatter

* fix tests for autogen sidebar position

* renamings

* restore community sidebars

* rename frontmatter position -> sidebar_position

* make sidebarItemsGenerator fn configurable

* minor changes

* rename dirPath => dirName

* Make the init template use autogenerated sidebars

* fix options

* fix docusaurus site: remove test docs

* add _category_ file to docs pathsToWatch

* add _category_ file to docs pathsToWatch

* tutorial: use sidebar_position instead of file number prefixes

* Adapt Docusaurus tutorial for autogenerated sidebars

* remove slug: /

* polish the homepage template

* rename _category_ sidebar_position to just "position"

* test for custom sidebarItemsGenerator fn

* fix category metadata + add link to report tutorial issues

* fix absolute path breaking tests

* fix absolute path breaking tests

* Add test for floating number sidebar_position

* add sidebarItemsGenerator unit tests

* add processSidebars unit tests

* Fix init template broken links

* windows test

* increase code translations test timeout

* cleanup mockCategoryMetadataFiles after windows test fixed

* update init template positions

* fix windows tests

* fix comment

* Add autogenerated sidebar items documentation + rewrite the full sidebars page doc

* add useful comment

* fix code block title
2021-04-15 16:20:11 +02:00
Alexey Pyltsyn
836f92708a
refactor(v2): replace react-toggle with own implementation (#4608)
* refactor(v2): replace react-toggle with own implementation

* Extract toggle into child component
2021-04-15 16:15:07 +02:00
duanwilliam
1abadbaeca
fix(v2): fix code block title parsing, support multiple metastring attributes (#4541)
* feat: lazy match classic theme code block title

* feat: allow single quotes for classic theme code block title

* refactor(v2): extract parseCodeBlockTitle function

extract `parseCodeBlockTitle` function to add tests for title parsing

* test(v2): add tests for parseCodeBlockTitle

* move code block title parser to theme-common

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-14 10:24:52 +02:00
John Knox
2c57f44bd6
fix(v2): fail-safe usage of browser storage (localStorage/sessionStorage) when access is denied (#4501)
* fix: Fix unsafe uses of localStorage

Puts all uses of localStorage behind an abstraction which doesn't fail
when localStorage isn't available.

* cleanup fail-safe browser storage usage

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-13 12:38:12 +02:00
Alexey Pyltsyn
bfea8d632d
refactor(v2): increase heading anchor offset (#4601) 2021-04-12 18:59:59 +02:00
Alexey Pyltsyn
2b4a52e27a
fix(v2): use page title from config if not set (#4600) 2021-04-12 18:39:34 +02:00
Alexey Pyltsyn
6b0df65786
fix(v2): render escaped HTML entities inside code properly (#4598) 2021-04-12 18:33:38 +02:00
Alexey Pyltsyn
7c56f816c6
perf(v2): avoid rerender of sidebar items while scrolling (#4603) 2021-04-12 18:14:02 +02:00
Lisa Chandra
154ba62627
feat(v2): theme default translations hindi (#4596)
* docs: theme default translations for hindi

* docs: fix lastUpdatedAtBy for hindi

Co-authored-by: Javid <singularity.javid@gmail.com>
2021-04-12 18:02:56 +02:00
serut
902aad55bb
fix(v2): DocNavbarItem error message (#4554)
* Fix DocNavbarItem error message

* Clean code

* clean code
2021-04-02 17:07:41 +02:00
Tiago Ribeiro
fb07bd871c
feat(v2): add pt-PT translations for docusaurus-theme-classic (#4536)
* Added a JSON file with the portuguese (Portugal) translations

* Changed the file according to linting

* Add a new line at the end of the file

* Changes because of prettier, there was a whitespace at the end of a line
2021-03-30 10:47:21 +02:00
Thiago Sciotta
61414f9a11
feat(v2): add Brazilian Portuguese translation (#4525) 2021-03-29 17:06:50 +02:00
Sébastien Lorber
78349480af
chore: rename v2.docusaurus.io urls after domain switch + redirect + cleanups (#4490)
* prepare v1-v2 domain switch

* rename v1 changelog as CHANGELOG-1.x.md

* switch v1/v2 changelogs

* Cleanup v2.docusaurus.io urls

* add netlify domain redirect

* remove circleci config

* remove another circle file
2021-03-22 20:57:49 +01:00
Armano
f12e8b596d
perf(v2): reduce amount of navbar renders while scrolling (#4473) 2021-03-22 19:32:11 +01:00
Armano
80e40c36e5
fix(v2): select correct tab when items are incorrectly ordered (#4468) 2021-03-19 18:12:58 +01:00
Armano
61548d3995
refactor(v2): add missing types to theme-classic useTheme (#4467) 2021-03-19 14:31:38 +01:00
Sébastien Lorber
9e881b46c8
fix(v2): i18n fixes (#4466) 2021-03-19 14:23:31 +01:00
Armano
15107ee099
refactor(v2): correct client types and type aliases (#4451) 2021-03-19 11:32:38 +01:00
Sébastien Lorber
9117a5b7df
chore: fb json header commit typo (#4463) 2021-03-18 20:01:11 +01:00
Sébastien Lorber
892d832a3e
fix(v2): Fix i18n staging deployment due to json typo (#4461) 2021-03-18 19:28:14 +01:00
Sébastien Lorber
60d189a91c
fix(v2): Export Joi from validation-utils package (#4459) 2021-03-18 19:27:51 +01:00
Sam Zhou
83d043ecb3
chore(v2): Fix more linter warnings (#4450) 2021-03-18 18:05:09 +01:00
miku86
93dab24bec
polish(v2): Add german translations (#4448)
* Add german translations

Hey folks,

I updated some missing translations.

Greetings
Michael

* Update packages/docusaurus-theme-classic/codeTranslations/de.json

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-03-18 11:46:23 +01:00
Sébastien Lorber
806fdbaf27
feat(v2): infer default i18n locale config from locale code (#4449)
* improve locale default config

* remove localeConfigs from i18n tutorial

* better i18n types, tests and Intl.DisplayNames integration
2021-03-18 11:43:07 +01:00