@bbc/psammead-sitewide-links

中文文档
6.0.18发布于 2021/03/18Apache-2.0ESM + CJS近 30 天下载 3929

React component for a sitewide-links

此软件包已被标记为弃用

This package is no longer being maintained

原始使用文档
文档目录8 节
  1. Description
  2. Installation
  3. Props
  4. Usage
  5. When to use this component
  6. Contributing
  7. Code of Conduct
  8. License

psammead-sitewide-links - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Deprecation notice - this component is no longer being maintained.

Description

The psammead-sitewide-links component is intended to be used at the bottom of an article, serving as a footer, however can be used anywhere on a page. These links are generally intended to be to more general and legal BBC pages, but do not have to be. It also includes information about copyright.

Installation

npm install @bbc/psammead-sitewide-links --save

Props

ArgumentTypeRequiredDefaultExample
linksArray of Link objectsYesN/A[{href:'https://www.bbc.com', text: 'The BBC', lang: 'en-GB'}]
copyrightTextNodeYesN/A<span>@ BBC News</span>
externalLinkLink objectYesN/A{href:'https://www.bbc.com', text: 'The BBC'}
serviceStringYesN/A'news'
trustProjectLinkLink objectNonull{href:'https://www.bbc.co.uk/news', text: 'Why you can trust the bbc'}

Usage

import SitewideLinks from '@bbc/psammead-sitewide-links';

const props = {
  links: [
    { href: 'https://www.bbc.co.uk/news', text: 'BBC News' },
    { href: 'https://www.bbc.co.uk/sport', text: 'BBC Sport' },
    { href: 'https://www.bbc.co.uk/mundo', text: 'BBC Mundo', lang: 'en-GB' },
  ],
  copyrightText: <span>@ BBC News</span>,
  externalLink: { href: 'https://www.bbc.com', text: 'The BBC' },
  service: 'news',
};

const WrappingComponent = () => <SitewideLinks {...props} />;

The typical use-case of this component is at the bottom of BBC pages in a footer element. When this is done it is recommend that the component is wrapped in a contentinfo landmark which denotes content around copyright, privacy and related content.

Example -

<footer role="contentinfo">
  <SitewideLinks service="news" />
</footer>

When to use this component

It is currently used at the bottom of new BBC News and BBC News Persian article pages, however it has no markup requiring this to be its only application. It can be used anywhere on any page.

Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.

版本与发布记录

@bbc/psammead-sitewide-links 共发布 105 个版本,首次发布于 2018/12/11;过去 12 个月发布了 0 个版本。

版本发布日期距今
6.0.18latest2021/03/185 年前
6.0.172021/03/165 年前
6.0.162021/03/105 年前
6.0.152021/03/025 年前
6.0.142021/02/225 年前
6.0.132021/02/045 年前

其他发布通道:alpha → 5.0.0-alpha.0。

关于 @bbc/psammead-sitewide-links 的常见问题

@bbc/psammead-sitewide-links 是什么?

React component for a sitewide-links注意:该包已被作者标记为弃用——This package is no longer being maintained

如何安装 @bbc/psammead-sitewide-links?

在项目目录运行 npm install @bbc/psammead-sitewide-links,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16.9.0)、prop-types(^15.6.2)、@emotion/styled(^11.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bbc/psammead-sitewide-links 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bbc__psammead-sitewide-links 是否存在。

@bbc/psammead-sitewide-links 支持 ESM 还是 CommonJS?

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

@bbc/psammead-sitewide-links 可以商用吗?

@bbc/psammead-sitewide-links 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bbc/psammead-sitewide-links 的下载量有多少?

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

@bbc/psammead-sitewide-links 还在维护吗?

最新版本 6.0.18 发布于 2021/03/18(5 年前);至今共发布 105 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/12/11。作者已将其标记为弃用,新项目建议寻找替代方案。