@apostrophecms/scheduled-publishing

中文文档
1.0.6发布于 2026/10/01MITCommonJS零依赖近 30 天下载 3114

ApostropeCMS 3. 计划出版.

中文使用文档
文档目录3 节
  1. 安装
  2. 使用量
  3. 使用命令行任务
ApostropheCMS logo

预定出版

GitHub Workflow Status (branch)

本模块允许您将您作品(包括页面)的发布时间排到特定日期.

安装

要安装模块, 请使用命令行在 Aposrope 项目的根目录中运行此命令 :

npm install @apostrophecms/scheduled-publishing

使用量

配置 app.js 文件 :

require('apostrophe')({
  shortName: 'my-project',
  modules: {
    '@apostrophecms/scheduled-publishing': {}
  }
});

编辑者现在可以安排文件的出版时间和不出版时间. 请注意,未印发文件意味着,除草稿外,不再提供。 由于主页必须始终可用,所以主页无法安排不出版.

要实际发布和不发布,需要定期执行相应的命令行任务,如下所述.

使用命令行任务

要在预定时间实际发布或卸载文档, 您必须执行相应的命令行任务 :

node app @apostrophecms/scheduled-publishing:update

通常情况下,您会想用一个标准的 Linux 调度工具来定期运行此程序 cron。例如,这里有一个crontab 条目,用于执行每小时一次的任务:

# At the top of every hour
0 * * * * (cd /path/to/your/apostrophe/project && node app @apostrophecms/scheduled-publishing:update)

如果您计划安排在半小时内出版时间,您可以安排更频繁的运行任务. 注意,任务可以安全地按你所希望的频率运行,因为如果不安排任何文件的发布,它不会做任何事情.

更多信息见 如何在 Linux 上使用克龙。 。 。 .

如果你在利用我们 stagecoach 用于部署,不要忘记 /current 在路径的末尾.

版本与发布记录

@apostrophecms/scheduled-publishing 共发布 6 个版本,首次发布于 2022/05/30;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.0.6latest2026/10/011 个月前
1.0.52024/09/062 年前
1.0.42024/03/212 年前
1.0.32022/09/154 年前
1.0.22022/05/304 年前
1.0.12022/05/304 年前

关于 @apostrophecms/scheduled-publishing 的常见问题

@apostrophecms/scheduled-publishing 是什么?

ApostropeCMS 3. 计划出版.

如何安装 @apostrophecms/scheduled-publishing?

在项目目录运行 npm install @apostrophecms/scheduled-publishing,或使用 pnpm add / yarn add / bun add。

@apostrophecms/scheduled-publishing 支持 TypeScript 吗?

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

@apostrophecms/scheduled-publishing 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@apostrophecms/scheduled-publishing 可以商用吗?

@apostrophecms/scheduled-publishing 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@apostrophecms/scheduled-publishing 的下载量有多少?

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

@apostrophecms/scheduled-publishing 还在维护吗?

最新版本 1.0.6 发布于 2026/10/01(1 个月前);至今共发布 6 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/05/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。