# @bigbinary/neeto-seo-frontend 中文文档

规范地址：https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/

版本：3\.2\.1
npm 元数据更新时间：2026-10-31T21:27:18.547Z
中文译文更新时间：2026-11-08T02:11:22.019Z
软件包许可：UNLICENSED

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bigbinary/neeto-seo-frontend
原文对照：https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/?lang=original
项目主页：https://github.com/bigbinary/neeto-seo-nano

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：349 kB，87 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.13
- 运行依赖：2 个
- peer 依赖：qs 6\.16\.2，url 0\.11\.4，yup 0\.32\.11，antd 5\.22\.1，util ^0\.12\.5，axios 1\.20\.0，ramda 0\.29\.0，react 18\.3\.1，buffer ^6\.0\.3，formik 2\.4\.6，i18next 22\.5\.1，zustand 4\.4\.2，dompurify 3\.4\.17，js-logger 1\.6\.1，react-dom 18\.3\.1，classnames 2\.5\.1，stream-http 3\.2\.0，tailwindcss 3\.4\.14，react-helmet ^6\.1\.0，os-browserify 0\.3\.0，react-i18next 12\.3\.1，vm-browserify 1\.1\.2，@babel/runtime 7\.29\.7，react-toastify 8\.0\.2，tty-browserify 0\.0\.1，path-browserify ^1\.0\.1，https-browserify 1\.0\.0，mixpanel-browser ^2\.45\.0，react-router-dom 5\.3\.3，crypto-browserify 3\.12\.1，source-map-loader 4\.0\.1，stream-browserify ^3\.0\.0，@bigbinary/neetoui 8\.8\.3，@honeybadger-io/js 6\.10\.1，@bigbinary/neeto-cist 1\.0\.17，@honeybadger-io/react 6\.1\.25，@tanstack/react-query 5\.59\.20，@bigbinary/neeto-atoms 1\.1\.2，@bigbinary/neeto-icons 1\.20\.89，@bigbinary/neeto-molecules 5\.9\.13，@tailwindcss/container-queries ^0\.1\.1，@tanstack/react-query-devtools 5\.59\.20，@bigbinary/neeto-commons-frontend 4\.14\.8，@bigbinary/neeto-filters-frontend 4\.6\.3
- 首次发布：2025-01-23T13:33:36.025Z
- 最新版本发布：2026-10-31T21:27:18.369Z
- 近 30 天下载量：10529（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：41（近 12 个月 32 个）

## 中文简介

一个回波作为新纳米结构,配置,数据等的真理来源.

## 安装

```sh
npm install @bigbinary/neeto-seo-frontend
```

也可以使用：`pnpm add @bigbinary/neeto-seo-frontend`、`yarn add @bigbinary/neeto-seo-frontend`、`bun add @bigbinary/neeto-seo-frontend`

## README

# {\\fn黑体\\fs22\\bord1\\shad0\\3ahbe\\4ah00\\fscx67\\fscy66\\2chffffff\\3ch808080}我必须去seo -nano

这个 `neeto-seo-nano` 管理跨 Neeto 应用程序的 SIO 设置 .

## 目录

1.  [用主机应用程序开发](https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/#readme-development-with-host-application)
2.  [出版指令](https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/#readme-instructions-for-publishing)

## 用主机应用程序开发

#### 安装

1.  将此行添加到您的应用程序的 Gemfile 中 :
    
    ```ruby
     source "NEETO_GEM_SERVER_URL" do
       # ..existing gems
    
       gem "neeto-seo-engine"
     end
    ```
    
2.  然后执行:
    
    ```shell
    bundle install
    ```
    
3.  运行迁移
    
    ```shell
    bundle exec rails neeto_seo_engine:install:migrations
    bundle exec rails db:migrate
    ```
    

#### 使用量

1.  添加关联
    
    ```ruby
    class BlogPost > ApplicationRecord
      has_one :seo_setting, as: :entity, class_name: "NeetoSeoEngine::SeoSetting", dependent: :destroy
    end
    ```
    
2.  添加控制器
    
    所有常见的控制器逻辑被提取到引擎上. 然而,我们仍然 需要从主机应用程序控制器上装入一些记录 .
    
    ```ruby
    class Api::V1::Admin::BlogPosts::SeoSettingsController < NeetoSeoEngine::Api::V1::SeoSettingsController
      private
    
        def load_entity!
          @entity = @organization.blog_posts.find(params[:blog_post_id])
        end
    end
    ```
    
3.  在您的应用程序中包含以下模块 `config/routes.rb` 文件 :
    
    ```ruby
    include NeetoSeoEngine::Routes::Draw
    
    ```
    
4.  定义所需路线.
    

```ruby

# routes/admin.rb
seo_setting_routes
```

5.  在主机应用程序下创建文件 `app/lib/neeto_seo_engine/callbacks.rb` 打开 提供许可( 如果您没有权限, 那么只需返回 真实的)
    
    ```ruby
    module NeetoSeoEngine
      class Callbacks
        def self.can_manage_seo_settings?(user)
          user.has_permission?("neeto_seo_engine.manage_seo_settings")
        end
      end
    end
    ```
    
    注意: 如果此执行在主机应用程序中缺失, 则策略 将默认检查 `user.has_permission?("neeto_seo_engine.manage_seo_settings")`。 。 。 .
    
6.  在您想要的路径中添加前端组件 。 里面有两个组件 软件包 :
    
    1.  [徐阶镇](https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/app/javascript/src/components/SeoSettings/Pane/index.jsx)
    2.  [徐定居页](https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/app/javascript/src/components/SeoSettings/Page.jsx)
    
    这个 `SeoSettingsPage` 包括 `SeoSettingsPane` 在它内部。 这个 `SeoSettingsPage` 用于需要整页组件的实体, 时 `SeoSettingsPane` 用于仅指窗格的情况 所需经费.
    
    以下是使用 `SeoSettingsPane`数字 :
    
    ```jsx
    const SeoSettings = ({ isOpen, onClose }) => {
      const { blogPostId } = useParams();
    
      const SEO_FORM_FIELDS = [
        {
          name: "title",
          helpDocUrl: "https://help.neetopublish.com/#1-page-title",
          maxLength: 80,
        },
        {
          name: "description",
          altLabel: "Meta Description",
          altPlaceholder: "Enter meta Description",
          helpDocUrl: "https://help.neetopublish.com/#2-meta-description",
          maxLength: 150,
        },
        {
          name: "keywords",
          helpDocUrl: "https://help.neetopublish.com/#3-keywords",
          maxLength: 150,
          popOverDescription: "Some description about Meta keywords",
        },
        { name: "allowSearchEngineCrawl" },
        { name: "googleAnalyticsTrackingId" },
        { name: "coverImage" },
      ];
    
      return (
        <SeoSettingsPane
          {...{ isOpen, onClose }}
          apiEndpointUrl={`${BASE_API_V1_URL}/admin/blog_posts/${blogPostId}/seo_setting`}
          defaultHelpDocUrl="https://help.neetopublish.com/search-engine-optimization"
          entity="Page"
          seoFormFields={SEO_FORM_FIELDS}
        />
      );
    };
    ```
    
    您需要构建 SEO 组成字段,其中包含您想要的字段 发动机。 允许的球场是 `title`, (中文(简体) ), `titleSuffix`, (中文(简体) ), `keywords`,以及 `description`, (中文(简体) ), `allowSearchEngineToCrawl`, (中文(简体) ), `googleAnalyticsTrackingId`,以及 `coverImage`。这些组件将相应生成。 你可以通过 相应的 `helpDocUrl`, (中文(简体) ), `popOverDescription`,以及 `maxLength`编辑 `name` 用于生成组件.
    
    也可以通过一个 `additionalComponent` 附加附加文件的道具 选项 `SeoSettingsPane`。 。 。 .
    
    你必须通过 `entity` 道具,可以是 **页次**, (中文(简体) ), **条款**, (中文(简体) ), **站点**或者你选择的任何其他实体.
    
    这个 [徐定居页](https://npmcn.com/package/%40bigbinary/neeto-seo-frontend/app/javascript/src/components/SeoSettings/Page.jsx) 已经 类似道具。 此外,你可以通过 `breadcrumbs` 财务报告和审定财务报表 `helpPopoverDescription` 页面编号.
    

## 出版指令

咨询 [构建和释放软件包](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) 关于如何出版的详细指南.

## 常见问题

### @bigbinary/neeto-seo-frontend 是什么？

一个回波作为新纳米结构,配置,数据等的真理来源\.

### 如何安装 @bigbinary/neeto-seo-frontend？

在项目目录运行 npm install @bigbinary/neeto-seo-frontend，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：qs（6\.16\.2）、url（0\.11\.4）、yup（0\.32\.11）、antd（5\.22\.1）、util（^0\.12\.5）、axios（1\.20\.0）、ramda（0\.29\.0）、react（18\.3\.1）、buffer（^6\.0\.3）、formik（2\.4\.6）、i18next（22\.5\.1）、zustand（4\.4\.2）、dompurify（3\.4\.17）、js-logger（1\.6\.1）、react-dom（18\.3\.1）、classnames（2\.5\.1）、stream-http（3\.2\.0）、tailwindcss（3\.4\.14）、react-helmet（^6\.1\.0）、os-browserify（0\.3\.0）、react-i18next（12\.3\.1）、vm-browserify（1\.1\.2）、@babel/runtime（7\.29\.7）、react-toastify（8\.0\.2）、tty-browserify（0\.0\.1）、path-browserify（^1\.0\.1）、https-browserify（1\.0\.0）、mixpanel-browser（^2\.45\.0）、react-router-dom（5\.3\.3）、crypto-browserify（3\.12\.1）、source-map-loader（4\.0\.1）、stream-browserify（^3\.0\.0）、@bigbinary/neetoui（8\.8\.3）、@honeybadger-io/js（6\.10\.1）、@bigbinary/neeto-cist（1\.0\.17）、@honeybadger-io/react（6\.1\.25）、@tanstack/react-query（5\.59\.20）、@bigbinary/neeto-atoms（1\.1\.2）、@bigbinary/neeto-icons（1\.20\.89）、@bigbinary/neeto-molecules（5\.9\.13）、@tailwindcss/container-queries（^0\.1\.1）、@tanstack/react-query-devtools（5\.59\.20）、@bigbinary/neeto-commons-frontend（4\.14\.8）、@bigbinary/neeto-filters-frontend（4\.6\.3）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bigbinary/neeto-seo-frontend 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bigbinary/neeto-seo-frontend 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @bigbinary/neeto-seo-frontend 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22\.13。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @bigbinary/neeto-seo-frontend 可以商用吗？

@bigbinary/neeto-seo-frontend 使用 UNLICENSED 许可。作者声明为 UNLICENSED，即不授予公开使用许可（与公共领域的 Unlicense 不同）。使用前需获得作者授权。以上为概括，不构成法律意见，请以许可原文为准。

### @bigbinary/neeto-seo-frontend 的下载量有多少？

根据 npm 官方下载统计，@bigbinary/neeto-seo-frontend 在 2026/10/08 – 2026/11/06 这 30 天内被下载 10,529 次，日均约 351 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bigbinary/neeto-seo-frontend 还在维护吗？

最新版本 3\.2\.1 发布于 2026/11/01（7 天前）；至今共发布 41 个版本，其中过去 12 个月发布了 32 个；首次发布于 2025/01/23。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

