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

[Feature Request] 关于 exportStatic 产出的静态内容对 SEO 的影响 #12933

Open
jaykou25 opened this issue Feb 21, 2025 · 0 comments
Open

Comments

@jaykou25
Copy link
Contributor

Background

有一个疑问需要请教一下各位. 我用 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>

Proposal

如果对 SEO 有影响, 可否修改静态产出.

@jaykou25 jaykou25 changed the title [Feature Request] 关于 exportStatic 静态内容的产出对 SEO 的影响 [Feature Request] 关于 exportStatic 产出的静态内容对 SEO 的影响 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