
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@apostrophecms/blog
Advanced tools
Add blog functionality to ApostropheCMS sites with article management, date-based filtering, and multiple blog support. Provides both the blog piece type and page templates to get started quickly.
To install the module, use the command line to run this command in an Apostrophe project's root directory:
npm install @apostrophecms/blog
Configure the blog modules in your app.js file:
import apostrophe from 'apostrophe';
export default apostrophe({
root: import.meta,
shortName: 'my-project',
bundles: [ '@apostrophecms/blog' ],
modules: {
'@apostrophecms/blog': {},
'@apostrophecms/blog-page': {}
}
});
Add the blog page type to your page configuration:
// modules/@apostrophecms/page/index.js
export default {
options: {
types: [
{
name: '@apostrophecms/home-page',
label: 'Home'
},
{
name: '@apostrophecms/blog-page',
label: 'Blog'
}
]
}
};
The included templates (index.html, show.html, filters.html) are starting points that demonstrate the available data. Override them in your project to implement your own styling and layout:
modules/
├── @apostrophecms/
│ └── blog-page/
│ └── views/
│ ├── index.html # Blog listing page
│ ├── show.html # Individual blog post
│ └── filters.html # Date filtering controls
The blog includes built-in query filters for creating archive navigation and date-based URLs:
| Filter | Format | Example URL |
|---|---|---|
year | YYYY | /blog?year=2024 |
month | YYYY-MM | /blog?month=2024-03 |
day | YYYY-MM-DD | /blog?day=2024-03-15 |
Blog posts use the publishedAt field to control visibility. Only articles with publication dates in the past appear on the public site. Editors see all articles in the admin interface.
Note: This doesn't automatically publish draft changes on the publication date. For scheduled publishing of draft content, consider the @apostrophecms/scheduled-publishing module.
Sometimes a website needs multiple, distinct types of blog posts. If the blog posts types can be managed together, it might be easiest to add a new field and query builder to customize blog views. But if the blog posts types should be managed completely separately, it may be better to create separate piece types for each.
// modules/news-blog/index.js - for news articles
export default {
extend: '@apostrophecms/blog',
options: {
label: 'News Article',
pluralLabel: 'News Articles'
},
fields: {
add: {
priority: {
type: 'select',
choices: [
{ label: 'Standard', value: 'standard' },
{ label: 'Breaking', value: 'breaking' },
{ label: 'Featured', value: 'featured' }
]
},
source: {
type: 'string',
label: 'News Source',
help: 'Original source of this news item'
}
},
group: {
basics: { fields: ['priority', 'source'] }
}
}
};
Every blog piece type needs a corresponding page type that extends @apostrophecms/blog-page:
// modules/news-blog-page/index.js - page type for news articles
export default {
extend: '@apostrophecms/blog-page'
};
Each blog type can have its own templates. Create them in the corresponding page module:
modules/
├── news-blog-page/
│ └── views/
│ ├── index.html # News listing page
│ ├── show.html # Individual news article
│ └── filters.html # Custom filters for news
└── @apostrophecms/
└── blog-page/
└── views/
├── index.html # Default blog listing
└── show.html # Default blog post
This allows you to:
This approach works well when blog types have different:
/blog/, /news/, /updates/ with distinct navigationThe blog piece type includes these fields by default:
title) - Article headlineslug) - URL-friendly identifierpublishedAt) - Controls public visibilitybody) - Rich text content areametaDescription) - SEO descriptiontags) - Taxonomy for categorizationFound this useful? Give us a star on GitHub ⭐
1.0.6 (2025-09-03)
FAQs
Blog module for ApostropheCMS websites
The npm package @apostrophecms/blog receives a total of 688 weekly downloads. As such, @apostrophecms/blog popularity was classified as not popular.
We found that @apostrophecms/blog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.