{"id":13495239,"url":"https://github.com/webmasterish/vuepress-plugin-feed","last_synced_at":"2025-07-27T02:35:58.243Z","repository":{"id":56662607,"uuid":"165918626","full_name":"webmasterish/vuepress-plugin-feed","owner":"webmasterish","description":"RSS, Atom, and JSON feeds generator plugin for VuePress 1.x","archived":false,"fork":false,"pushed_at":"2020-10-27T17:22:01.000Z","size":62,"stargazers_count":50,"open_issues_count":7,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T04:41:28.242Z","etag":null,"topics":["atom","blog","feed","json","json-feed","plugin","rss","syndication","vue","vuepress","vuepress-plugin","xml"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmasterish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-15T20:27:55.000Z","updated_at":"2025-03-11T06:28:51.000Z","dependencies_parsed_at":"2022-08-15T22:50:36.227Z","dependency_job_id":null,"html_url":"https://github.com/webmasterish/vuepress-plugin-feed","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-plugin-feed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-plugin-feed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-plugin-feed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterish%2Fvuepress-plugin-feed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterish","download_url":"https://codeload.github.com/webmasterish/vuepress-plugin-feed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724080,"owners_count":21151555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","blog","feed","json","json-feed","plugin","rss","syndication","vue","vuepress","vuepress-plugin","xml"],"created_at":"2024-07-31T19:01:32.811Z","updated_at":"2025-04-13T13:40:26.413Z","avatar_url":"https://github.com/webmasterish.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","atom","Plugins"],"sub_categories":["Community"],"readme":"# VuePress Plugin Feed\n\n\u003e RSS, Atom, and JSON feeds generator plugin for VuePress 1.x\n\n[![Build Status](https://img.shields.io/travis/webmasterish/vuepress-plugin-feed/master.svg?style=flat-square)](https://travis-ci.org/webmasterish/vuepress-plugin-feed)\n[![npm version](https://img.shields.io/npm/v/vuepress-plugin-feed.svg?style=flat-square)](http://npm.im/vuepress-plugin-feed)\n[![Greenkeeper badge](https://badges.greenkeeper.io/webmasterish/vuepress-plugin-feed.svg?style=flat-square)](https://greenkeeper.io/)\n[![MIT License](https://img.shields.io/npm/l/express.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n\n## Install\n\n\n```sh\n$ npm install -D vuepress-plugin-feed\n\n# or\n\n$ yarn add -D vuepress-plugin-feed\n```\n\n\n## Usage\n\nAdd `vuepress-plugin-feed` in your site or theme config file.\n\n\u003e See [official docs on using a plugin](https://vuepress.vuejs.org/plugin/using-a-plugin.html)\n\n\n```js\n// .vuepress/config.js\n// or\n// .vuepress/theme/index.js\n\n// set your global feed options - override in page frontmatter `feed`\nconst feed_options = {\n  canonical_base: 'https://webmasterish.com',\n};\n\nmodule.exports = {\n  plugins: [\n    [ 'feed', feed_options ]\n  ]\n}\n```\n\n\n### Page `frontmatter`\n\nPage `frontmatter.feed` is optional.  It can be used to override the defaults.\n\nCheck the [`Page class`](lib/Page.js) for more details.\n\n\n```md\n---\n\ntitle: Page Title\n\nfeed:\n  enable: true\n  title: Title used in feed\n  description: Description used in feed\n  image: /public/image.png\n  author:\n    -\n      name: Author\n      email: author@doamin.tld\n      link: http://doamin.tld\n  contributor:\n    -\n      name: Contributor\n      email: contributor@doamin.tld\n      link: http://doamin.tld\n\n---\n\n```\n\n\n## How pages are added as feed items\n\nA page is auto added as a feed item if one the following conditions is met:\n\n- `frontmatter.feed.enable === true`\n- `frontmatter.type === 'post'`\n- it resides in whatever the `posts_directories` are set to (the defaults are `blog` and `_posts`)\n\nif you need to exclude a particular page that meets one of the conditions above,\nyou can use `frontmatter.feed.enable === false`.\n\nDetails on how pages are filtered can be found in [`PLUGIN.is_feed_page()`](index.js).\n\nThe `PLUGIN.is_feed_page()` function is the default way of filtering the pages,\nyou can override it using `is_feed_page` option (see [Options section](#options) below).\n\n\n## Options\n\n\u003e See Plugin Option API [official docs](https://vuepress.vuejs.org/plugin/option-api.html)\n\n\n### Default options\n\nYou can override default options in 2 ways:\n\n1. Global plugin options set in `.vuepress/config.js` or `.vuepress/theme/index.js`\n   as described in [Usage](#usage)\n2. Individual page/post `frontmatter` as shown in [Page `frontmatter`](#page-frontmatter)\n\n\n```js\nconst {\n  title,\n  description\n} = context.getSiteData ? context.getSiteData() : context;\n\n// -----------------------------------------------------------------------------\n\n// Feed class options\n// @see: https://github.com/jpmonette/feed#example\n\nconst feed_options = {\n\n  title,\n  description,\n  generator: PLUGIN.homepage,\n\n  // ---------------------------------------------------------------------------\n\n  // the following are auto populated in PLUGIN.get_options()\n  // if they are not set as options\n  /*\n  id,\n  link,\n  feedLinks,\n  */\n\n  // ---------------------------------------------------------------------------\n\n  // ref:\n  /*\n  title: \"Feed Title\",\n  description: \"This is my personal feed!\",\n  id: \"http://example.com/\",\n  link: \"http://example.com/\",\n  image: \"http://example.com/image.png\",\n  favicon: \"http://example.com/favicon.ico\",\n  copyright: \"All rights reserved 2013, John Doe\",\n  updated: new Date(2013, 6, 14), // optional, default = today\n  generator: \"awesome\", // optional, default = 'Feed for Node.js'\n  feedLinks: {\n    json: \"https://example.com/json\",\n    atom: \"https://example.com/atom\"\n  },\n  author: {\n    name: \"John Doe\",\n    email: \"johndoe@example.com\",\n    link: \"https://example.com/johndoe\"\n  }\n  */\n\n};\n\n// -----------------------------------------------------------------------------\n\nconst default_options = {\n\n  // required; it can also be used as enable/disable\n\n  canonical_base: '',\n\n  // ---------------------------------------------------------------------------\n\n  // Feed class options - @see: https://github.com/jpmonette/feed#example\n  // optional - auto-populated based on context.getSiteData()\n\n  feed_options,\n\n  // ---------------------------------------------------------------------------\n\n  // @notes:\n  // property name is also the name of the jpmonette/feed package function\n\n  feeds: {\n\n    rss2: {\n      enable    : true,\n      file_name : 'rss.xml',\n      head_link : {\n        enable: true,\n        type  : 'application/rss+xml',\n        title : '%%site_title%% RSS Feed',\n      }\n    },\n\n    // -------------------------------------------------------------------------\n\n    atom1: {\n      enable    : true,\n      file_name : 'feed.atom',\n      head_link : {\n        enable: true,\n        type  : 'application/atom+xml',\n        title : '%%site_title%% Atom Feed',\n      }\n    },\n\n    // -------------------------------------------------------------------------\n\n    json1: {\n      enable    : true,\n      file_name : 'feed.json',\n      head_link : {\n        enable: true,\n        type  : 'application/json',\n        title : '%%site_title%% JSON Feed',\n      }\n    },\n\n  },\n\n  // ---------------------------------------------------------------------------\n\n  // page/post description sources\n\n  // order of what gets the highest priority:\n  //\n  // 1. frontmatter\n  // 2. page excerpt\n  // 3. content markdown paragraph\n  // 4. content regular html \u003cp\u003e\n\n  description_sources: [\n\n    'frontmatter',\n    'excerpt',\n\n    // markdown paragraph regex\n    // @todo: needs work\n    //\n    /^((?:(?!^#)(?!^\\-|\\+)(?!^[0-9]+\\.)(?!^!\\[.*?\\]\\((.*?)\\))(?!^\\[\\[.*?\\]\\])(?!^\\{\\{.*?\\}\\})[^\\n]|\\n(?! *\\n))+)(?:\\n *)+\\n/gim,\n    //\n    // this excludes blockquotes using `(?!^\u003e)`\n    ///^((?:(?!^#)(?!^\\-|\\+)(?!^[0-9]+\\.)(?!^!\\[.*?\\]\\((.*?)\\))(?!^\u003e)(?!^\\[\\[.*?\\]\\])(?!^\\{\\{.*?\\}\\})[^\\n]|\\n(?! *\\n))+)(?:\\n *)+\\n/gim,\n\n    // html paragraph regex\n    /\u003cp(?:.*?)\u003e(.*?)\u003c\\/p\u003e/i,\n\n  ],\n\n  // ---------------------------------------------------------------------------\n\n  // page/post image sources\n\n  // order of what gets the highest priority:\n  //\n  // 1. frontmatter\n  // 2. content markdown image such as `![alt text](http://url)`\n  // 3. content regular html img\n\n  image_sources: [\n\n    'frontmatter',\n\n    /!\\[.*?\\]\\((.*?)\\)/i,         // markdown image regex\n    /\u003cimg.*?src=['\"](.*?)['\"]/i,  // html image regex\n\n  ],\n\n  // ---------------------------------------------------------------------------\n\n  // pages in current directories will be auto added as feed\n  // unless they are disabled using their frontmatter\n  // this option is used by the default is_feed_page function\n\n  posts_directories: ['/blog/', '/_posts/'],\n\n  // ---------------------------------------------------------------------------\n\n  // function to check if the page is to be used in a feed item\n\n  is_feed_page: PLUGIN.is_feed_page, // function\n\n  // ---------------------------------------------------------------------------\n\n  count: 20,\n\n  // optional sorting function for the entries. \n  // Gets the array entries as the input, expects the sorted array\n  // as its output.\n  // e.g.:   sort:  entries =\u003e _.reverse( _.sortBy( entries, 'date' ) ),\n  // Don't forget to do a `const _ = require('lodash');` to be able to use `_`!\n\n  sort: entries =\u003e entries,\n\n  // ---------------------------------------------------------------------------\n\n  // supported - use in config as needed\n\n  // category\n  // contributor\n\n};\n```\n\n\n## Reference\n\n- VuePress official [plugin docs](https://vuepress.vuejs.org/plugin/)\n- VuePress official [Front Matter](https://vuepress.vuejs.org/guide/frontmatter.html)\n- [jpmonette/feed](https://github.com/jpmonette/feed)\n- [RSS 2.0 specificatiion](https://validator.w3.org/feed/docs/rss2.html)\n- [Atom feed](https://validator.w3.org/feed/docs/atom.html)\n- [JSON feed](https://jsonfeed.org/)\n\n\n## Related Plugins\n\n- [VuePress Plugin Auto Meta](https://github.com/webmasterish/vuepress-plugin-autometa)\n- [VuePress Plugin Auto Nav](https://github.com/webmasterish/vuepress-plugin-autonav)\n- [VuePress Plugin Minimal Google Analytics](https://github.com/webmasterish/vuepress-plugin-minimal-analytics)\n\n## License\n\nMIT © [webmasterish](https://webmasterish.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterish%2Fvuepress-plugin-feed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmasterish%2Fvuepress-plugin-feed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterish%2Fvuepress-plugin-feed/lists"}