npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fec/gatsby-plugin-advanced-feed

v3.0.1

Published

Gatsby plugin that generates RSS 2, Atom and JSON feeds for your site.

Downloads

198

Readme

@fec/gatsby-plugin-advanced-feed

Gatsby plugin that generates RSS 2, Atom and JSON feeds for your site.

Unit tests Integration tests

Made by 👨‍💻 Florian Eckerstorfer in 🎡 Vienna, Europe.

Table of Contents

  1. Features
  2. Differences to gatsby-plugin-feed
  3. Installation & Setup
  4. Configuration
  5. Code of Conduct
  6. Change log
  7. License

Features

  • Generates RSS 2.0
  • Generates Atom 1.0
  • Generates JSON Feed 1.0
  • Supports multiple feeds

Differences to gatsby-plugin-feed

  • ✅ Supports Atom 1.0 and JSON Feed 1.0 in addition to RSS 2.0
  • ✅ More options to customize feed description, copyright, author, etc
  • ❌ Does not support serialize and query options (yet)

Installation & Setup

First you need to install the plugin with NPM or Yarn:

npm install @fec/gatsby-plugin-advanced-feed --save
yarn add @fec/gatsby-plugin-advanced-feed

Versions 2.x of this plugin are tested with Gatsby v3, you might need to use @fec/gatsby-plugin-advanced-feed@1 if you are still using Gatsby v2.

Next you need add the plugin to the plugins list in gatsby-config.js:

// ./gatsby-config.js
module.exports = {
  // ...
  plugins: [
    // ...
    '@fec/gatsby-plugin-advanced-feed',
  ],
};

⚠️ Feeds are only generated on gatsby build, when running the local development server (gatsby develop) no feeds will be generated.

Configuration

You can configure @fec/gatsby-plugin-advanced-feed. The following example contains all configuration options and their default value:

// ./gatsby-config.js
module.exports = {
  // ...
  plugins: [
    // ...
    {
    resolve: '@fec/gatsby-plugin-advanced-feed',
    options: {
      feeds: [
        {
          // Configure the feed; smart defaults are choosen if not set
          author: undefined,      // default: site.siteMetadata.author
          copyright: undefined,   // default: "All rights reserved {year}, {site.siteMetadata.author}"
          description: undefined, // default: site.siteMetadata.description
          email: false,           // default: false ➞ no email in feed; undefined ➞ site.siteMetadata.email
          id: undefined,          // default: site.siteMetadata.siteUrl
          link: undefined,        // default: site.siteMetadata.siteUrl
          title: undefined,       // default: site.siteMetadata.title

          // Add <link> tags in <head> to feeds
          createLinkInHead: true, // `true` for all pages or regular expression to match pathnames

          // Number of articles to include in feed
          limit: 10,

          // Include all pages which `fileAbsolutePath` matches this regular expression
          match: '^/blog/',

          // File names of generated feeds
          output: {
            rss2: 'rss.xml',
            atom: 'atom.xml',
            json: 'feed.json',
          },
        }
      ],
    },
  ],
};

Include only in certain pages

@fec/gatsby-plugin-advanced-feed allows you to link the feeds in the <head> or your page. This can be configured on a per-feed basis. If the option createLinkInHead for a feed is true the <link> will be included on all pages. You can include the <link> only for certain pages by specifying a regular expression.

In the following example the <link> tags will only be inserted on all pages which pathname matches the regular expression /^\/blog/:

// ./gatsby-config.js
module.exports = {
  // ...
  plugins: [
    // ...
    {
      resolve: '@fec/gatsby-plugin-advanced-feed',
      options: {
        feeds: [
          createLinkInHead: /^\/blog/,
        ]
      }
    }
  ],
};

Code of Conduct

See CODE_OF_CONDUCT

Change log

See CHANGELOG

License

See LICENSE