generateFeedTask

Summary

Generates RSS, Atom, and JSON feeds from your site's content (typically blog posts or articles). Use this to provide feed subscriptions for readers and syndication services.

Default Behavior

With minimal config, collects all items (e.g., posts) from the specified input, uses site metadata to populate feed details, and writes feed.xml (RSS), atom.xml (Atom), and feed.json (JSON Feed) to your output directory.

Configuration Options

Site metadata fields:

Example config:

generateFeedTask({
  articles: posts, // Array of article objects
  outDir: 'public',
  site: {
    title: 'My Blog',
    description: 'Latest updates and stories',
    id: 'https://example.com/',
    link: 'https://example.com/',
    language: 'en',
    favicon: 'https://example.com/favicon.ico',
    copyright: 'Copyright 2025 Jane Doe',
    feedLinks: {
      json: 'https://example.com/feed.json',
      atom: 'https://example.com/atom.xml',
    },
    author: {
      name: 'Jane Doe',
      email: 'jane@example.com',
      link: 'https://example.com/about',
    },
  },
})

Input Expectations

Output

Example:

public/
  feed.xml
  atom.xml
  feed.json

Practical Example

const { generateFeedTask } = require('skier/builtins');

module.exports = [
  // ...other tasks
  generateFeedTask({
    articles: posts, // posts array from generateItemsTask or similar
    outDir: 'public',
    site: {
      title: 'My Blog',
      description: 'Latest updates and stories',
      link: 'https://example.com',
      author: { name: 'Jane Doe' },
    },
  }),
];

Common Pitfalls & Tips

Related Tasks/Docs