* make number prefix parsing logic configurable
* Make numberPrefixParser configurable + rename frontmatter + avoid parsing date/version patterns by default
* add more tests
* more test cases
* 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
* extract createExcerpt code in separate file + add bad test
* almost working markdown parsing refactor
* complete parseMarkdownString refactor
* fix tests
* fix blog test issue
* fix docusaurus utils imports
* feat(v2): read first heading as title and pass it to front-matter
* fix(v2): always trim content after extracting front-matter
* fix(v2): remove heading from rss and keep duplicate heading
* fix(v2): rollback some unnecessary comment changes
* test(v2): add unit tests to blog
* test(v2): add unit tests to docs
* test(v2): correct issue on windows
* test(v2): add additional test cases
* chore: fix various intl stuff
- remove intl-locales-supported & intl since they're deprecated and only
needed for IE11
- add new polyfills for node 12
- clean up babel intl extractor
- reset jest test timezone to UTC so it passes even for East Coast
contributor
* chore: change build to include Node 14
* docs: update i18n reqs
* refactor(v2): merge linkify function used in blog and docs
* refactor(v2): rename docsDirPath and docsDirPathLocalized ad update types
* refactor(v2): rename blogPostsBySource and update types
* improve replaceMarkdownLinks api
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* 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>
* EditUrl function
* normalize blog/docs regarding the editUrl feature + editUrl function
* editUrl fn => always inject posix style relative paths, make tests more reliable
(see also https://github.com/facebook/docusaurus/issues/4124)
* fix editUrl on windows
* test(v2): Fix docusaurus-utils tests for windows
* test(v2): Fix plugin-client-redirects test
- add the posixPath in writeRedirectsFiles.ts
* test(v2): Fix plugin-content-pages test
add posixPath in test and index
* test(v2): add window test configuration
- add the window test configuration in nodejs-windows.yml
* test(v2): revert plugin-content-pages test fix
* test(v2): Fix mdx-loader/transformImage test
* test(v2): add cleanPath in transformImage test
* fix version path tests for windows
* make versionMetadata test work on Windows
* try to fix posix/win32 path issues
* attempt to fix windows test
* try to make source alias less win32 sensitive
* try to make source alias less win32 sensitive
* try to make source alias less win32 sensitive
* try to make source alias less win32 sensitive
* try to make source alias less win32 sensitive
* try to make source alias less win32 sensitive
* specific jest config for windows
* attempt to fix windows testing issue
* attempt to fix windows testing issue
* attempt to fix windows testing issue
* attempt to fix windows testing issue
* attempt to fix windows testing issue
* attempt to fix windows testing issue
* attempt to fix windows testing issue
* remove bad cleanPath fn
* try to fix windows tests
* try to fix windows tests
* blog: try to fix windows tests by using same logic as on docs plugin
* try to fix windows tests
* try to fix windows tests
* try to fix windows tests
* try to fix windows tests
* improve the Github CI setup for windows: make jobs run in parallel
* revert GH action change
Co-authored-by: Sachin Kumar Rajput <skr571999@gmail.com>
* fix(v2): remove unnecessary backtick in output
The escaped backtick seems to be present for no clear reason.
As a matter of fact, it seems to be cluttering the output.
So, remove the unnecessary backtick in the output.
* update snapshot
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* docs i18n initial poc
* docs i18n initial poc
* docs i18n initial poc
* docs i18n initial poc
* crowdin-v2 attempt
* fix source
* use crowdin env variable
* try to install crowdin on netlify
* try to install crowdin on netlify
* try to use crowdin jar directly
* try to curl the crowdin jar
* add java version cmd
* try to run crowdin jar in netlify
* fix translatedDocsDirPath
* fix loadContext issue due to site baseUrl not being modified in generted config file
* real validateLocalesFile
* add locale option to deploy command
* better LocalizationFile type
* create util getPluginI18nPath
* better core localization context loading code
* More explicit VersionMetadata type for localized docs folders
* Ability to translate blog posts with Crowdin!
* blog: refactor markdown loader + report broken links + try to get linkify working better
* upgrade crowdin config to upload all docs folder files except source code related files
* try to support translated pages
* make markdown pages translation work
* add write-translations cli command template
* fix site not reloaded with correct options
* refactor a bit the read/write of @generated/i18n.json file
* Add <Translate> + translate() API + use it on the docusaurus homepage
* watch locale translation dir
* early POC of adding babel parsing for translation extraction
* fs.stat => pathExists
* add install:fast script
* TSC: noUnusedLocals false as it's already checked by eslint
* POC of extracting translations from source code
* minor typo
* fix extracted key to code
* initial docs extracted translations
* stable plugin translations POC
* add crowdin commands
* quickfix for i18n deployment
* POC of themeConfig translation
* add ability to have localized site without path prefix
* sidebar typo
* refactor translation system to output multiple translation files
* translate properly the docs plugin
* improve theme classic translation
* rework translation extractor to handle new Chrome I18n JSON format (include id/description)
* writeTranslations: allow to pass locales cli arg
* fix ThemeConfig TS issues
* fix localizePath errors
* temporary add write-translations to netlify deploy preview
* complete example of french translated folder
* update fr folder
* remove all translations from repo
* minor translation refactors
* fix all docs-related tests
* fix blog feed tests
* fix last blog tests
* refactor i18n context a bit, extract codeTranslations in an extra generated file
* improve @generated/i18n type
* fix some i18n todos
* minor refactor
* fix logo typing issue after merge
* move i18n.json to siteConfig instead
* try to fix windows CI build
* fix config test
* attempt to fix windows non-posix path
* increase v1 minify css jest timeout due to flaky test
* proper support for localizePath on windows
* remove non-functional install:fast
* docs, fix docsDirPathLocalized
* fix Docs i18n / md linkify issues
* ensure theme-classic swizzling will use "nextjs" sources (transpiled less aggressively, to make them human readable)
* fix some snapshots
* improve themeConfig translation code
* refactor a bit getPluginI18nPath
* readTranslationFileContent => ensure files are valid, fail fast
* fix versions tests
* add extractSourceCodeAstTranslations comments/resource links
* ignore eslint: packages/docusaurus-theme-classic/lib-next/
* fix windows CI with cross-env
* crowdin ignore .DS_Store
* improve writeTranslations + add exhaustive tests for translations.ts
* remove typo
* Wire currentLocale to algolia search
* improve i18n locale error
* Add tests for translationsExtractor.ts
* better code translation extraction regarding statically evaluable code
* fix typo
* fix typo
* improve theme-classic transpilation
* refactor + add i18n tests
* typo
* test new utils
* add missing snapshots
* fix snapshot
* blog onBrokenMarkdownLink
* add sidebars tests
* theme-classic index should now use ES modules
* tests for theme-classic translations
* useless comment
* add more translation tests
* simplify/cleanup writeTranslations
* try to fix Netlify fr deployment
* blog: test translated md is used during feed generation
* blog: better i18n tests regarding editUrl + md translation application
* more i18n tests for docs plugin
* more i18n tests for docs plugin
* Add tests for pages i18n
* polish docusaurus build i18n logs
* refactor(v2): move `reportMessage` from `core/src/server/utils` to `utils` package
* feat(v2): handle broken markdown links by using onBrokenLinks prop from siteconfig
* feat(v2): add a new site config prop called `onBrokenMarkdownLinks`
works like onBrokenLinks, but only for markdown links
* feat(v2): add `onBrokenMarkdownLinks` to API docs
* some changes regarding test issues after adding `onBrokenMarkdownLink`
* Update website/versioned_docs/version-2.0.0-alpha.66/api/docusaurus.config.js.md
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* refactor(v2): use new way to get versions for search page
* search page: support docs multi-instance
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* POC of contextual search dynamic filters
* fix useSearchTags bugs
* contextual search should use preferred version (persisted in storage)
* Contextual search: make system decoupled from algolia + wire proper meta tags and facet filters
* rework doc tag + minor refactorings
* update snapshots
* polish contextual search
* add Algolia validateThemeConfig tests
* persist docs preferred version
* add proper implementation for useDocsPreferredVersion
* add proper implementation for useDocsPreferredVersion
* useDocsPreferredVersion => make localstorage read only after mount
* why @docusaurus/constants can't work?
* fix weird TS issue when not duplicating constants
* add basic @docusaurus/constants doc
* attempt to fix docs-only mode where we should not call useDocs hooks
* attempt to fix docs-only mode where we should not call useDocs hooks
* fix children
* encapsulate hacky isDocsPluginEnabled in docsUtils
* use same priority order for all navbar items: activeVersion ?? preferredVersion ?? latestVersion
* We should create an alias for searching last version of docs on DocSearch/Algolia, so that on new version publish, search still works even if new version is not already indexed (https://github.com/facebook/docusaurus/issues/3391)
* commit missing snapshot
* update after algolia changes
* put back facetFilters: [`version:${versions[0]}`] until latest facet is indexed
* deprecated nextVersionLabel option
* useActivePlugin failfast option
* remove deprecated option nextVersionLabel
* routeBasePath: '' should be forbidden
* routeBasePath: '' should be forbidden
* Docs: do not show version badge if there is only 1 version: https://github.com/facebook/docusaurus/issues/3362
* allow sidebars file to not exist: fallback to empty sidebars
https://githu.com/facebook/docusaurus/issues/3366
* docs options.onlyIncludeVersions
* adapt docsVersionDropdown if we render a single version
* fix bad error message
* fix netlify deploy when versioning is disabled
* 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
* doc path special char (space or other) should lead to a valid slug
* doc path special char (space or other) should lead to a valid slug
* improve doc bad slug message