Commit graph

39 commits

Author SHA1 Message Date
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
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
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
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
d7e4e422a2
docs(v2): minor tweaks (#4981) 2021-06-16 11:04:40 +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
Sébastien Lorber
85cf1be79a
docs(v2): Docusaurus 2 beta blog post (#4756)
* draft

* draft

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* update draft

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-11-releasing-docusaurus-beta.md

* update draft post

* link to testimonials collection

* remove alpha mention in doc

* Update website-1.x/blog/2021-05-12-announcing-docusaurus-two-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-12-announcing-docusaurus-two-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-12-announcing-docusaurus-two-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

* Update website-1.x/blog/2021-05-12-announcing-docusaurus-two-beta.md

Co-authored-by: Joel Marcey <joelm@fb.com>

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Joel Marcey <joelm@fb.com>
2021-05-12 16:08:07 +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
Rami
5757cdc7a6
docs(v2): blog.md with docs: false, for blog-only mode (#3931)
Added ***docs: false,*** to the config for blog-only mode because we do not want any documents if we're in blog-only mode otherwise, we probably wouldn't use blog-only mode.
2020-12-17 19:24:04 +01:00
Cindy Gu
0b05806593
feat(v2): enable feeds by default in blog plugin (#3842)
* feat: enables feeds by default in blog

* feat(v2): enable feeds by default

committing a failed attempt for review

* feat(v2): enable feeds by default in blog plugin

- allow validation to work with arrays syntax
- using DEFAULT_OPTIONS.feedOptions.type instead

* feat(v2): enable feeds by default in blog plugin

- added documentation for feedOptions

* feat(v2): enable feeds by default in blog plugin

- modified implementation to allow feeds to be disable without error
- added unit test to ensure type: null leads to type: null after
  validation
- added documentation to explain how to disable feed generation
2020-12-10 18:35:19 +01:00
DeadEnglish
d1510770f4
feat(v2): add option for blog meta title #3571
* feat(blog-meta-title): add support for additional meta title

* retrocompatible blog title

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2020-10-12 13:23:54 +02:00
Amy Lei
473d263469
feat(v2): add toc to blog posts (#3274)
* refactor TOC into own component

* make layout consistent across blog pages
2020-08-17 14:47:19 +02:00
Franklyn Chisom
0d489aeb9e
docs: corrected some few typos in the docusaurus tech docs (#3276)
* corrected some few typos

* Update blog.md

Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
2020-08-14 11:38:54 +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
Xuqian
4af25cd597
feat(v2): support custom description for blog-only mode (#2359)
* feat: support custom description on blog page

resolve conflicts

* feat(v2): allow additional props to pass to route components

resolve conflicts

* Update blogDescription feature

* Update doc for blogDescription

* Remove test blogDescription config

* Fix blogDescription schema validation

* Fix minor errors

Co-authored-by: Xuqian <zxuqian@163.com>
2020-07-30 15:41:15 +02:00
Sébastien Lorber
15e73daae7
feat(v2): global data + useGlobalData + docs versions dropdown (#2971)
* doc components initial simplification

* doc components initial simplification

* add docContext test

* Add poc of global data system + use it in the theme

* Revert "doc components initial simplification"

This reverts commit f657b4c4

* revert useless changes

* avoid loosing context on docs switch

* fix docs tests

* fix @generated/globalData ts declaration / es import

* typo

* revert bad commit

* refactor navbar in multiple parts + add navbar item types validation + try to fix remaining merge bugs

* add missing watch mode for plugin debug

* fix docs global data integration, move related hooks to docs plugin + convert to TS

* change versions link label

* fix activeClassName react warning

* improve docs global data system + contextual navbar dropdown

* fix bug preventing the deployment

* refactor the global data system to namespace automatically by plugin name + plugin id

* proper NavbarItem comp

* fix tests

* fix snapshot

* extract theme config schema in separate file + rename navbar links to navbar items

* minor typos

* polish docs components/api

* polish useDocs api surface

* fix the docs version suggestions comp + data

* refactors + add docsClientUtils unit tests

* Add documentation

* typo

* Add check for duplicate plugin ids detection

* multi-instance: createData plugin data should be namespaced by plugin instance id

* remove attempt for multi-instance support
2020-07-21 11:16:08 +02:00
Teik Jun
11751c20b0
docs(v2): correct the documentation for doc-only mode (#3040) 2020-07-09 17:15:23 +02:00
slorber
ce10646606 document that docs/blog-only modes should delete the existing homepage 2020-06-23 18:29:19 +02:00
Teik Jun
8eed245000
docs(v2): add documentation for multiple blogs (#2933)
* docs(v2): add documentation for multiple blogs

* docs(v2): fix typos of docusaurus

* docs(v2): make the same changes in the latest version of documentation

* docs(v2): remove an empty blockquote

* docs(v2): improve documentation for multiple blogs
2020-06-15 03:18:37 +08:00
Alexey Pyltsyn
ed9977accc
docs(v2): description field in frontmatter of blog post (#2865) 2020-06-02 11:02:45 +03:00
Alexey Pyltsyn
c0c7457e01
feat(v2): allow specifying meta image for blog posts (#2856)
* feat(v2): allow specifying meta image for blog posts

* Update docs [skip ci]
2020-06-02 10:48:22 +03:00
Alexey Pyltsyn
fc161b8455
docs(v2): various improvements (#2768) 2020-05-18 11:37:53 +08:00
Alexey Pyltsyn
d41f8ca1a9 docs(v2): various improvements 2020-04-28 17:44:06 +03:00
Alexey Pyltsyn
f8f6478c36 docs(v2): fix correct value for blog-only mode 2020-04-28 09:19:46 +03:00
Reece Dunham
aeeb8531da
doc(v2): remove legacy blog metadata (#2559) 2020-04-08 22:17:17 +08:00
Yangshun Tay
3dd83be988
docs(v2): proofread docs (#2527) 2020-04-04 14:05:59 +08:00
Yangshun Tay
36ea74504e
docs(v2): use codeblock title syntax instead of comments (#2473) 2020-03-29 01:08:50 +08:00
Alexey Pyltsyn
84eeb5120c
feat(v2): add draft feature to blog posts (#2335) 2020-02-29 13:19:59 +08:00
Yangshun Tay
65965e060a misc(v2): change blog front matter to snake_case (#1989)
* misc(v2): change blog front matter to snake_case

* Fix blog image url

* Add docs for change

* More migration docs
2019-11-19 15:08:53 +07:00
Alexey Pyltsyn
472a1a660c docs(v2): fix syntax highlighting for YML code blocks (#1988) 2019-11-13 15:43:01 -08:00
Vincent van der Walt
245b50f6e0 docs(v2): Add section to blog document about feed location (#1976)
* Add section in blog doc about feed location

* fix fenced code type
2019-11-13 13:10:20 +07:00
Pawel Kadluczka
ff83e6f8bc feat(v2): Implement plugin creating feed for blog posts (#1916)
* feat(v2): Implement feed for blog posts

Fixes: #1698

Test plan:
- added tests

Ran `yarn build` on website with the following config (and disabled blog
from preset-classic):

```js
[
'@docusaurus/plugin-content-blog',
  {
    path: '../website-1.x/blog',
    feedOptions: {
      copyright: 'Copy',
      type: 'atom',
    },
  },
],
```
which genereted the following feed:
```xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://v2.docusaurus.io/blog</id>
    <title>Docusaurus Blog</title>
    <updated>2018-12-14T00:00:00.000Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://v2.docusaurus.io/blog"/>
    <subtitle>Docusaurus Blog</subtitle>
    <icon>https://v2.docusaurus.io/img/docusaurus.ico</icon>
    <rights>Copy</rights>
    <entry>
        <title type="html"><![CDATA[Happy 1st Birthday Slash!]]></title>
        <id>Happy 1st Birthday Slash!</id>
        <link href="https://v2.docusaurus.io/blog/2018/12/14/Happy-First-Birthday-Slash"/>
        <updated>2018-12-14T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[![First Birthday Slash](/img/docusaurus-slash-first-birthday.svg)]]></summary>
    </entry>
    <entry>
        <title type="html"><![CDATA[Towards Docusaurus 2]]></title>
        <id>Towards Docusaurus 2</id>
        <link href="https://v2.docusaurus.io/blog/2018/09/11/Towards-Docusaurus-2"/>
        <updated>2018-09-11T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Docusaurus was [officially announced](https://docusaurus.io/blog/2017/12/14/introducing-docusaurus) over nine months ago as a way to easily build open source documentation websites. Since then, it has amassed over 8,600 GitHub Stars, and is used by many popular open source projects such as [React Native](https://facebook.github.io/react-native/), [Babel](https://babeljs.io/), [Jest](https://jestjs.io/), [Reason](https://reasonml.github.io/) and [Prettier](https://prettier.io/).]]></summary>
    </entry>
    <entry>
        <title type="html"><![CDATA[How I Converted Profilo to Docusaurus in Under 2 Hours]]></title>
        <id>How I Converted Profilo to Docusaurus in Under 2 Hours</id>
        <link href="https://v2.docusaurus.io/blog/2018/04/30/How-I-Converted-Profilo-To-Docusaurus"/>
        <updated>2018-04-30T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[> _“Joel and I were discussing having a website and how it would have been great to launch with it. So I challenged myself to add Docusaurus support. It took just over an hour and a half. I'm going to send you a PR with the addition so you can take a look and see if you like it. Your workflow for adding docs wouldn't be much different from editing those markdown files.”_]]></summary>
    </entry>
    <entry>
        <title type="html"><![CDATA[Introducing Docusaurus]]></title>
        <id>Introducing Docusaurus</id>
        <link href="https://v2.docusaurus.io/blog/2017/12/14/introducing-docusaurus"/>
        <updated>2017-12-14T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[![Introducing Slash](/img/slash-introducing.svg)]]></summary>
    </entry>
</feed>
```

* new feedOptions type 'all' and use correct path
2019-11-06 14:45:31 +07:00
Yangshun Tay
f635f9aba2
docs(v2): code block line highlighting (#1904)
* docs(v2): code block line highlighting

* misc: update CHANGELOG

* misc: respond to review

* docs: add line highlighting to the template
2019-10-29 14:59:24 +08:00
Yangshun Tay
1d968be5bb docs(v2): misc update 2019-10-12 14:28:21 -07:00
Dattatreya Tripathy
a404732c30 docs(v2): blog initial draft (#1786)
* docs(v2): contributing for v2 #1640

* deleted blog.md

* docs(v2): contributing for v2 (#1640)

* docs(v2): blog (#1640)

* Update blog.md
2019-10-05 12:23:21 -07:00
Wei Gao
95fde5f827 docs(v2): refactor docs for better outline and welcoming PRs (#1641)
* docs(v2): refactor docs for better outline and welcoming PRs

* docs(v2): update docs
2019-07-07 23:14:49 -07:00
Yangshun Tay
5d6dc49bcd
docs(v2): add docs skeleton and structure (#1412)
* docs(v2): add docs skeleton and structure

* docs(v2): add on

* docs(v2): move motivation into contributing
2019-04-28 20:20:24 -07:00