Commit graph

182 commits

Author SHA1 Message Date
Sébastien Lorber
5dc1cdf987
fix(website): fix yarn build:website:fast (#6122) 2021-12-17 12:30:06 +01:00
Joshua Chen
7db4884853
refactor(website): make deploy preview open next version docs by default (#6120)
* refactor(website): make deploy preview open next version docs by default

* Fix links
2021-12-17 11:00:12 +08:00
Fernando Maia
b366ba5603
feat: shorthands for themes/plugins/presets configuration (#5930)
Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
2021-12-03 18:23:12 +01:00
Sébastien Lorber
cfae5d0933
feat(content-docs): sidebar category linking to document or auto-generated index page (#5830)
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Armano <armano2@users.noreply.github.com>
Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
2021-12-03 14:44:59 +01:00
Joshua Chen
3334bfb4fa
chore(website): enable strict compiler option (#6012) 2021-11-26 18:14:35 +08:00
Oliver Ullman
1366c31201
feat(core): allow sourcing from multiple static directories (#4095)
* [WIP] Implementaion of multiple directory static sourcing

* Move default to validation

* Update test

* Refactor

* Port to MDX loader

* Fix

* Move dogfooding assets

* Doc writeup

* Restore assets

* Support absolute paths

* Dogfood absolute path

* Fix

* More tests

* Fix snapshots

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-11-18 22:26:26 +08:00
Joshua Chen
ac88d979f1
refactor(ganalytics, gtag): move options out of themeConfig (#5832)
* refactor(ganalytics, gtag): move options out of themeConfig

* Forbid themeConfig options

* Add PR link

* Add key names to error message

* Fix?

* Doc updates

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-11-10 19:04:43 +08:00
Swalah Amani
c541e2d83c
misc: replace all "Metadatas" with "Metadata" (#5871)
Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2021-11-09 19:46:10 +01:00
Joshua Chen
e0127c66be
chore(website): enable eslint in website (#5889)
* chore: enable eslint in website

* Fixes

* prettier users
2021-11-06 19:04:45 +08:00
Alexey Pyltsyn
9f13f8f7af
misc: show only latest archive alpha/beta versions dropdown (#5862) 2021-11-03 17:41:27 +01:00
Devtato
41ef9daafd
feat(theme-classic): allow specifying width/height in logo (#5770)
* feat: changed the logo properties to allow width/height specification

* fixup! feat: changed the logo properties to allow width/height specification

* fixup! feat: changed the logo properties to allow width/height specification

* Rework: add fields to logo object

* Fix

* More fixes

* Wrong width!

* No need for optional chaining

* Doc writeup

Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2021-11-01 18:09:30 +08:00
Joshua Chen
1c8b8362f7
fix(live-codeblock): render static codeblock server-side (#5754)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-10-21 17:17:03 +02:00
Sébastien Lorber
afff053cc9
chore: prepare Algolia migration (#5632)
* prepare Algolia migration

* Update website/docs/search.md

Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com>

Co-authored-by: Clément Vannicatte <20689156+shortcuts@users.noreply.github.com>
2021-10-01 15:58:24 +02:00
Bharat Middha
09550b0535
feat: properly type-check the Docusaurus config of new sites (#5589)
* fix: makes types DocusaurusConfig optional to match docs

* add UserDocusaurusConfig with required keys for user config

* convert UserDocusaurusConfig to use util type

* Docusaurus website config should be type-checked by CI + fix all existing issues

* add doc for config typechecking

* Update template configs for TS autocompletion

* fix last config typechecking bugs

* reapply prettier

* reapply prettier-docs

* Fix TS doc: add missing ()

* fix some docu plugin types

* add "const config" for simpler jsdoc annotation

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-30 17:49:44 +02:00
Sébastien Lorber
553f914639
feat: TypeScript presets/plugins should expose Options typing (#5456)
* each TS plugin should export option types + preset export option / themeConfig types + remove TS typechecking for the bootstrap theme

* each TS plugin should export option types + preset export option / themeConfig types + remove TS typechecking for the bootstrap theme

* fix remaining TS errors

* fix remaining TS errors

* TS fix

* Add JSDoc type annotations to init templates and TS docs

* missing title char
2021-09-01 12:14:40 +02:00
Sébastien Lorber
d76091c7fe
fix: website bad version name in docusaurus.config.js (#5455) 2021-08-31 17:40:47 +02:00
Sébastien Lorber
42e70e6d42
feat: new docs options: versions.{badge,className} (#5454)
* docs: add versions.{badge,className} options

* remove badge option test
2021-08-31 15:40:37 +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
Sébastien Lorber
f40ce05102
refactor: clean Canny integration + rename 'Feedback' to 'Feature Requests' + improve TS doc page (#5389)
* Better Canny integration

* Add missing netlify redirects

* polish

* TS doc: mention it's possible to use JSDoc in config

* issue templates: use /feature-requests new url
2021-08-20 11:42:13 +02:00
Paul O’Shannessy
8341527fc9
refactor: rename Git master branch to main (#5345)
* Prepare to renaming master branch to main

* Update CONTRIBUTING.md

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/package.json

* missing master -> main replaces

* useless char

* For GH Pages org deploy, DEPLOYMENT_BRANCH env is now required

* fix versioning page

* fix vercel links

* update deployment.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-17 18:41:53 +02:00
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