Joshua Chen
78d84006bb
refactor(theme-classic): completely migrate package to TypeScript ( #5459 )
...
* Migrate
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Migrate prism as well
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix lock file
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix typing
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* refactor a bit CodeBlock
* simplify versionBanner typing => use null instead of "none" (apart plugin options for retrocompatibility)
* Remove return signatures
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-01 14:34:26 +02:00
Alexey Pyltsyn
2c0b82e7ab
fix: apply proper class for active doc item on mobiles + avoid duplicated classes ( #5264 )
...
* fix: apply proper class for active doc item on mobiles
* Fixes after review
2021-08-04 15:29:10 +02:00
Joshua Chen
4bc6a63756
fix: navbar item validation done correctly ( #5202 )
...
* Initial work
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fix again
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More fix (Joi is so hard!)
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* This should pass now
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Such pain
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Minor tweaks
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More test cases
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Minor tweaks
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Errr... this should be better
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Redo isOfType
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Make things more concise
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Remove TODO
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Rename isOfType
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Slight refactor
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More error messages
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More test cases
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-28 22:20:48 +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
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
Alexey Pyltsyn
8501db78a1
fix(v2): make proper data type for prependBaseUrlToHref field ( #4980 )
2021-06-16 11:06:25 +02:00
Alexey Pyltsyn
bfd33dc63a
refactor(v2): minor cleanups ( #4959 )
...
* refactor(v2): minor cleanups
* Fixes
2021-06-16 10:59:50 +02:00
Sébastien Lorber
60d189a91c
fix(v2): Export Joi from validation-utils package ( #4459 )
2021-03-18 19:27:51 +01:00
Ben
333545aa97
fix(v2): Allow null as valid for title of item in footer links ( #4267 )
2021-02-22 18:56:58 +01:00
Alexey Pyltsyn
b3b658f687
feat(v2): allow to change location of search bar ( #4199 )
...
* feat(v2): allow to change location of search bar
* add SearchBar swizzle comment
* quickfix for NavbarItem theme config
* typing quickfix
* doc typo
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-09 16:31:52 +01:00
Sébastien Lorber
869ebe7b53
fix(v2): fix/enhance minor i18n issues reported ( #4092 )
...
* fix comment
* allow to pass custom classname in navbar items
* Add IconLanguage comp to dropdown
* do not trim htmlLang
* Add initial hreflang SEO support
* doc hreflang
2021-01-22 21:26:42 +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
Sean Campbell
5dfa665281
feat(v2): themed logo in footer ( #3993 )
...
* feat: attempt 1 at themedlogo in footer
* Add srcDark to website for temp debug
* typo fix
* Got it now! except for centering
* style: centered new themed image logo
* style: change ThemedImage styleing to center footer logo
* style: Change ThemeImage Style to initial
This was my mistake.
Removed temp `srcDark` footer logo
2021-01-06 16:10:44 +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
Aarón García Hervás
1fafdb0d33
fix(v2): Allow footer logo at attribute to be empty ( #3817 )
2020-11-25 13:12:45 +01:00
Alexey Pyltsyn
52e7511869
fix(v2): make optional title for footer links column ( #3666 )
2020-10-31 17:57:11 +01:00
Alexey Pyltsyn
69bf68ae57
chore(v2): migrate hapi/joi to joi ( #3638 )
2020-10-26 15:18:51 +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
Alexey Pyltsyn
8f5c632cdf
refactor(v2): various dropdown improvements ( #3585 )
...
* refactor(v2): various dropdown improvements
* Remove invalid attr from markup
* Better naming
* Update types
* Fix
* Remove attr position correctly
* Test
* Add test
2020-10-16 16:41:30 +02:00
Sébastien Lorber
4130f1a195
feat(v2): persist docs preferred version ( #3543 )
...
* 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
2020-10-12 18:56:24 +02:00
Sébastien Lorber
649882d867
feat(v2): version dropdown before/after items + move site "All Versions" link ( #3548 )
...
* add dropdownItemsAfter option + reorg a bit docusaurus site navbar
* fix isActive react warning
* Update theme-classic.md
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-07 19:58:00 +03:00
Sébastien Lorber
9ba28a378f
feat(v2): doc navbar item type ( #3539 )
...
* provide DocNavbarItem type
* update snapshots
* Fix Docusaurus tabs CSS
* revert navbar tabs css/style changes, instead apply simple navbar__link--active class + make it configurable
* Update website/docs/theme-classic.md
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
* add dropdownActiveClassDisabled option
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2020-10-07 14:42:24 +03:00
Shubham Kumar
0951eef2d7
refactor(v2): add useThemeConfig hook + cleanup useless theme default values ( #3394 )
...
* refactor(theme-classic): clean default or fallback values
* refactor(theme-classic): fix announcementbar undefined error
* refactor(theme-classic): fixed react hook warning error
* refactor(theme-classic): revert prism destruct
* create useThemeConfig and use it whenever possible
* validateThemeConfig => add [] as default value for almost all arrays
* fix tests
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-02 19:23:34 +02:00
Bartosz Kaszubowski
ae2c063929
feat(v2): allow to use array of files in customCss field ( #3474 )
...
* feat(v2): allow to use array of files in customCss field
* customCss array:
- fix bug (push instead of concat)
- update docs
- add theme config validation + tests
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-09-28 18:15:41 +02:00
Bartosz Kaszubowski
086bee287d
feat(v2): add style property to theme-classic navbar ( #3432 )
...
* feat(v2): add style property to theme-classic navbar
* revert config test change
* review changes
2020-09-11 18:03:06 +02:00
Sébastien Lorber
21852948ce
feat(v2): ability to add/override theme html metadatas ( #3406 )
...
* ability to add/override theme html metadatas
see https://github.com/facebook/docusaurus/issues/3024
* refactor/fix validateThemeConfig tests
2020-09-04 16:36:56 +02:00
Bartosz Kaszubowski
e8e16a45d3
feat(v2): add isCloseable property for theme-classic announcement bar ( #3388 )
...
* feat(v2): add `isCloseable` property for announcement bar
* correct styling for non-closeable announcement
* fix tests
2020-09-02 11:41:38 +02:00
Sébastien Lorber
a4769e3f30
fix(v2): alpha 62 doc fixes ( #3381 )
...
* 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
2020-09-01 16:31:33 +02:00
Vincent
56c04c7834
fix(v2): Allow the alt for the logo to be empty ( #3352 )
...
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#Attributes
> Setting this attribute to an empty string (alt="") indicates that
> this image is not a key part of the content (it’s decoration or a
> tracking pixel), and that non-visual browsers may omit it from
> rendering.
Since the logo is indeed decorative and redundant with the actual
project name, an empty alt is fine.
2020-08-28 12:50:42 +02:00
Sébastien Lorber
b86806460c
refactor(v2): announcement bar bad spelling + minor refactors ( #3343 )
2020-08-27 10:55:45 +02:00
Sébastien Lorber
a4c8a7f55b
refactor(v2): docs plugin refactor ( #3245 )
...
* safe refactorings
* safe refactors
* add code to read versions more generically
* refactor docs plugin
* refactors
* stable docs refactor
* progress on refactor
* stable docs refactor
* stable docs refactor
* stable docs refactor
* attempt to fix admonition :(
* configureWebpack docs: better typing
* more refactors
* rename cli
* refactor docs metadata processing => move to pure function
* stable docs refactor
* stable docs refactor
* named exports
* basic sidebars refactor
* add getElementsAround utils
* refactor sidebar + ordering/navigation logic
* stable retrocompatible refactor
* add proper versions metadata tests
* fix docs metadata tests
* fix docs tests
* fix test due to absolute path
* fix webpack tests
* refactor linkify + add broken markdown links warning
* fix DOM warning due to forwarding legacy prop to div element
* add todo
2020-08-17 17:50:22 +02:00
Anshul Goyal
181a6174c7
fix(v2): relax URI validation ( #3227 )
...
* relax URI validation
* add regex
* add test
* fix linting error
* fix formatting
* use URL rather than regex
2020-08-07 22:11:19 +02:00
Teik Jun
8f0c00f3d4
fix(v2): fix theme validation for prism field and add tests ( #3210 )
...
* fix(v2): fix theme validation for prism field
* chore(v2): minor changes
* chore(v2): remove unused dependencies
2020-08-05 15:27:32 +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