From 256c11617eee6a519e38cfb830334e400c841100 Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Wed, 13 Sep 2023 16:36:37 +0530 Subject: [PATCH] [Feat] - Add Sitemap Feature for the Docs (#170) * Fixed formatting issues Signed-off-by: Adithya Krishna * Added Sitemap Config Signed-off-by: Adithya Krishna * Updated Sitemap Config Signed-off-by: Adithya Krishna --------- Signed-off-by: Adithya Krishna --- docs/develop/rust/wasinn/mediapipe.md | 16 ++----- docs/start/usage/use-cases.md | 2 +- docusaurus.config.js | 43 ++++++++++++++----- .../current/develop/rust/wasinn/mediapipe.md | 16 ++----- .../current/start/usage/use-cases.md | 2 +- package-lock.json | 2 + package.json | 1 + 7 files changed, 45 insertions(+), 37 deletions(-) diff --git a/docs/develop/rust/wasinn/mediapipe.md b/docs/develop/rust/wasinn/mediapipe.md index c51e2e1b..40baedc1 100644 --- a/docs/develop/rust/wasinn/mediapipe.md +++ b/docs/develop/rust/wasinn/mediapipe.md @@ -4,10 +4,7 @@ sidebar_position: 1 # Mediapipe solutions -Mediapipe is a collection of highly popular AI models developed by Google. They focus on intelligent processing of media files -and streams. The `mediapipe-rs` crate is a Rust library for data processing using the Mediapipe suite of models. The crate provides -Rust APIs to pre-process the data in media files or streams, run AI model inference to analyze the data, and then post-process -or manipulate the media data based on the AI output. +Mediapipe is a collection of highly popular AI models developed by Google. They focus on intelligent processing of media files and streams. The `mediapipe-rs` crate is a Rust library for data processing using the Mediapipe suite of models. The crate provides Rust APIs to pre-process the data in media files or streams, run AI model inference to analyze the data, and then post-process or manipulate the media data based on the AI output. ## Prerequisite @@ -63,10 +60,7 @@ DetectionResult: ## Understand the code -The [main.rs](https://github.com/juntao/demo-object-detection/blob/main/src/main.rs) is the complete example Rust source. -All `mediapipe-rs` APIs follow a common pattern. A Rust struct is designed to work with a model. It contains functions -required to pre- and post-process data for the model. For example, we can create an `detector` instance -using the builder pattern, which can build from any "object detection" model in the Mediapipe model library. +The [main.rs](https://github.com/juntao/demo-object-detection/blob/main/src/main.rs) is the complete example Rust source. All `mediapipe-rs` APIs follow a common pattern. A Rust struct is designed to work with a model. It contains functions required to pre- and post-process data for the model. For example, we can create an `detector` instance using the builder pattern, which can build from any "object detection" model in the Mediapipe model library. ```rust let model_data: &[u8] = include_bytes!("mobilenetv2_ssd_256_uint8.tflite"); @@ -75,8 +69,7 @@ let detector = ObjectDetectorBuilder::new() .build_from_buffer(model_data)?; ``` -The `detect()` function takes in an image, pre-processes it into a tensor array, runs inference on the mediapipe object detection model, -and the post-processes the returned tensor array into a human redable format stored in the `detection_result`. +The `detect()` function takes in an image, pre-processes it into a tensor array, runs inference on the mediapipe object detection model, and the post-processes the returned tensor array into a human redable format stored in the `detection_result`. ```rust let mut input_img = image::open(img_path)?; @@ -84,8 +77,7 @@ let detection_result = detector.detect(&input_img)?; println!("{}", detection_result); ``` -Furthermore, the `mediapipe-rs` crate provides additional utility functions to post-process the data. For example, -the `draw_detection()` utility function draws the data in `detection_result` onto the input image. +Furthermore, the `mediapipe-rs` crate provides additional utility functions to post-process the data. For example, the `draw_detection()` utility function draws the data in `detection_result` onto the input image. ```rust draw_detection(&mut input_img, &detection_result); diff --git a/docs/start/usage/use-cases.md b/docs/start/usage/use-cases.md index 9218603d..69284963 100644 --- a/docs/start/usage/use-cases.md +++ b/docs/start/usage/use-cases.md @@ -20,4 +20,4 @@ Featuring AOT compiler optimization, WasmEdge is one of the fastest WebAssembly - WasmEdge applications can be plugged into existing application frameworks or platforms. -If you have any great ideas on WasmEdge, don't hesitate to open a GitHub issue to discuss together. \ No newline at end of file +If you have any great ideas on WasmEdge, don't hesitate to open a GitHub issue to discuss together. diff --git a/docusaurus.config.js b/docusaurus.config.js index 72204fd7..43e3a37c 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -64,6 +64,12 @@ const config = { theme: { customCss: require.resolve('./src/css/custom.css'), }, + sitemap: { + changefreq: 'weekly', + priority: 0.5, + ignorePatterns: ['/tags/**'], + filename: 'sitemap.xml', + }, }), ], ], @@ -172,13 +178,16 @@ const config = { { label: 'Getting Started', to: '/start/overview', - }, { + }, + { label: 'Develop', to: '/develop/overview', - }, { + }, + { label: 'Embeds', to: '/embed/overview', - }, { + }, + { label: 'Contribute', to: '/contribute/overview', } @@ -189,18 +198,26 @@ const config = { { label: 'Github', href: 'https://github.com/WasmEdge/WasmEdge', - }, { + }, + { label: 'Second State', href: 'https://www.secondstate.io/', - }, { + }, + { label: 'Articles & Blog', href: 'https://www.secondstate.io/articles/' - }, { + }, + { label: 'WasmEdge Talks', to: '/talks' - }, { + }, + { label: 'Releases', to: '/releases' + }, + { + label: 'Sitemap', + href: 'https://wasmedge.org/docs/sitemap.xml' } ], }, @@ -210,16 +227,20 @@ const config = { { label: 'Mailing List', href: 'https://groups.google.com/g/wasmedge/' - }, { + }, + { label: 'Discord', href: 'https://discord.gg/U4B5sFTkFc', - }, { + }, + { label: 'Twitter', href: 'https://twitter.com/realwasmedge', - }, { + }, + { label: 'Slack #WasmEdge', href: 'https://cloud-native.slack.com/archives/C0215BBK248' - }, { + }, + { label: 'Community Meeting', href: 'https://docs.google.com/document/d/1iFlVl7R97Lze4RDykzElJGDjjWYDlkI8Rhf8g4dQ5Rk/edit?usp=sharing' } diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md index c51e2e1b..40baedc1 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/develop/rust/wasinn/mediapipe.md @@ -4,10 +4,7 @@ sidebar_position: 1 # Mediapipe solutions -Mediapipe is a collection of highly popular AI models developed by Google. They focus on intelligent processing of media files -and streams. The `mediapipe-rs` crate is a Rust library for data processing using the Mediapipe suite of models. The crate provides -Rust APIs to pre-process the data in media files or streams, run AI model inference to analyze the data, and then post-process -or manipulate the media data based on the AI output. +Mediapipe is a collection of highly popular AI models developed by Google. They focus on intelligent processing of media files and streams. The `mediapipe-rs` crate is a Rust library for data processing using the Mediapipe suite of models. The crate provides Rust APIs to pre-process the data in media files or streams, run AI model inference to analyze the data, and then post-process or manipulate the media data based on the AI output. ## Prerequisite @@ -63,10 +60,7 @@ DetectionResult: ## Understand the code -The [main.rs](https://github.com/juntao/demo-object-detection/blob/main/src/main.rs) is the complete example Rust source. -All `mediapipe-rs` APIs follow a common pattern. A Rust struct is designed to work with a model. It contains functions -required to pre- and post-process data for the model. For example, we can create an `detector` instance -using the builder pattern, which can build from any "object detection" model in the Mediapipe model library. +The [main.rs](https://github.com/juntao/demo-object-detection/blob/main/src/main.rs) is the complete example Rust source. All `mediapipe-rs` APIs follow a common pattern. A Rust struct is designed to work with a model. It contains functions required to pre- and post-process data for the model. For example, we can create an `detector` instance using the builder pattern, which can build from any "object detection" model in the Mediapipe model library. ```rust let model_data: &[u8] = include_bytes!("mobilenetv2_ssd_256_uint8.tflite"); @@ -75,8 +69,7 @@ let detector = ObjectDetectorBuilder::new() .build_from_buffer(model_data)?; ``` -The `detect()` function takes in an image, pre-processes it into a tensor array, runs inference on the mediapipe object detection model, -and the post-processes the returned tensor array into a human redable format stored in the `detection_result`. +The `detect()` function takes in an image, pre-processes it into a tensor array, runs inference on the mediapipe object detection model, and the post-processes the returned tensor array into a human redable format stored in the `detection_result`. ```rust let mut input_img = image::open(img_path)?; @@ -84,8 +77,7 @@ let detection_result = detector.detect(&input_img)?; println!("{}", detection_result); ``` -Furthermore, the `mediapipe-rs` crate provides additional utility functions to post-process the data. For example, -the `draw_detection()` utility function draws the data in `detection_result` onto the input image. +Furthermore, the `mediapipe-rs` crate provides additional utility functions to post-process the data. For example, the `draw_detection()` utility function draws the data in `detection_result` onto the input image. ```rust draw_detection(&mut input_img, &detection_result); diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/start/usage/use-cases.md b/i18n/zh/docusaurus-plugin-content-docs/current/start/usage/use-cases.md index 9218603d..69284963 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/start/usage/use-cases.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/start/usage/use-cases.md @@ -20,4 +20,4 @@ Featuring AOT compiler optimization, WasmEdge is one of the fastest WebAssembly - WasmEdge applications can be plugged into existing application frameworks or platforms. -If you have any great ideas on WasmEdge, don't hesitate to open a GitHub issue to discuss together. \ No newline at end of file +If you have any great ideas on WasmEdge, don't hesitate to open a GitHub issue to discuss together. diff --git a/package-lock.json b/package-lock.json index b6f7eda1..59628a41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "0.0.0", "dependencies": { "@docusaurus/core": "^2.4.0", + "@docusaurus/plugin-google-gtag": "^2.4.1", + "@docusaurus/plugin-sitemap": "^2.4.1", "@docusaurus/preset-classic": "^2.4.0", "@docusaurus/theme-mermaid": "^2.4.1", "@easyops-cn/docusaurus-search-local": "^0.35.0", diff --git a/package.json b/package.json index d42596f9..3f2f42b4 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "dependencies": { "@docusaurus/core": "^2.4.0", "@docusaurus/plugin-google-gtag": "^2.4.1", + "@docusaurus/plugin-sitemap": "^2.4.1", "@docusaurus/preset-classic": "^2.4.0", "@docusaurus/theme-mermaid": "^2.4.1", "@easyops-cn/docusaurus-search-local": "^0.35.0",