-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit abe0362
Showing
9 changed files
with
8,093 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/*.js | ||
!index.js | ||
node_modules/ | ||
.DS_Store | ||
gatsby-node.js | ||
internals.js | ||
!src/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules | ||
*.un~ | ||
yarn.lock | ||
src | ||
flow-typed | ||
coverage | ||
decls | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# gatsby-plugin-guru-export | ||
|
||
Create a Guru export of your Gatsby site. | ||
|
||
## Install | ||
|
||
`npm install gatsby-plugin-guru-export` | ||
|
||
## How to Use | ||
|
||
```javascript | ||
// In your gatsby-config.js | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-plugin-guru-export`, | ||
options: { | ||
query: ` | ||
{ | ||
site { | ||
siteMetadata { | ||
title | ||
description | ||
siteUrl | ||
site_url: siteUrl | ||
} | ||
} | ||
} | ||
`, | ||
feeds: [ | ||
{ | ||
serialize: ({ query: { site, allMarkdownRemark } }) => { | ||
return allMarkdownRemark.edges.map(edge => { | ||
return Object.assign({}, edge.node.frontmatter, { | ||
description: edge.node.excerpt, | ||
date: edge.node.frontmatter.date, | ||
url: site.siteMetadata.siteUrl + edge.node.fields.slug, | ||
guid: site.siteMetadata.siteUrl + edge.node.fields.slug, | ||
custom_elements: [{ "content:encoded": edge.node.html }], | ||
}) | ||
}) | ||
}, | ||
query: ` | ||
{ | ||
allMarkdownRemark( | ||
sort: { order: DESC, fields: [frontmatter___date] }, | ||
) { | ||
edges { | ||
node { | ||
excerpt | ||
html | ||
fields { slug } | ||
frontmatter { | ||
title | ||
date | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`, | ||
output: "/guru", | ||
guruFieldMapping: { | ||
Title: 'mapping', | ||
ExternalId: 'mapping2', | ||
ExternalUrl: (serializeData) => `I'm a function` | ||
} | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} | ||
``` | ||
|
||
Each feed must include `output`, `serialize`, `query`, and `guruFieldMapping`. | ||
|
||
|
||
**Inspired by gatsby-plugin-feed** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// noop |
Oops, something went wrong.