You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by bz...@apache.org on 2022/09/02 02:27:09 UTC

[apisix-website] branch master updated: refactor: rm shuffle picked posts from second blog list page (#1306)

This is an automated email from the ASF dual-hosted git repository.

bzp2010 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new e024a490fa2 refactor: rm shuffle picked posts from second blog list  page (#1306)
e024a490fa2 is described below

commit e024a490fa2f7685b8536c53e770cd3cde2ff07d
Author: Young <is...@outlook.com>
AuthorDate: Fri Sep 2 10:27:04 2022 +0800

    refactor: rm shuffle picked posts from second blog list  page (#1306)
---
 .../08/28/fault-injection-testing-with-api-gateway.md   |  3 +--
 blog/package.json                                       |  1 -
 blog/src/theme/BlogPosts/index.tsx                      | 17 ++---------------
 yarn.lock                                               |  5 -----
 4 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/blog/en/blog/2022/08/28/fault-injection-testing-with-api-gateway.md b/blog/en/blog/2022/08/28/fault-injection-testing-with-api-gateway.md
index b7d80c7bb20..a13f53adb3e 100644
--- a/blog/en/blog/2022/08/28/fault-injection-testing-with-api-gateway.md
+++ b/blog/en/blog/2022/08/28/fault-injection-testing-with-api-gateway.md
@@ -11,8 +11,7 @@ keywords:
 - Testing
 - Fault Injection
 - Microservices
-description: 
-The blog post describes how Apache APISIX is useful for testing the robustness and resilience of microservices APIs. Throughout the post, we also get to know the types of possible failure injections with the Fault Injection Plugin.
+description: The blog post describes how Apache APISIX is useful for testing the robustness and resilience of microservices APIs. Throughout the post, we also get to know the types of possible failure injections with the Fault Injection Plugin.
 tags: [Case Studies]
 ---
 
diff --git a/blog/package.json b/blog/package.json
index acd045020f4..8cafb18c3b6 100644
--- a/blog/package.json
+++ b/blog/package.json
@@ -40,7 +40,6 @@
     "fitty": "^2.3.6",
     "gsap": "^3.7.1",
     "lethargy": "^1.0.9",
-    "lodash.shuffle": "^4.2.0",
     "raw-loader": "^4.0.2",
     "rc-image": "^5.6.2",
     "react": "^17.0.2",
diff --git a/blog/src/theme/BlogPosts/index.tsx b/blog/src/theme/BlogPosts/index.tsx
index 54e4c829e2a..78912e10d82 100644
--- a/blog/src/theme/BlogPosts/index.tsx
+++ b/blog/src/theme/BlogPosts/index.tsx
@@ -12,7 +12,6 @@ import type {
 } from 'react';
 import React from 'react';
 import useWindowType from '@theme/hooks/useWindowSize';
-import shuffle from 'lodash.shuffle';
 import { useLocation } from '@docusaurus/router';
 import { translate } from '@docusaurus/Translate';
 import { useBaseUrlUtils } from '@docusaurus/useBaseUrl';
@@ -239,8 +238,8 @@ const BlogPosts: FC<BlogPostsProps> = ({
 
   if (!pathname.includes('/tags/')) {
     if (isFirstPage) {
-       // In the first page, all selected articles will be inserted between
-       // the original first and second article
+      // In the first page, all selected articles will be inserted between
+      // the original first and second article
       posts.splice(
         1,
         0,
@@ -254,18 +253,6 @@ const BlogPosts: FC<BlogPostsProps> = ({
             />
           )),
       );
-    } else {
-      // Starting from the second page, the picked article will be mixed in all articles
-      const finalPickedPosts = shuffle(pickedPosts).slice(0, endIdx);
-      const positions = shuffle(Array.from({ length: 9 }, (_, idx) => idx)).slice(0, 3);
-      positions.forEach((fromIdx) => {
-        const info = finalPickedPosts.pop();
-        posts.splice(
-          fromIdx,
-          0,
-          <PickedBlogItem info={info} {...{ delayMethod, delayTime, useIntersectionObserver }} />,
-        );
-      });
     }
   }
 
diff --git a/yarn.lock b/yarn.lock
index a4850b5ff96..5f9e188e8e6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7543,11 +7543,6 @@ lodash.merge@^4.6.2:
   resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
   integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
 
-lodash.shuffle@^4.2.0:
-  version "4.2.0"
-  resolved "https://registry.yarnpkg.com/lodash.shuffle/-/lodash.shuffle-4.2.0.tgz#145b5053cf875f6f5c2a33f48b6e9948c6ec7b4b"
-  integrity sha512-V/rTAABKLFjoecTZjKSv+A1ZomG8hZg8hlgeG6wwQVD9AGv+10zqqSf6mFq2tVA703Zd5R0YhSuSlXA+E/Ei+Q==
-
 lodash.throttle@^4.1.1:
   version "4.1.1"
   resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"