Skip to content

Commit

Permalink
fix(gatsby-node): fix broken config
Browse files Browse the repository at this point in the history
  • Loading branch information
Darth-Knoppix committed Jun 22, 2020
1 parent 9a4630c commit dfeaf85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/default-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const defaultOptions = {
updated: new Date(), // optional, default = today
generator: "Feed for Node.js", // optional, default = 'Feed for Node.js'
feedLinks: {
json: "https://example.com/feed.json",
atom: "https://example.com/atom.xml",
rss: "https://example.com/rss.xml",
json: "/feed.json",
atom: "/atom.xml",
rss: "/rss.xml",
},
author: {
name: "John Doe",
Expand Down
3 changes: 1 addition & 2 deletions src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ exports.onPostBuild = async ({ graphql }, pluginOptions) => {
await Promise.all(
formats.map(async (format) => {
const formatFn = formatFeedMap[format];
const fileName = new URL(options.feedLinks[format]).pathname;

const outputPath = path.join(publicPath, fileName);
const outputPath = path.join(publicPath, options.feedLinks[format]);

return new Promise((resolve, reject) => {
fs.writeFile(
Expand Down
2 changes: 1 addition & 1 deletion src/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Link({ output, title, link, type, baseUrl = "" }) {
rel="alternate"
type={type}
title={title}
href={`${baseUrl}${new URL(href).pathname}`}
href={`${baseUrl}${href}`}
/>
);
}
Expand Down

0 comments on commit dfeaf85

Please sign in to comment.