Erick Zhao
c86dfbda61
feat(v2): allow specifying TOC max depth (themeConfig + frontMatter) ( #5578 )
...
* feat: add all TOC levels to MDX loader
* feat: add theme-level config for heading depth
* test: add remark MDX loader test
* fix: limit maxDepth validation to H2 - H6
* refactor: set default `maxDepth` using `joi`
* refactor: `maxDepth` -> `maxHeadingLevel
* refactor: invert underlying TOC depth API
* refactor: make TOC algorithm level-aware
* feat: add support for per-doc TOC heading levels
* feat: support document-level heading levels for blog
* fix: correct validation for toc level frontmatter
* fix: ensure TOC doesn't generate redundant DOM
* perf: simpler TOC heading search alg
* docs: document heading level props for `TOCInline`
* Update website/docs/guides/markdown-features/markdown-features-inline-toc.mdx
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
* docs: fix docs (again)
* create dedicated test file for heading searching logic: exhaustive tests will be simpler to write
* toc search: add real-world test
* fix test
* add dogfooding tests for toc min/max
* add test for min/max toc frontmatter
* reverse min/max order
* add theme minHeadingLevel + tests
* simpler TOC rendering logic
* simplify TOC implementation (temp, WIP)
* reverse unnatural order for minHeadingLevel/maxHeadingLevel
* add TOC dogfooding tests to all content plugins
* expose toc min/max heading level frontmatter to all 3 content plugins
* refactor blogLayout: accept toc ReactElement directly
* move toc utils to theme-common
* add tests for filterTOC
* create new generic TOCItems component
* useless css file copied
* fix toc highlighting className conflicts
* update doc
* fix types
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-29 11:19:11 +02:00
swyx
194f429c1f
fix: add docs tag validation to solve #5478 ( #5479 )
...
* fix: add docs tag validation to solve #5478
fix: add docs tag validation to solve #5478
* Update docFrontMatter.ts
* Update docs-create-doc.mdx
* improve tag validation error messages + tests
* improve tags doc
* fix test
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-03 14:43:24 +02:00
Joshua Chen
493225a3c6
feat(plugin-blog): multi-authors support + authors.yml global configuration ( #5396 )
...
* Complete function
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* A lot of blank lines
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More lenient validation
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Remove or
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Simpler logic
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Expand docs
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Better docs
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Dogfood
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More writeup
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Polish
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Polish
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Move mergeAuthorMap to authors.ts
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Unbreak relative assets
* Update docs
* Clarify in docs
* simplify feed authors
* rename authorMap -> authorsMap
* mergeAuthorsMap -> getBlogPostAuthors
* website => 5 blog posts per page
* improve authors map file
* Extract new theme authors components + display in row
* add comment for meta array syntaxes
* blog => getPathsToWatch should watch authorsMap file
* remove useless v1 blog FBID frontmatter
* keep older frontmatter syntax for now
* revert blog frontmatter
* Better console message
* better blog authors frontmatter impl
* add multi authors to beta blog post + fix some authors margins
* fix React key
* Refactor: mdx loader should support a more flexible assets system (poc, not documented yet)
* better display of blog post authors: adapt layout to authors count + add line clamp
* smaller local image
* fix blog feed tests
* fix blog frontmatter tests + improve validation schema
* add more frontmatter tests
* add tests for getAuthorsMapFilePath
* tests for validateAuthorsMapFile
* add tests for readAuthorsMapFile
* test getAuthorsMap
* exhaustive tests for getBlogPostAuthors
* fix remaining tests
* missing blog plugin author tests
* fix windows tests
* improve blog multi-author's doc
* Use new format in init template
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Improve error message
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* update feed snapshot
* blog authors: limit to 2 cols + fix margins for no authors
* minor doc improvements
* better init template blog posts, demonstrating Blog features
* replace the legacy blog author frontmatter in remaining places
* Prefer using clsx
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* cleanup getColClassName
* remove blog author name/title line-clamping
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-26 12:21:58 +02:00
Isaac Philip
f9c79cbd58
feat: doc tags (same as blog tags) ( #3646 )
...
* [v2] tags to doc, same as tags to blog - [IN PROGRESS]
- Addition of plugin-content-docs
- Addition of DocTagsListPage in `docusaurus-theme-classic`
! Error exists for this commit towards the theme aspect and help required.
Commit towards #3434
* docs: make tags list page work
* temp: disable onBrokenLinks
* theme bootstrap: create DocTagsListPage
* DocTagsPage added and functionality too
- individual doc tag page added to show docs for that specific tag
* Added all Docs Tags Link
* add some shared tag utils
* move tag tests to _dogfooding
* fix type
* fix some tests
* fix blog test
* refactor blog post tags handling
* better yaml tag examples
* better dogfood md files
* refactor and factorize theme tag components
* finish DocTagDocListPage
* Extract DocItemFooter + add inline tag list
* minor fix
* better typings
* fix versions.test.ts tests
* add tests for doc tags
* fix tests
* test toTagDocListProp
* move shared theme code to tagUtils
* Add new theme translation keys
* move common theme code to tagUtils + add tests
* update-code-translations should handle theme-common
* update french translation
* revert add translation
* fix pluralization problem in theme.docs.tagDocListPageTitle
* add theme component configuration options
* add more tags tests
* add documentation for docs tagging
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-19 10:31:15 +02:00
Joshua Chen
462b1cf2bc
style(v2): reduce number of ESLint warnings ( #4993 )
...
* Initial work
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* More fixes
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Update packages/docusaurus-theme-classic/src/theme/ThemedImage/index.tsx
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Update packages/docusaurus-theme-bootstrap/src/theme/ThemedImage/index.tsx
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
* Fix
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Replace versionPathPart with function
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Prefer non-null assertions
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Substitute for-of with forEach
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Fill `catch` block with placeholder comment
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Ignore local require
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Revert global require change
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Tighten eslint disable range
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Make eslint ignore examples and more tolerating to templates
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Use reduce to handle doc items sequentially
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
* Revert "Use reduce to handle doc items sequentially"
This reverts commit c7525d463b
.
* Address change requests
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-06-24 18:12:48 +02:00
Sébastien Lorber
f20599bb54
fix(v2): less strict blog/docs uri frontmatter validation ( #5032 )
2021-06-22 10:42:06 +02:00
Alexey Pyltsyn
41d9288e3d
refactor(v2): cleanup console output ( #4979 )
...
* refactor(v2): cleanup console output
* fix jest issue
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-16 11:37:28 +02:00
Sébastien Lorber
9fe79caadc
polish(v2): url-subpath config validation warning ( #4977 )
2021-06-15 18:18:12 +02:00
Sébastien Lorber
aeb8e9da51
fix(v2): sitemap plugin should handle siteConfig.trailingSlash automatically ( #4950 )
...
* create new @docusaurus/utils-common and move applyTrailingSlash there
* sitemap plugin should handle siteConfig.trailingSlash automatically
* typo
2021-06-14 20:04:39 +02:00
Nam Hoang Le
e092910627
fix(v2): improve BlogPostFrontMatter schema validation ( #4759 )
...
* fix(v2): improve BlogPostFrontMatter schema validation
* Edit doc
* Add deprecate warning message
* minor changes, disable warnings temporarily
* only disable warnings + fix frontmatter date type
Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-05-14 18:52:51 +02:00
John Reilly
e11597aba9
fix(v2): fix too strict markdown frontmatter validation ( #4654 )
...
* start work
* use orta.vscode-jest
* node 14
* add some better infra to validate markdown frontmatter
* better docs frontmatter validation
* fix Yaml / Joi validation issues
* fix Yaml / Joi validation issues
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-21 16:19:55 +02:00
Sébastien Lorber
962c3748ea
chore(v2): Joi cyclic dep warning ( #4464 )
2021-03-18 20:19:09 +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
Armano
abae86f283
refactor(v2): use correct plugin types ( #4418 )
2021-03-15 19:08:44 +01:00
Armano
bfe52cdae3
refactor(v2): correct some of type errors reported by eslint ( #4382 )
...
* fix: correct some of type errors reported by eslint
* fix: remove unnecessary import
2021-03-12 12:24:22 +01:00
Bartosz Kaszubowski
ad31facb32
chore(v2): fix several lint warnings, add missing types, cleanup ( #3844 )
...
* fix several lint warnings, add missing types, cleanup
* fix EnumChangefreq issue
* better utilization of EnumChangefreq type
* update test snapshot
2020-11-30 16:42:58 +01:00
Alexey Pyltsyn
69bf68ae57
chore(v2): migrate hapi/joi to joi ( #3638 )
2020-10-26 15:18:51 +01:00
moonrailgun
f802a76d83
test(v2): add protocol relative uri validation test ( #3453 )
...
* feat(v2): add relative uri support
* add // protocol relative uris test case
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-09-29 20:06:46 +02:00
Tom Milligan
fe78cbeff5
fix(v2): allow relative URLs in URISchema #3449
2020-09-29 18:34:39 +02:00
Sébastien Lorber
1eb6e13fb7
fix(v2): reject routeBasePath: '' ( #3377 )
...
* routeBasePath: '' should be forbidden
* routeBasePath: '' should be forbidden
* commit
* try to trigger cla bot
2020-08-31 19:59:27 +02:00
Teik Jun
fda1590b0d
fix(v2): modify validation schema and tests for rehype/remark + remove duplicate dependency ( #3247 )
...
* chore(v2): remove duplicate dependency
* fix(v2): make changes to validation for rehype and remark plugins
* style(v2): run prettier
2020-08-11 15:17:23 +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
Sébastien Lorber
59f705ee66
feat(v2): blog + docs multi-instance plugins ( #3204 )
...
* stable createData namespacing + second-blog dogfooding
* Docs: support multi-instance + make community docs a separate instance
* tests: add 2nd docs instance to versioned site
* fix docs version cli tests
* fix docs versioning cli
* typo
* team: add link to my site
* better extendCli integration
* fix metadata tests
* tests for versioned site with second docs instance
* move some validation code to utils-validation
* fix missing dependency
* fix bad compiled output due to importing constants in ./client folder
* make docs tests easier to maintain
* refactors
* prevent lodash imports in client bundle
* redirect old community docs to new urls
2020-08-05 18:27:55 +02:00
Sébastien Lorber
7cceee7e38
feat(v2): markdown pages ( #3158 )
...
* markdown pages POC
* add remark admonition, mdx provider, yarn2npm...
* pluginContentPages md/mdx tests
* pluginContentPages md/mdx tests
* add relative file path test link to showcase link problem
* fix Markdown pages issues after merge
* fix broken links found in markdown pages
* fix tests
* factorize common validation in @docusaurus/utils-validation
* add some documentation
* add using plugins doc
* minor md pages fixes
2020-07-31 16:04:56 +02:00