* refactor(v2): merge linkify function used in blog and docs
* refactor(v2): rename docsDirPath and docsDirPathLocalized ad update types
* refactor(v2): rename blogPostsBySource and update types
* improve replaceMarkdownLinks api
Co-authored-by: slorber <lorber.sebastien@gmail.com>
* docs i18n initial poc
* docs i18n initial poc
* docs i18n initial poc
* docs i18n initial poc
* crowdin-v2 attempt
* fix source
* use crowdin env variable
* try to install crowdin on netlify
* try to install crowdin on netlify
* try to use crowdin jar directly
* try to curl the crowdin jar
* add java version cmd
* try to run crowdin jar in netlify
* fix translatedDocsDirPath
* fix loadContext issue due to site baseUrl not being modified in generted config file
* real validateLocalesFile
* add locale option to deploy command
* better LocalizationFile type
* create util getPluginI18nPath
* better core localization context loading code
* More explicit VersionMetadata type for localized docs folders
* Ability to translate blog posts with Crowdin!
* blog: refactor markdown loader + report broken links + try to get linkify working better
* upgrade crowdin config to upload all docs folder files except source code related files
* try to support translated pages
* make markdown pages translation work
* add write-translations cli command template
* fix site not reloaded with correct options
* refactor a bit the read/write of @generated/i18n.json file
* Add <Translate> + translate() API + use it on the docusaurus homepage
* watch locale translation dir
* early POC of adding babel parsing for translation extraction
* fs.stat => pathExists
* add install:fast script
* TSC: noUnusedLocals false as it's already checked by eslint
* POC of extracting translations from source code
* minor typo
* fix extracted key to code
* initial docs extracted translations
* stable plugin translations POC
* add crowdin commands
* quickfix for i18n deployment
* POC of themeConfig translation
* add ability to have localized site without path prefix
* sidebar typo
* refactor translation system to output multiple translation files
* translate properly the docs plugin
* improve theme classic translation
* rework translation extractor to handle new Chrome I18n JSON format (include id/description)
* writeTranslations: allow to pass locales cli arg
* fix ThemeConfig TS issues
* fix localizePath errors
* temporary add write-translations to netlify deploy preview
* complete example of french translated folder
* update fr folder
* remove all translations from repo
* minor translation refactors
* fix all docs-related tests
* fix blog feed tests
* fix last blog tests
* refactor i18n context a bit, extract codeTranslations in an extra generated file
* improve @generated/i18n type
* fix some i18n todos
* minor refactor
* fix logo typing issue after merge
* move i18n.json to siteConfig instead
* try to fix windows CI build
* fix config test
* attempt to fix windows non-posix path
* increase v1 minify css jest timeout due to flaky test
* proper support for localizePath on windows
* remove non-functional install:fast
* docs, fix docsDirPathLocalized
* fix Docs i18n / md linkify issues
* ensure theme-classic swizzling will use "nextjs" sources (transpiled less aggressively, to make them human readable)
* fix some snapshots
* improve themeConfig translation code
* refactor a bit getPluginI18nPath
* readTranslationFileContent => ensure files are valid, fail fast
* fix versions tests
* add extractSourceCodeAstTranslations comments/resource links
* ignore eslint: packages/docusaurus-theme-classic/lib-next/
* fix windows CI with cross-env
* crowdin ignore .DS_Store
* improve writeTranslations + add exhaustive tests for translations.ts
* remove typo
* Wire currentLocale to algolia search
* improve i18n locale error
* Add tests for translationsExtractor.ts
* better code translation extraction regarding statically evaluable code
* fix typo
* fix typo
* improve theme-classic transpilation
* refactor + add i18n tests
* typo
* test new utils
* add missing snapshots
* fix snapshot
* blog onBrokenMarkdownLink
* add sidebars tests
* theme-classic index should now use ES modules
* tests for theme-classic translations
* useless comment
* add more translation tests
* simplify/cleanup writeTranslations
* try to fix Netlify fr deployment
* blog: test translated md is used during feed generation
* blog: better i18n tests regarding editUrl + md translation application
* more i18n tests for docs plugin
* more i18n tests for docs plugin
* Add tests for pages i18n
* polish docusaurus build i18n logs
* wip embed metadata to content
* embed metadata in blog as well
* refactor
* update test
* yarn lock
* avoid overwriting file everytime we run new nodejs process
* nits
* 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"><]]></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">< 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"><]]></summary>
</entry>
</feed>
```
* new feedOptions type 'all' and use correct path
* convert `@docusaurus/plugin-content-blog` to typescript
remove divided plugin
convert `@docusaurus/plugin-content-blog` to typescript
convert `@docusaurus/plugin-content-blog` to typescript
convert `@docusaurus/plugin-content-blog` to typescript
add `packages/docusaurus-plugin-content-blog/lib` to ignores
linted
refactoring type definition
fix test fails
lint
* lint
2019-09-16 23:46:57 +08:00
Renamed from packages/docusaurus-plugin-content-blog/src/markdownLoader.js (Browse further)