Commit graph

34 commits

Author SHA1 Message Date
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
Joshua Chen
7d0272fe4d
feat(plugin-blog): allow 'ALL' as postsPerPage option value (#5354)
* 'ALL' option

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

* Guard against zero posts

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

* Remove redundant code

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
2021-08-17 13:07:18 +02:00
Sébastien Lorber
1257e99112
docs: try to make plugin/preset config less confusing (#5313) 2021-08-10 12:32:44 +02:00
Sébastien Lorber
cabb768473
feat: blog posts support /YYYY/MM/DD/blog-post/index.md pattern + blog frontmatter can reference relative images (#5309)
* POC of blog post folder

* add parseBlogFileName with tests + refactor and extract processBlogSourceFile in separate method

* improve blog date pattern doc + link from content plugin guides to API ref docs

* Some FrontMatter fields should be able to reference relative image assets, converted to Webpack require calls and exposed as frontMatterAssets

* remove log
2021-08-06 17:51:59 +02:00
Joshua Chen
c603056f66
docs: refactor API documentation (#5219)
* Refactor plugin-docs documentation

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

* Refactor theme-configuration

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

* Refactor plugin-blog docs

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

* Fix link

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

* plugin-pages

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

* Minor change

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

* Interchange table columns

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

* Fixes

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

* Minor improvements

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

* Fix hash link

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

* Move blog front matter to API

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

* Add more blog documentation

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

* Update blog.md

* Update blog.md

* Update blog.md

* Update website/docs/blog.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-04 16:35:17 +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
8bdb3da233
feat(v2): generalize usage of _ prefix convention to exclude content files/folders (#5173)
* create a swizzleWarning partial for shared text

* Generalize usage of _ prefix convention to exclude content files/folders

* add api doc

* MDX loader should not expect metadata/frontmatter on MDX partial files
2021-07-15 13:21:41 +02:00
Nazar
f14d8d2fdd
docs(v2): GIF format is not suported (#5133)
https://github.com/facebook/docusaurus/issues/2956

Please check the issue above.
GIF format is currently is not supported
2021-07-12 19:40:42 +02:00
Lennart Koopmann
f74e6c5107
docs(v2): clarify how to disable edit links entirely (#5112)
* docs: clarify how to disable edit links entirely

* Update website/docs/api/plugins/plugin-content-docs.md

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2021-07-05 12:38:10 +02:00
Sébastien Lorber
364051f232
feat(v2): docs version banner configuration option (#5052)
* refactor DocVersionBanner => versionMetadata prop should be forwarded instead of using "useActiveVersion" + global data

* docs version banner configuration

* add doc for versions.banner

* fix tests

* improve docs plugin option api doc
2021-06-24 18:04:16 +02:00
Teik Jun
c96c3b5c39
docs(v2): fix incorrect anchor links in website (#5021)
* docs: fix anchor links for docusaurus write-translations

* docs: fix anchor links for docusaurus serve
2021-06-20 22:16:17 +03:00
Sébastien Lorber
32e76f1cc0
feat(v2): add docs pagination_label frontmatter (#4982)
* feat(v2): add docs pagination_label frontmatter

* feat(v2): add docs pagination_label frontmatter

* feat(v2): add docs pagination_label frontmatter
2021-06-16 12:03:46 +02:00
Alexey Pyltsyn
d7e4e422a2
docs(v2): minor tweaks (#4981) 2021-06-16 11:04:40 +02:00
Joshua Chen
af3640dca2
docs(v2): replace diff codeblocks with line highlight (#4973)
* Replace `diff` codeblocks with line highlight

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

* Add line highlight
2021-06-16 10:29:05 +02:00
Sébastien Lorber
737f80a026
fix(v2): sidebar_label should be used to compute next/previous button labels (#4970)
* sidebar_label should be used to compute next/previous button texts, as documented.

* improve docs frontmatter doc

* use a little bit of destructuring
2021-06-15 12:04:29 +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
Sébastien Lorber
57806798c5
fix(v2): fix contentTitle issues when markdown h1 title contains code blocks (#4882)
* attempt to fix contentTitle issues when markdown h1 title contains inline code blocks

* mention hide_title frontmatter only prevents frontmatter.title from being added in the dom (not a markdown # title in content)

* alwayss insert MainHeading under the div.markdown container for consistency

* ensure MainHeading has no useless id

* revert https://github.com/facebook/docusaurus/pull/4859 as it's now useless: docMeta.title contains the text/frontmatter title in priority over the contentTitle

* fix docs test after revert

* improve markdownParser and fix tests

* fix docs tests

* markdownParser: restore option to remove contentTitle (mostly for blog plugin)

* use removeContentTitle for blog
2021-06-03 17:45:19 +02:00
Ian Hornik
5fc5071882
docs(v2): specify google-analytics and gtag plugins (#4703)
Closes #4678
2021-05-04 16:46:07 +02:00
Sébastien Lorber
792f4ac6fb
feat(v2): allow user to customize/enhance the default sidebar items generator (#4658)
* allow and document how to wrap/enhance the default docusaurus sidebar items generator

* improve doc

* doc

* doc
2021-04-21 18:35:03 +02:00
Sébastien Lorber
c04e613ffe
feat(v2): docs, make numberPrefixParser configurable, better defaults, minor breaking-changes (#4655)
* make number prefix parsing logic configurable

* Make numberPrefixParser configurable + rename frontmatter + avoid parsing date/version patterns by default

* add more tests

* more test cases
2021-04-21 12:06:06 +02:00
Sébastien Lorber
db79d462ab
feat(v2): auto-generated sidebars, frontmatter-less sites (#4582)
* 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
2021-04-15 16:20:11 +02: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
Alexey Pyltsyn
291a72fbae
docs(v2): use explicit heading IDs (#4460) 2021-03-19 11:00:41 +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
Alexey Pyltsyn
1c7d423e0c
docs(v2): various improvements (#4369)
* docs(v2): various improvements

* Update blog.md
2021-03-09 14:59:32 +01:00
Alexey Pyltsyn
f13448d5e1
chore(v2): upgrade dependencies + require Node 12 (#4223)
* 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>
2021-02-18 15:12:42 +01:00
Sébastien Lorber
ae988d0eb9
feat(v2): editUrl functions should receive md doc permalink (#4232) 2021-02-17 11:48:33 +01:00
Nahiyan Kamal
219a4b7b8c
docs(v2): plugins docs typo fix (#4141) 2021-02-01 12:01:56 +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
Sébastien Lorber
d99d53a236
docs(v2): Reorganize/split the guides doc sections (#3975)
* docs reorg

* refactor docs/markdown features section

* fix broken links after docs refactor
2020-12-30 17:03:25 +01: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
Siemienik Pawel
24ea18edf3
docs(v2): Added information about setting / in routeBasePath (#3945) 2020-12-22 16:25:33 +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