Commit graph

162 commits

Author SHA1 Message Date
Sébastien Lorber
174fd2d248
docs(website): bump announcement bar + include Twitter link + refactor site colors (#5351)
* bump announcement bar + include Twitter link

* customize announcementBar css background + refactor infima colors
2021-08-13 16:23:56 +02:00
Sébastien Lorber
cdc41d5bb6
misc: enable pt-BR + archive older versions (#5269)
* add pt-BR to main site!

* archive older docs
2021-08-02 16:00:31 +02:00
Sébastien Lorber
bb4d9c03e4
chore: enable pt-BR i18n locale on staging (#5237) 2021-07-28 22:31:46 +02:00
Joshua Chen
24156efcfb
feat: docs plugin options sidebarCollapsible + sidebarCollapsed (#5203)
* Add prop

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Add `collapsible` option to sidebar item

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Add eslint-ignore

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move new page

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Allow in autogenerated

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix tests

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Move config options to plugin-docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Make non-collapsible items always expanded

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* docs versioning cli should receive a single options object

* Update cli.test.ts

* revert validateCategoryMetadataFile change

* remove theme usage of themeConfig.sidebarCollapsible

* better handling of sidebar item category inconsistencies + add warning message

* Update snapshot

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Handle plugin option inconsistencies

* improve doc for new sidebarCollapsible doc options

* remove warning in fixSidebarItemInconsistencies as it will be annoyed for versioned sites, as "collapsed" is already persisted in sidebar json files

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-23 14:24:36 +02:00
Sébastien Lorber
4d06f26c1f
fix(v2): Fix MDX docs being considered as partials when siteDir match the _ prefix convention (#5199)
* Add _ to dogfood docs folder to cover against edge case

* Fix edge case with MDX partials when site / content dir contains a _ prefix

* add globUtils tests

* proper dogfooding folder re-organization, all content plugins being used

* refactor dogfooding folder + expose /tests page index

* fix page plugin ignoring options.routeBasePath
2021-07-21 14:13:51 +02:00
Alexey Pyltsyn
54e4b02666
fix(v2): add base URL to content attribute of head tags PWA (#5185) 2021-07-16 11:56:00 +02:00
Alexey Pyltsyn
f7b5e90390
refactor(v2): automatically add base URL to PWA head tags (#5169)
* refactor(v2): automatically add base URL to PWA head tags

* Add baseUrl only if necessary
2021-07-15 15:38:14 +02:00
Sébastien Lorber
38c6cb5faa
fix(v2): fix website PWA icon hrefs (#5167) 2021-07-14 16:42:12 +02:00
Sébastien Lorber
d3764f77fe
fix(v2): revert webpack.resolve.symlinks = false (#5164)
* WathcOptions should work even if Webpack does not resolve symlinks

* re-enable webpack resolve.symlinks = true

* Use symlinked folder as source
2021-07-13 20:11:08 +02:00
Alexey Pyltsyn
9536ef900d
feat(v2): redesign mobile UX: inline TOC + doc sidebar in main menu (#4273)
* feat(v2): mobile TOC

* Bug fixes and various improvements

* Redesign

* extract TOCCollapsible component

* TS improvements

* Assign sidebar name directly to the doc route => no need for either permalinkToSidebar or GlobalData

* revert changes to useWindowSize, fix FOUC issues

* extract DocSidebarDesktop component

* remove now useless menu infima classes

* TOCHeadings => rename + remove unused onClick prop

* Extract DocSidebarItem

* minor renaming

* replace GlobalData usage by a React teleport system to render in the navbar mobile sidebar menu directly from the DocPage component

* useWindowSize => simulate SSR size in dev to make FOUC issues more obvious

* fix remaining sidebar layout shift

* update docs snapshots

* remove unused code translations

* remove unused code translations

* fix minor update-code-translations bug

* Add more build-size paths to watch

* Restyle back button

* Add  missing`menu` class

* extract useShallowMemoizedObject

* fix routes tests + better routes formatting

* use Translate api for labels

* use Translate api for labels

* Update translations

* Improve dark mode support for back button

* Merge branch 'master' into lex111/inline-color-code

# Conflicts:
#	packages/core/dist/css/default-dark/default-dark-rtl.min.css
#	packages/core/dist/css/default-dark/default-dark.min.css
#	packages/core/dist/css/default/default-rtl.min.css
#	packages/core/dist/css/default/default.min.css

* replace useCollapse by new useCollapsible

* Cleanup and use clean-btn for TOCCollapsible button

* Make TOC links clickable over full width

* Cleanup

* fix uncollapsible sidebar that can be collapsed + create <Collapsible> component

* dependency array typo

* rollback sidebars community commit typo

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-09 16:50:38 +02:00
Sébastien Lorber
f03479f69e
test(v2): dogfooding: add huge sidebar for testing purposes (#5130)
* dogfoog: add huge sidebar for testing purposes

* Add standalone doc + build-size tracking
2021-07-08 20:26:55 +02:00
Sébastien Lorber
dc9f104ccc
fix(v2): remove webpackConfig.resolve.symlinks: true (#5126)
* remove webpackConfig.resolve.symlinks: true

* Add docs-test docs plugin instance to validate using a symlink folder as docs source is possible

* comment

* useful comments
2021-07-08 18:59:56 +02:00
Sébastien Lorber
9916a0b4a4
fix(v2): Fix announcementBar layout shifts (#5040)
* Fix announcementBar layout shift

* useAnnouncementBar should return correct state after hydration

* refactor announcementBar => move utils to theme-common

* restore previous announcementBar

* typo
2021-06-24 11:35:35 +02:00
Sébastien Lorber
871e090ed8
chore: add archived versions system + archive alpha.73-75 (#5005) 2021-06-18 17:27:13 +02:00
Sébastien Lorber
b54ec72389
fix(v2): redirect plugin: use siteConfig.trailingSlash (#4988) 2021-06-16 19:04:28 +02:00
Alexey Pyltsyn
57cf20933e
feat(v2): add icon to external navbar links (#4949)
* feat(v2): add icon to external navbar links

* use isInternalUrl

* Remove demo link

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-15 14:45:53 +02:00
Alexey Pyltsyn
4e5f0febb9
misc: disable google-gtag plugin in Netlify deploys (#4951) 2021-06-14 19:46:50 +02:00
Sébastien Lorber
b835aecaec
chore: removal of Docusaurus v1 code from master (it is now available on docusaurus-v1 branch) (#4902) 2021-06-10 10:54:07 +02:00
Sébastien Lorber
df8a900f9c
feat(v2): add trailingSlash config option (#4908)
* POC: add trailingSlash option

* integrate the preferFoldersOutput option of fork @slorber/static-site-generator-webpack-plugin

* Fix broken links when using trailing slash => using md links is more reliable

* fix TS issue

* minor polish

* fix doc page being sensitive to trailing slashes

* Add tests for applyTrailingSlash

* rename test files

* extract and test applyRouteTrailingSlash

* update snapshot

* add trailing slash config to serve command

* fix getSidebar() => still sensitive to trailing slash setting

* never apply trailing slash to an anchor link

* Add documentation for trailingSlash setting
2021-06-09 19:59:39 +02:00
Alexey Pyltsyn
55e9bd8ac9
refactor(v2): remove type attribute from link and script tags (#4907)
* refactor(v2): remove type attribute from link and script tags

* minor TS fix

* stylesheets.type => optional

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-09 14:55:47 +02:00
Alexey Pyltsyn
35bdde3409
fix(v2): allow relative sidebar path resolution in docs:version command (#4861)
* fix(v2): allow relative sidebar path resolution in docs:version command

* factorize sidebarPath option resolution logic + dogfood

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-02 18:21:45 +02:00
Pranab Das
6d184a3e3d
docs(v2): New doc page for math equations (#4821)
* New doc page for math equations

* improve math equations doc

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-02 14:55:50 +02:00
Joshua Chen
334cab3eed
docs(v2): fix Java syntax highlight in website (#4849)
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-05-25 17:17:59 +03:00
Sam Zhou
3548686f59
feat(v2): Allow customization of js loader, replace babel by esbuild in Docusaurus website (#4766)
* feat(v2): Allow customization of js loader

* Change API

* use esbuild for Docusaurus website

* Enable isolatedModules: true

* Revert "Enable isolatedModules: true"

This reverts commit e656c350

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-05-14 11:30:34 +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
Sébastien Lorber
fe6492aa87
docs(v2): Improve intro doc (#4770)
* Intro documentation refactoring

* useless images

* improve the intro doc
2021-05-12 14:40:35 +02:00
Sébastien Lorber
41af0c9f90
docs(v2): i18n site: enable ko + zh-CN locales (#4599)
* enable locales

* do not deploy multiple locales in netlify deploy preview: keep it fast
2021-04-11 19:21:13 +02:00
Sébastien Lorber
819bb43433
docs(v2): add more links to v1: announcementBar, versionDropdown, homepage (#4505)
* add more links to v1 doc + use Translate interpolation

* add more links to v1 doc + use Translate interpolation

* add version dropdown link to v1 domain
2021-03-23 19:08:36 +01: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
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
03f4a92035
chore(v2): enable more staging locales (#4458) 2021-03-18 18:05:42 +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
Sébastien Lorber
02cd5d343b
fix(v2): PWA issues + improve docs (#4377)
* debug pwa

* more debugging logs + attempt to upgrade workbox

* fix PWA ?

* fix PWA ?

* enable pwa debugging for deploy previews

* try to fix the  app installed issue?

* try to fix appinstalled not firing

* try to add related applications to the PWA manifest

* attempt to fix related_applications

* attempt to fix related_applications

* attempt to fix related_applications

* improve PWA strategies

* improve PWA doc

* refactor/cleanup registerSw

* cleanup
2021-03-10 20:00:42 +01:00
tokarchyn
98a4b3a65c
feat(v2): Add playgroundPosition config for live codeblock (#4328)
* docs(v2): Add configuration parameter to allow putting Result before Editor in @docusaurus/theme-live-codeblock

* update doc

* refactor as playgroundPosition

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-03-05 14:49:17 +01:00
Sébastien Lorber
7c2b81f5b6
fix(v2): website editUrl should target upstream docs (#4233) 2021-02-17 13:02:11 +01:00
Sébastien Lorber
1b3c9be530
chore(v2): setup for i18n staging deployment (#4214) 2021-02-11 12:31:50 +01:00
Sébastien Lorber
be7b5dca78
feat(v2): editUrl function for advanced use-cases (#4121)
* 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
2021-01-29 15:35:25 +01:00
Sébastien Lorber
a8ee7fd3e8
docs(v2): i18n doc + polish (#4014)
* add some initial i18n doc

* i18n doc progress

* i18n tutorial progress

* i18n tutorial progress

* polish Crowdin docs

* i18n sidebar in guides

* polish crowdin doc

* update Crowdin doc a bit

* fix annoying relative link to global site resource in template (breaks i18n tutorial)

* template: use simpler export for homepage

* add markdown page example

* rename mdx.md to interactiveDoc.mdx

* update bootstrap/facebook templates too

* sync init template package scripts

* add slug frontmatter doc

* improve i18n doc

* complete i18n doc

* temporarily enable the localeDropdown

* doc typo

* improve the i18n doc

* Add Git i18n doc

* add missing "--" for npm run options (unfortunately they don't get stripped by npm2yarn, and are required foor npm)

* improve a bit the Crowdin doc
2021-01-19 17:26:31 +01:00
Joel Marcey
827de9a840
feat: add new policy links to Docusaurus site and FB template (#4019) 2021-01-10 14:07:59 +08:00
Sébastien Lorber
b5c46bd1d9
feat(v2): new docs edit options: editCurrentVersion + editLocalizedDocs (#3949)
* editCurrentVersion initial poc

* ensure edit url allows to edit localized docs

* Add editLocalizedDocs option

* keep editing current version in dev (more convenient)
2020-12-28 10:25:47 +01:00
Sébastien Lorber
aff656182c
feat(v2): Add localeDropdown navbar item type + i18n localeConfigs field (#3916)
* Add localeDropdown navbar item type

* fix type + add localeConfigs test
2020-12-14 18:28:39 +01:00
Sébastien Lorber
8f47babb46
docs(v2): Docs refactoring and reorganization (#3831)
* stable refactor of plugins api documentation

* plugins sidebar not collapsed by default as small?

* theme docs reorg

* Refactor migration guide doc

* fix broken link
2020-11-30 14:07:08 +01:00
Sébastien Lorber
3166fab307
feat(v2): core v2 i18n support + Docusaurus site Crowdin integration (#3325)
* 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
2020-11-26 12:16:46 +01:00
Sébastien Lorber
746a19f25b
feat(v2): add baseUrlIssueBanner configuration to disable banner (#3802)
* add baseUrlIssueBanner configuration

* handle review
2020-11-23 20:54:13 +03:00
Alexey Pyltsyn
3aeb90fcac
feat(v2): add support for sync to npm2yarn tabs (#3705) 2020-11-06 17:30:32 +01:00
iAmir
8f2d898f22
feat(v2): onBrokenMarkdownLinks config (#3658)
* 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>
2020-10-31 18:04:56 +01:00
Alexey Pyltsyn
14cdd72ae4
feat(v2): add ability to hide doc sidebar (#3615)
* feat(v2): add ability to hide doc sidebar

* Use relative imports
2020-10-22 11:23:15 +02:00
Sébastien Lorber
e4c1626106
feat(v2): blog sidebar (#3593)
* blog sidebar POC

* polish blog post sidebar

* add doc for blogSidebarCount

* Update packages/docusaurus-theme-classic/src/theme/BlogSidebar/styles.module.css

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-16 19:12:05 +02:00
Fanny
4760e1225b
feat(v2): Extract npm2yarn plugin (#3469)
* chore(v2): add dependency

* test(v2): Add npm2yarn tests

* feat(v2): Move npm2yarn to a new remark plugin

* remark npm2yarn plugin => ready to release

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-15 19:30:12 +02:00
Sébastien Lorber
aed1ce7850
chore(v2): enable new contextual search feature (#3591) 2020-10-15 15:34:04 +02:00