Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 exportStatic 静态内容的产出对 SEO 的影响 #12931

Closed
jaykou25 opened this issue Feb 21, 2025 · 1 comment
Closed

关于 exportStatic 静态内容的产出对 SEO 的影响 #12931

jaykou25 opened this issue Feb 21, 2025 · 1 comment

Comments

@jaykou25
Copy link
Contributor

有一个疑问需要请教一下各位. 我用 dumi 构建了一个组件库, 并且生成了静态站点.

站点使用 umi 的 exportStatic 预渲染出静态内容. 但是这些内容默认都是隐藏的, 需要 js 来控制其显示.

我对 SEO 不熟, 我不确定这样的逻辑会不会影响搜索引擎对内容的收录. (同时会不会影响对内容中的链接的爬取)

我比较了一下各个框架生成的静态产物:

Dumi

以 dumi 官网首页为例:

<html>
  <head></head>
  <body>
    <noscript>
      <b>Enable JavaScript to run this app.</b>
    </noscript>

    <div id="root">
      <!--$?-->
      <template id="B:0"></template>
      <div></div>
      <!--/$-->
    </div>

    <script src="/umi.79140827.js" async=""></script>

    <div hidden id="S:0">
      <!--$?-->
      <template id="B:1"></template>
      <div></div>
      <!--/$-->
    </div>

    <script>
      $RC = function (b, c, e) {};
      $RC("B:0", "S:0");
    </script>

    <div hidden id="S:1">
      <!-- 内容 -->
    </div>

    <script>
      $RC("B:1", "S:1");
    </script>

    <div hidden id="S:2">
      <!-- 内容 -->
    </div>

    <script>
      $RC("B:2", "S:2");
    </script>
  </body>
</html>

Docusaurus

<html>
  <head>
    <script src="/assets/js/main.f3760bab.js" defer="defer"></script>
  </head>
  <body>
    <div id="__docusaurus">
      <!-- 内容 -->
    </div>
  </body>
</html>

Gatsby

<html>
  <head> </head>
  <body>
    <div id="___gatsby">
      <!-- 内容 -->
    </div>
    <script src="/app-a153dc8a0a5ad79dfca0.js" async></script>
  </body>
</html>

麻烦熟悉 SEO 的解答一下, 感谢🤝

Copy link

由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant