From 81fca3e19e3ffc53243cdf3ceacec42a6a8b8ce8 Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Wed, 13 Dec 2023 16:29:48 +0330 Subject: [PATCH] chore: upgrade @acid-info/docusaurus-remote-content and update README.md --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ docusaurus.config.js | 11 +++-------- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 52 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ea3244e..9d5ce2f 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,50 @@ For additional customization options, please refer to the [Docusaurus Configurat To add a document, create a `.md` or `mdx` file within the `docs` directory. You can use [Frontmatter](https://docusaurus.io/docs/markdown-features#front-matter) to add metadata to your markdown file. +This repository extends content of the [Logos Brand Guidelines](https://github.com/acid-info/guide.logos.co) by leveraging the [Docusaurus Remote Content plugin](https://github.com/acid-info/logos-docusaurus-plugins/tree/main/packages/docusaurus-remote-content). The plugin downloads the content from the remote repository into this repository. To retrieve the content, run the following command: + +```bash +yarn docusaurus remote-content download +``` + +This command automatically downloads content from the remote repository, replacing the local content in the `docs` directory and static files located in the `static` directory. However, if you wish to retain specific local files, follow these steps: + +1. Open `docusaurus.config.js` in your project. + +2. Locate the configuration for the `@acid-info/docusaurus-remote-content` plugin. + +3. Add the paths of the local files you want to keep to either the `keepLocal` or `keepStatic` properties. + + - Paths in `keepLocal` should be relative to the `docs` directory at the root of this repository. + - Paths in `keepStatic` should be relative to the `static` directory at the root of this repository. + +Here are some examples using glob patterns: + +- To keep a single file: `./visual-language/logo.mdx` +- To keep an entire directory: `./visual-language/**/*` + +If you want to exclude specific files or directories from being copied from the remote repository, use the `excludeRemote` property. For instance, to exclude the `./visual-language/lsd/` directory, modify the plugin configuration as follows: + +```javascript +plugins: [ + [ + '@acid-info/docusaurus-remote-content', + /** @type {import('@acid-info/docusaurus-remote-content').PluginOptions} */ + ({ + remote: { + type: 'zip', + url: + 'https://github.com/acid-info/guide.logos.co/archive/refs/heads/develop.zip', + dir: 'guide.logos.co-develop', + }, + outDir: 'docs', + sourceDir: 'docs', + excludeRemote: ['./visual-language/lsd/**/*'] + }), + ], +], +``` + ## Docusaurus Config You can find instructions for adding additional documentation sections, implementing localization, and managing versioning on the [Docusaurus](https://docusaurus.io/docs) website. diff --git a/docusaurus.config.js b/docusaurus.config.js index f02a27b..2f78fd0 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -2,9 +2,6 @@ // Note: type annotations allow type checking and IDEs autocompletion require('dotenv').config() -const downloadRemoteContent = - process.env.SKIP_DOWNLOAD !== '1' && process.env.NODE_ENV !== 'production' - /** @type {import('@docusaurus/types').Config} */ const config = { title: 'Waku', @@ -56,13 +53,11 @@ const config = { '@docusaurus/plugin-ideal-image', { quality: 100, - max: 1080, - min: 400, - steps: 2, + sizes: [400], disableInDev: true, }, ], - (downloadRemoteContent && [ + [ '@acid-info/docusaurus-remote-content', /** @type {import('@acid-info/docusaurus-remote-content').PluginOptions} */ ({ @@ -77,7 +72,7 @@ const config = { keepLocal: ['./visual-language/logo.mdx'], keepStatic: ['waku/**/*'], }), - ]), + ], ], themes: [ diff --git a/package.json b/package.json index 57c72fb..812efd0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "typecheck": "tsc" }, "dependencies": { - "@acid-info/docusaurus-remote-content": "^1.0.0-alpha.124", + "@acid-info/docusaurus-remote-content": "^1.0.0-alpha.128", "@acid-info/logos-docusaurus-brand-guidelines-theme": "^1.0.0-alpha.123", "@acid-info/logos-docusaurus-preset": "^1.0.0-alpha.121", "@docusaurus/plugin-ideal-image": "2.4.1", diff --git a/yarn.lock b/yarn.lock index 19c2bec..bc2956b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,10 @@ satori "^0.10.1" sharp "^0.32.1" -"@acid-info/docusaurus-remote-content@^1.0.0-alpha.124": - version "1.0.0-alpha.124" - resolved "https://registry.yarnpkg.com/@acid-info/docusaurus-remote-content/-/docusaurus-remote-content-1.0.0-alpha.124.tgz#93e67cee5cf046a4a6c4ffbb5e38a67b28357c27" - integrity sha512-WAjTpZwvPGVAgNKXAC/1mCYm0txBf9GLFewQsxoxx0vcFxBDAQUv2WJ1OpXej0jPvlaIVymSNo/6fIfGKTUN+g== +"@acid-info/docusaurus-remote-content@^1.0.0-alpha.128": + version "1.0.0-alpha.128" + resolved "https://registry.yarnpkg.com/@acid-info/docusaurus-remote-content/-/docusaurus-remote-content-1.0.0-alpha.128.tgz#b54511ba00d44acc89640fc116ad53c497795c7c" + integrity sha512-9JPu1jUyXj2n+TM6LxONoIUdNF8WGHNmFNxdMImAJVQIzaCfu1o+mtYhMG/Qt1wLrCM2ledAShJbSIwnOARCNw== dependencies: axios "^1.6.2" fast-glob "^3.3.2"