All Projects → webmasterish → vuepress-plugin-feed

webmasterish / vuepress-plugin-feed

Licence: MIT license
RSS, Atom, and JSON feeds generator plugin for VuePress 1.x

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vuepress-plugin-feed

feed2email
RSS/Atom feed updates in your email
Stars: ✭ 37 (-19.57%)
Mutual labels:  atom, rss, feed
Pushl
Push notification adapter for feeds
Stars: ✭ 25 (-45.65%)
Mutual labels:  atom, rss, syndication
Rss Atom Bundle
RSS and Atom Bundle for Symfony
Stars: ✭ 123 (+167.39%)
Mutual labels:  atom, rss, feed
Atoma
Atom, RSS and JSON feed parser for Python 3
Stars: ✭ 67 (+45.65%)
Mutual labels:  atom, rss, feed
Feed Module
Everyone deserves RSS, ATOM and JSON feeds!
Stars: ✭ 182 (+295.65%)
Mutual labels:  atom, rss, feed
Discord feedbot
Moved to https://gitlab.com/ffreiheit/discord_feedbot
Stars: ✭ 67 (+45.65%)
Mutual labels:  atom, rss, feed
reader
A Python feed reader library.
Stars: ✭ 290 (+530.43%)
Mutual labels:  rss, feed, json-feed
Python Feedgen
Python module to generate ATOM feeds, RSS feeds and Podcasts.
Stars: ✭ 501 (+989.13%)
Mutual labels:  atom, rss, feed
Pluto
pluto gems - planet feed reader and (static) website generator - auto-build web pages from published web feeds
Stars: ✭ 174 (+278.26%)
Mutual labels:  atom, rss, feed
Posidonlauncher
a one-page homescreen with a news feed
Stars: ✭ 163 (+254.35%)
Mutual labels:  atom, rss, feed
Miniflux Legacy
Minimalist RSS reader (version 1.x)
Stars: ✭ 897 (+1850%)
Mutual labels:  atom, rss, feed
V2
Minimalist and opinionated feed reader
Stars: ✭ 3,239 (+6941.3%)
Mutual labels:  atom, rss, feed
Liferea
Liferea (Linux Feed Reader), a news reader for GTK/GNOME
Stars: ✭ 612 (+1230.43%)
Mutual labels:  atom, rss, feed
Feedbag
Ruby's favorite feed auto-discovery library/tool
Stars: ✭ 115 (+150%)
Mutual labels:  atom, rss, feed
Feed
A RSS, Atom and JSON Feed generator for Node.js, making content syndication simple and intuitive! 🚀
Stars: ✭ 523 (+1036.96%)
Mutual labels:  atom, rss, feed
Gofeed
Parse RSS, Atom and JSON feeds in Go
Stars: ✭ 1,762 (+3730.43%)
Mutual labels:  atom, rss, feed
Picofeed
PHP library to parse and write RSS/Atom feeds
Stars: ✭ 439 (+854.35%)
Mutual labels:  atom, rss, feed
Jquery Rss
An easy-to-use rss plugin for jquery with templating.
Stars: ✭ 443 (+863.04%)
Mutual labels:  atom, rss, feed
Feedparser
feedparser gem - (universal) web feed parser and normalizer (XML w/ Atom or RSS, JSON Feed, HTML w/ Microformats e.g. h-entry/h-feed or Feed.HTML, Feed.TXT w/ YAML, JSON or INI & Markdown, etc.)
Stars: ✭ 156 (+239.13%)
Mutual labels:  atom, rss, feed
Feed Io
A PHP library to read and write feeds in JSONFeed, RSS or Atom format
Stars: ✭ 200 (+334.78%)
Mutual labels:  atom, rss, feed

VuePress Plugin Feed

RSS, Atom, and JSON feeds generator plugin for VuePress 1.x

Build Status npm version Greenkeeper badge MIT License

Install

$ npm install -D vuepress-plugin-feed

# or

$ yarn add -D vuepress-plugin-feed

Usage

Add vuepress-plugin-feed in your site or theme config file.

See official docs on using a plugin

// .vuepress/config.js
// or
// .vuepress/theme/index.js

// set your global feed options - override in page frontmatter `feed`
const feed_options = {
  canonical_base: 'https://webmasterish.com',
};

module.exports = {
  plugins: [
    [ 'feed', feed_options ]
  ]
}

Page frontmatter

Page frontmatter.feed is optional. It can be used to override the defaults.

Check the Page class for more details.

---

title: Page Title

feed:
  enable: true
  title: Title used in feed
  description: Description used in feed
  image: /public/image.png
  author:
    -
      name: Author
      email: [email protected]
      link: http://doamin.tld
  contributor:
    -
      name: Contributor
      email: [email protected]
      link: http://doamin.tld

---

How pages are added as feed items

A page is auto added as a feed item if one the following conditions is met:

  • frontmatter.feed.enable === true
  • frontmatter.type === 'post'
  • it resides in whatever the posts_directories are set to (the defaults are blog and _posts)

if you need to exclude a particular page that meets one of the conditions above, you can use frontmatter.feed.enable === false.

Details on how pages are filtered can be found in PLUGIN.is_feed_page().

The PLUGIN.is_feed_page() function is the default way of filtering the pages, you can override it using is_feed_page option (see Options section below).

Options

See Plugin Option API official docs

Default options

You can override default options in 2 ways:

  1. Global plugin options set in .vuepress/config.js or .vuepress/theme/index.js as described in Usage
  2. Individual page/post frontmatter as shown in Page frontmatter
const {
  title,
  description
} = context.getSiteData ? context.getSiteData() : context;

// -----------------------------------------------------------------------------

// Feed class options
// @see: https://github.com/jpmonette/feed#example

const feed_options = {

  title,
  description,
  generator: PLUGIN.homepage,

  // ---------------------------------------------------------------------------

  // the following are auto populated in PLUGIN.get_options()
  // if they are not set as options
  /*
  id,
  link,
  feedLinks,
  */

  // ---------------------------------------------------------------------------

  // ref:
  /*
  title: "Feed Title",
  description: "This is my personal feed!",
  id: "http://example.com/",
  link: "http://example.com/",
  image: "http://example.com/image.png",
  favicon: "http://example.com/favicon.ico",
  copyright: "All rights reserved 2013, John Doe",
  updated: new Date(2013, 6, 14), // optional, default = today
  generator: "awesome", // optional, default = 'Feed for Node.js'
  feedLinks: {
    json: "https://example.com/json",
    atom: "https://example.com/atom"
  },
  author: {
    name: "John Doe",
    email: "[email protected]",
    link: "https://example.com/johndoe"
  }
  */

};

// -----------------------------------------------------------------------------

const default_options = {

  // required; it can also be used as enable/disable

  canonical_base: '',

  // ---------------------------------------------------------------------------

  // Feed class options - @see: https://github.com/jpmonette/feed#example
  // optional - auto-populated based on context.getSiteData()

  feed_options,

  // ---------------------------------------------------------------------------

  // @notes:
  // property name is also the name of the jpmonette/feed package function

  feeds: {

    rss2: {
      enable    : true,
      file_name : 'rss.xml',
      head_link : {
        enable: true,
        type  : 'application/rss+xml',
        title : '%%site_title%% RSS Feed',
      }
    },

    // -------------------------------------------------------------------------

    atom1: {
      enable    : true,
      file_name : 'feed.atom',
      head_link : {
        enable: true,
        type  : 'application/atom+xml',
        title : '%%site_title%% Atom Feed',
      }
    },

    // -------------------------------------------------------------------------

    json1: {
      enable    : true,
      file_name : 'feed.json',
      head_link : {
        enable: true,
        type  : 'application/json',
        title : '%%site_title%% JSON Feed',
      }
    },

  },

  // ---------------------------------------------------------------------------

  // page/post description sources

  // order of what gets the highest priority:
  //
  // 1. frontmatter
  // 2. page excerpt
  // 3. content markdown paragraph
  // 4. content regular html <p>

  description_sources: [

    'frontmatter',
    'excerpt',

    // markdown paragraph regex
    // @todo: needs work
    //
    /^((?:(?!^#)(?!^\-|\+)(?!^[0-9]+\.)(?!^!\[.*?\]\((.*?)\))(?!^\[\[.*?\]\])(?!^\{\{.*?\}\})[^\n]|\n(?! *\n))+)(?:\n *)+\n/gim,
    //
    // this excludes blockquotes using `(?!^>)`
    ///^((?:(?!^#)(?!^\-|\+)(?!^[0-9]+\.)(?!^!\[.*?\]\((.*?)\))(?!^>)(?!^\[\[.*?\]\])(?!^\{\{.*?\}\})[^\n]|\n(?! *\n))+)(?:\n *)+\n/gim,

    // html paragraph regex
    /<p(?:.*?)>(.*?)<\/p>/i,

  ],

  // ---------------------------------------------------------------------------

  // page/post image sources

  // order of what gets the highest priority:
  //
  // 1. frontmatter
  // 2. content markdown image such as `![alt text](http://url)`
  // 3. content regular html img

  image_sources: [

    'frontmatter',

    /!\[.*?\]\((.*?)\)/i,         // markdown image regex
    /<img.*?src=['"](.*?)['"]/i,  // html image regex

  ],

  // ---------------------------------------------------------------------------

  // pages in current directories will be auto added as feed
  // unless they are disabled using their frontmatter
  // this option is used by the default is_feed_page function

  posts_directories: ['/blog/', '/_posts/'],

  // ---------------------------------------------------------------------------

  // function to check if the page is to be used in a feed item

  is_feed_page: PLUGIN.is_feed_page, // function

  // ---------------------------------------------------------------------------

  count: 20,

  // optional sorting function for the entries. 
  // Gets the array entries as the input, expects the sorted array
  // as its output.
  // e.g.:   sort:  entries => _.reverse( _.sortBy( entries, 'date' ) ),
  // Don't forget to do a `const _ = require('lodash');` to be able to use `_`!

  sort: entries => entries,

  // ---------------------------------------------------------------------------

  // supported - use in config as needed

  // category
  // contributor

};

Reference

Related Plugins

License

MIT © webmasterish

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].