New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-feed

Package Overview
Dependencies
Maintainers
1
Versions
520
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-feed - npm Package Compare versions

Comparing version 1.0.0-alpha.22 to 1.0.0-alpha.23

.npmignore

2

package.json
{
"name": "gatsby-plugin-feed",
"version": "1.0.0-alpha.22",
"version": "1.0.0-alpha.23",
"description": "Creates an RSS feed for your Gatsby site.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,18 +0,18 @@

import path from 'path'
import { defaultOptions, runQuery, writeFile } from './internals'
import path from "path"
import RSS from "RSS"
import { defaultOptions, runQuery, writeFile } from "./internals"
const publicPath = './public'
const publicPath = `./public`
// A default function to transform query data into feed entries.
const serialize = ({ site, allMarkdownRemark }) => (
allMarkdownRemark.edges.map(edge => ({
...edge.node.frontmatter,
description: edge.node.excerpt,
url: site.siteMetadata.site_url + edge.node.fields.slug,
guid: site.siteMetadata.site_url + edge.node.fields.slug,
custom_elements: [
{ 'content:encoded': edge.node.html }
]
}))
)
const serialize = ({ site, allMarkdownRemark }) =>
allMarkdownRemark.edges.map(edge => {
return {
...edge.node.frontmatter,
description: edge.node.excerpt,
url: site.siteMetadata.site_url + edge.node.fields.slug,
guid: site.siteMetadata.site_url + edge.node.fields.slug,
custom_elements: [{ "content:encoded": edge.node.html }],
}
})

@@ -41,3 +41,3 @@ exports.onPostBuild = async ({ graphql }, pluginOptions) => {

const ctx = { ...globals, ...locals }
const feed = setup({ ...rest, ...ctx })
const feed = new RSS(setup({ ...rest, ...ctx }))
const items = f.serialize ? f.serialize(ctx) : serialize(ctx)

@@ -44,0 +44,0 @@

@@ -1,3 +0,3 @@

import React from 'react'
import { defaultOptions } from './internals'
import React from "react"
import { defaultOptions } from "./internals"

@@ -11,13 +11,7 @@ exports.onRenderBody = ({ setHeadComponents }, pluginOptions) => {

const links = feeds.map(({ output }) => {
if (output.charAt(0) !== '/') {
output = '/' + output
if (output.charAt(0) !== `/`) {
output = `/` + output
}
return (
<link
rel="alternate"
type="application/rss+xml"
href={output}
/>
)
return <link rel="alternate" type="application/rss+xml" href={output} />
})

@@ -27,2 +21,1 @@

}

@@ -1,11 +0,10 @@

import fs from 'fs'
import RSS from 'rss'
import pify from 'pify'
import fs from "fs"
import pify from "pify"
export const writeFile = pify(fs.writeFile)
export const runQuery = (handler, query) => handler(query)
.then(r => {
export const runQuery = (handler, query) =>
handler(query).then(r => {
if (r.errors) {
throw new Error(r.errors.join(', '))
throw new Error(r.errors.join(`, `))
}

@@ -34,7 +33,11 @@

// Setup a few RSS object, merging on various feed-speciupfic options.
setup: ({ site: { siteMetadata }, ...rest }) => new RSS({ ...siteMetadata, ...rest }),
setup: ({ site: { siteMetadata }, ...rest }) => {return ({
...siteMetadata,
...rest,
})},
// Create a default RSS feed. Others may be added by using the format below.
feeds: [{
query: `
feeds: [
{
query: `
{

@@ -68,5 +71,6 @@ allMarkdownRemark(

// Where we will save the feed generated by this query.
output: `rss.xml`,
}]
// Where we will save the feed generated by this query.
output: `rss.xml`,
},
],
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc