Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RDIL committed Sep 11, 2021
1 parent fe915c7 commit ecd146d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v1.2.0 - 8/10/2021

- Update Axios to prevent security warnings
- Require Node.js v12
- Added `outputDirectory` option to control which folder the downloaded content is put in
- Updated TypeScript compiler target to reduce polyfill bloat

## v1.1.0 - 2/3/2021

- Internal refactoring to simplify code
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module.exports = {
- `docsIntegration`: (optional) `boolean` - If the documents specified should be downloaded to the docs directory.
- `performCleanup`: (optional) `boolean` - If the documents downloaded should be deleted after the build is completed. Defaults to true.
- `noRuntimeDownloads`: (optional) `boolean` - If you only want to use the CLI to download the remote content, you should change this to true.
- `outputDirectory`: (optional) `string` - The subfolder to emit the downloaded content to (e.g. `docs/<subfolder>/<downloaded file.md>` - the prefix is set based on if you have the docs or blog integrations active).

## Contributing

Expand All @@ -79,4 +80,4 @@ It isn't really that hard. Follow these simple steps!:
When you update the plugin, in order to preview your changes on the test site, you need to:

1. Use the first shell you opened to re-run `yarn build` (in the repository's _root_ directory).
2. In the second shell, `Control+C` (or `Command+C` on macOS) the running Docusaurus dev server, and re-run `yarn start`.
2. In the second shell, `Control+C` the running Docusaurus dev server, and re-run `yarn start`.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-plugin-remote-content",
"version": "1.1.0",
"version": "1.2.0",
"description": "A Docusaurus v2 plugin that allows you to fetch content from remote sources!",
"main": "build/index.js",
"repository": "https://github.com/rdilweb/docusaurus-plugin-remote-content.git",
Expand Down Expand Up @@ -38,7 +38,8 @@
},
"files": [
"build",
"src"
"src",
"CHANGELOG.md"
],
"directories": {
"example": "testsite",
Expand Down
12 changes: 8 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ export default function pluginRemoteContent(
const a: Collectable[] = []

if (docsIntegration === true || blogIntegration === true) {
;((typeof documents == "function"
? documents.call(context.siteConfig)
: documents) as string[]).forEach((d) => {
;(
(typeof documents == "function"
? documents.call(context.siteConfig)
: documents) as string[]
).forEach((d) => {
if (d.endsWith("md")) {
a.push({ url: `${sourceBaseUrl}/${d}`, identifier: d })
} else {
Expand All @@ -126,7 +128,9 @@ export default function pluginRemoteContent(
}

if (!returnValue) {
throw new Error("Fell through! No integrations are enabled! Please check the documentation.")
throw new Error(
"Fell through! No integrations are enabled! Please check the documentation."
)
}

if (outputDirectory) {
Expand Down

0 comments on commit ecd146d

Please sign in to comment.