-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Jest website to Docusaurus v2 #11021
Merged
SimenB
merged 142 commits into
jestjs:jest-website-v2
from
jest-website-migration:docusaurus-2
Feb 12, 2021
Merged
Changes from 141 commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
2145b36
initial migration
slorber d706009
temporarily disable all versions
slorber 42163ef
MDX: fix Configuration.md
slorber 3b52a9d
ignore website-v2 eslint gitignore
slorber ade283d
attempt to fix the homepage
slorber 7616199
fix help page
slorber 4f0ecbc
fix versions page
slorber 93ec7c7
fix videos page
slorber d07a442
minor homepage details
slorber e69597e
temp disable the configuration page
slorber f78522b
remove blog post copy
slorber 4636434
import css
slorber 5abe568
backy backport of v1 component library
slorber 968de50
backy backport of v1 component library
slorber 3e52b5d
jest 2 proper Algolia index
slorber a125893
Rewire the landing page animation
slorber 8031108
remove some legacy v1 CSS
slorber 863f6a7
better backporting of v1 legacy CSS
slorber 4e86553
improve landing buttons css
slorber c676930
apply mainContainerV1
slorber a2f8cc2
better integration of the legacy v1 comp library CSS
slorber 2f45d1e
Add footer
slorber a4ec419
fix landing anim
slorber 564f317
fix some broken links
slorber a04f2bf
better navbar
slorber 0868699
Add sass plugin + social icons + improve homepage
slorber e0c2ea7
update v1 comp library classes
slorber b0068e3
fix twitter button
slorber df4b7c5
remove usage of customFields
slorber d2ec77e
remove annoying eslint warnings
slorber f753d5f
remove useless css/js
slorber 4feecb0
rem some useless css
slorber 44d3a74
Add better MarkdownBlock.js v1 support
slorber 5998c83
fix docs broken links
slorber 199a4bd
fix help page
slorber b50cc31
improve video page css
slorber af9932e
add some temp versions + cleanup /versions page useless CSS
slorber 9353020
improve videos page
slorber 6a80fbe
clean version page
slorber f5c1567
smaller landing buttons
slorber 84bfa04
improve dark theme contrast
slorber c6fde84
remove some useless CSS
slorber 9cd7a54
improve v1 CompLibrary backport
slorber f6f2899
revert config files
slorber d69bc8e
fix MDX escaping in Configuration.md docs
slorber 50f4516
escape [
slorber 7138750
Configuration.md fixes
slorber 247408e
Fix Configuration.md escaping
slorber db5fab7
fix all broken links with .html extension
slorber 896e0c8
add all versions
slorber 6322a61
fix last broken link
slorber 5761b5e
chore: update homepage and footer, add codeblocks light theme
Simek c83fab6
chore: small tweaks
Simek 62349a1
chore: typo fix
Simek fc60e5b
chore: change dark code theme
Simek 225cbc1
Merge pull request #1 from Simek/homepage-and-footer-tweaks
slorber f0429d6
chore: add basic custom prism themes
Simek 00f204c
fix: fix Navbar logo and links positions and order
Simek 40c8a90
fix: use correct key for background, add inserted to darkTheme
Simek 82fbfc8
Merge pull request #7 from Simek/prism-custom-themes-init
slorber e6b5c23
Merge pull request #8 from Simek/fix-navbar-logo-and-order
slorber c7e9500
Split Jest doc in 2 sidebars
slorber 7777210
Add Crowdin localisation support for v2
slorber 5581b85
ignore scss files too
slorber 2e1ca92
fix zh-Hans lang
slorber 474d602
Add Crowdin integration
slorber 5ed680c
fix netlify
slorber 7e701f4
fix netlify
slorber a734316
fix netlify
slorber 5936977
fix netlify
slorber e31cc17
fix netlify
slorber c3791d0
fix netlify
slorber 40d42dc
fix netlify
slorber 443c54d
Merge pull request #11 from jest-website-migration/add-i18n
slorber 2dd390c
remove useless language mapping comments
slorber 8a5d177
Add temporary locale dropdown
slorber 6515993
Merge branch 'docusaurus-2' into split-sidebars
slorber 5ba8821
Merge pull request #10 from jest-website-migration/split-sidebars
slorber 4e34eb9
temporarily remove some languages
slorber 120ce52
temp fix for locale dropdown
slorber 0c7df81
temp fix for locale dropdown
slorber ddf5fad
disable Jest site markdown pages
slorber 37ec25c
Add algolia docsearch CSS theming
slorber dbd5d74
temp dropdown fix
slorber f60f058
Add CNAME for GH domain
slorber 0577685
re-enable all Jest locales
slorber aac2aaa
fix features alignment issue, see https://github.com/jest-website-mig…
slorber 5557bcc
replace v1 usage of <AUTOGENERATED_TABLE_OF_CONTENTS> by v2 TOCInline…
slorber c241aa7
Add real locale dropdown to navbar
slorber 8b7fd2b
update canary version
slorber 04a58ce
handle translated markdown block case
slorber 3f19d6d
remove unused versions for Docusaurus v2
slorber 758549a
disable fixCrowdinTranslations temporarily as it may not be useful an…
slorber 1f4d06e
Add yarn write-translations to Netlify process
slorber 09bfd3e
remove code transformations from older versions
slorber 790cd6c
remove original_id v1 useless frontmatter
slorber ddf6195
add basic redirects plugin setup
slorber bd039b3
Merge branch 'master' into docusaurus-2
slorber 3273950
use @crowdin/cli official npm package
slorber f6a3809
Upgrade to latest canary
slorber 4aaea17
Prepare Jest v2 website
slorber 6a414f7
fix lint rules + prettier
slorber 3753be4
fix lint rules + prettier
slorber 43d5e4a
Fix FB copyright headers
slorber 2e0b219
Add netlify redirects
slorber 3eed61a
test commit
slorber 5c3deda
test
slorber c1c35ba
Merge pull request #12 from jest-website-migration/config-netlify
slorber 75df92e
fix jest blog post layout
slorber 2bc5132
fix prettier config
slorber 907c4c9
Add pwa support
slorber bb9ab32
add missing PWA manifest
slorber ac3a4a8
fix manifest icon error
slorber 3308db3
Merge pull request #13 from jest-website-migration/docu-pwa
slorber be4ccb7
Add crowdin script logging
slorber 765045e
Update docs/JestObjectAPI.md
slorber 146a975
Update .gitignore
slorber a4f31f9
Update docs/TutorialAsync.md
slorber fc1e778
handle code review
slorber f0fd9fd
migrate v1 class comps to fn comps
slorber abde9a5
restore deleted settings file
slorber debfcd6
restore README.md
slorber ceb4468
add theme color constant
slorber f596aa9
add theme color constant
slorber 666cade
extract i18n config in separate file
slorber dd54da7
fix crowdin script
slorber ce204ea
removed useless docusaurus script as per review comment
slorber 3a866bb
upgrade docusaurus
slorber d403e81
fix css-loader issues in docusaurus sass plugin after deps upgrade
slorber 21c88d2
configure jest 404 redirects localized on Netlify
slorber 5d963a7
Add archived versions
slorber e10c682
Add localized edit urls
slorber fbdf95a
Remove CircleCi config that deploys to GH pages
slorber b7a7629
fix RN tutorial doc link
slorber 3c0804d
complete website/README.md
slorber 6ae0b75
use yarn patch for docusaurus sass problem
slorber fd34cd0
Update website/package.json
slorber 9fa5ce4
Merge remote-tracking branch 'upstream/jest-website-v2' into docusaur…
slorber 8e2e769
update yarn lock
slorber 7460798
remove 26.0-5 docs
slorber f13694e
rename 26.6 to 26.x
slorber ee538c9
fix link
slorber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,48 @@ | ||
project_identifier_env: CROWDIN_JEST_PROJECT_ID | ||
api_key_env: CROWDIN_JEST_API_KEY | ||
base_path: './' | ||
# | ||
# Your Crowdin credentials | ||
# | ||
project_id: '428892' | ||
api_token_env: 'CROWDIN_PERSONAL_TOKEN' | ||
|
||
base_path: '.' | ||
base_url: 'https://api.crowdin.com' | ||
preserve_hierarchy: true | ||
|
||
# See Yaml anchors: https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/ | ||
languages_mapping: &languages_mapping | ||
locale: | ||
'es-ES': 'es-ES' | ||
'ja': 'ja' | ||
'pt-BR': 'pt-BR' | ||
'ro': 'ro' | ||
'ru': 'ru' | ||
'uk': 'uk' | ||
'zh-CN': 'zh-Hans' | ||
|
||
# | ||
# Files configuration | ||
# see https://support.crowdin.com/configuration-file/ | ||
# | ||
files: | ||
- source: '/docs/*.md' | ||
translation: '/website/translated_docs/%locale%/%original_file_name%' | ||
languages_mapping: &anchor | ||
locale: | ||
'af': 'af' | ||
'ar': 'ar' | ||
'bs-BA': 'bs-BA' | ||
'ca': 'ca' | ||
'cs': 'cs' | ||
'da': 'da' | ||
'de': 'de' | ||
'el': 'el' | ||
'es-ES': 'es-ES' | ||
'fa': 'fa-IR' | ||
'fi': 'fi' | ||
'fr': 'fr' | ||
'he': 'he' | ||
'hu': 'hu' | ||
'id': 'id-ID' | ||
'it': 'it' | ||
'ja': 'ja' | ||
'ko': 'ko' | ||
'mr': 'mr-IN' | ||
'nl': 'nl' | ||
'no': 'no-NO' | ||
'pl': 'pl' | ||
'pt-BR': 'pt-BR' | ||
'pt-PT': 'pt-PT' | ||
'ro': 'ro' | ||
'ru': 'ru' | ||
'sk': 'sk-SK' | ||
'sr': 'sr' | ||
'sv-SE': 'sv-SE' | ||
'tr': 'tr' | ||
'uk': 'uk' | ||
'vi': 'vi' | ||
'zh-CN': 'zh-Hans' | ||
'zh-TW': 'zh-Hant' | ||
- source: '/website/versioned_docs/**/*.md' | ||
translation: '/website/translated_docs/%locale%/**/%original_file_name%' | ||
languages_mapping: *anchor | ||
- source: '/website/i18n/en.json' | ||
translation: '/website/i18n/%locale%.json' | ||
languages_mapping: *anchor | ||
[ | ||
{ | ||
'source': '/website/i18n/en/**/*', | ||
'translation': '/website/i18n/%locale%/**/%original_file_name%', | ||
'languages_mapping': *languages_mapping, | ||
}, | ||
{ | ||
'source': '/docs/**/*', | ||
'translation': '/website/i18n/%locale%/docusaurus-plugin-content-docs/current/**/%original_file_name%', | ||
'languages_mapping': *languages_mapping, | ||
}, | ||
{ | ||
'source': '/website/versioned_docs/**/*', | ||
'translation': '/website/i18n/%locale%/docusaurus-plugin-content-docs/**/%original_file_name%', | ||
'languages_mapping': *languages_mapping, | ||
}, | ||
{ | ||
'source': '/website/blog/**/*', | ||
'translation': '/website/i18n/%locale%/docusaurus-plugin-content-blog/**/%original_file_name%', | ||
'languages_mapping': *languages_mapping, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toc[toc.length - 1].children
is somewhat weird. I don't have any suggestion for an improvement, but this seems magical and somewhat manual at the same time 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That may be clearer if you read this doc :)
https://v2.docusaurus.io/docs/next/markdown-features/inline-toc/#custom-table-of-contents
Basically, you can pass whatever you want from this component. You could have written
toc={toc}
, but we don't want the full page TOC, we just want to list the children's of the last item's level-2 heading (reference).see how the right toc and the inlined toc content is slightly different