Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Feature/23 add rss #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 60 additions & 4 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
siteMetadata: {
siteUrl: "https://gatsby.wdslab.com",
siteUrl: "https://gatsby-starter-wordpress-graphql.netlify.com/",
organization: {
name: "WebDevStudios",
url: "https://gatsby.wdslab.com",
url: "https://webdevstudios.com",
logo:
"http://gatsby.wdslab.com/wp-content/uploads/2019/08/wds-logo-small.png"
},
Expand Down Expand Up @@ -38,8 +38,64 @@ module.exports = {
// Puts tracking script in the head instead of the body
head: false,
// enable ip anonymization
anonymize: true,
},
anonymize: true
}
},
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
site_url: siteUrl
}
}
wordpress {
allSettings {
title: generalSettingsTitle
description: generalSettingsDescription
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, wordpress } }) => {
wordpress.posts.edges.forEach(edge => {
return {
title: edge.node.title,
description: edge.node.excerpt,
url: site.siteMetadata.site_url + edge.node.slug,
guid: site.siteMetadata.site_url + edge.node.slug
};
});
},
query: `
{
wordpress {
posts {
edges {
node {
title
excerpt
slug
date
author {
name
}
}
}
}
}
}
`,
output: "/rss.xml",
title: "WebDevStudios RSS",
match: "^/category/blog/"
}
]
}
},
"gatsby-transformer-sharp",
"gatsby-plugin-sharp",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"gatsby": "^2.15.29",
"gatsby-image": "^2.2.24",
"gatsby-plugin-emotion": "^4.1.9",
"gatsby-plugin-feed": "^2.3.15",
"gatsby-plugin-gtag": "^1.0.11",
"gatsby-plugin-react-helmet": "^3.1.10",
"gatsby-plugin-sharp": "^2.2.28",
Expand Down
41 changes: 41 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5565,6 +5565,17 @@ gatsby-plugin-emotion@^4.1.9:
"@babel/runtime" "^7.6.2"
"@emotion/babel-preset-css-prop" "^10.0.17"

gatsby-plugin-feed@^2.3.15:
version "2.3.15"
resolved "https://registry.yarnpkg.com/gatsby-plugin-feed/-/gatsby-plugin-feed-2.3.15.tgz#06c6b0e96176485551ff83abb890184434009c18"
integrity sha512-oe2EFpmHsBTCF2q4nVELnJOjkKCFwakckLdEmSuZaLD5KTuBi19tqysDc3cZgWcFVsrDl78HYkXqelsgYg9YJg==
dependencies:
"@babel/runtime" "^7.6.2"
"@hapi/joi" "^15.1.1"
fs-extra "^8.1.0"
lodash.merge "^4.6.2"
rss "^1.2.2"

gatsby-plugin-gtag@^1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/gatsby-plugin-gtag/-/gatsby-plugin-gtag-1.0.11.tgz#1eb9487ce733c4f909703323c1ab7356228c391f"
Expand Down Expand Up @@ -7748,6 +7759,11 @@ lodash.memoize@^4.1.2:
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=

lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

lodash.throttle@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
Expand Down Expand Up @@ -8080,6 +8096,18 @@ [email protected], "mime-db@>= 1.40.0 < 2", mime-db@^1.28.0:
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32"
integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==

mime-db@~1.25.0:
version "1.25.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392"
integrity sha1-wY29fHOl2/b0SgJNwNFloeexw5I=

[email protected]:
version "2.1.13"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88"
integrity sha1-4HqqnGxrmnyjASxpADrSWjnpKog=
dependencies:
mime-db "~1.25.0"

mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24:
version "2.1.24"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81"
Expand Down Expand Up @@ -10597,6 +10625,14 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0"
inherits "^2.0.1"

rss@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/rss/-/rss-1.2.2.tgz#50a1698876138133a74f9a05d2bdc8db8d27a921"
integrity sha1-UKFpiHYTgTOnT5oF0r3I240nqSE=
dependencies:
mime-types "2.1.13"
xml "1.0.1"

run-async@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
Expand Down Expand Up @@ -12573,6 +12609,11 @@ xml2js@^0.4.5:
sax ">=0.6.0"
xmlbuilder "~9.0.1"

[email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

xmlbuilder@~9.0.1:
version "9.0.7"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
Expand Down