Comments (6)
Hi @Behinder! When writing support requests to strangers, please try to sound friendly
Here's what the readme actually says:
[gatsby-source-git] sucks the files into the graph as
File
nodes, as if you'd configured gatsby-source-filesystem on that directory. As such, all the transformer plugins that operate on files should work exactly as they do with gatsby-source-filesystem
Which isn't the same thing as saying "this plugin is a drop-in replacement for gatsby-source-filesystem
and shares every aspect of its API" (which would indeed be an overstatement). As @CanRau mentioned, this is a source plugin, so its job is to get nodes into the graph. Specifically, it puts nodes that look just like the ones created by gatsby-source-filesystem
.
Now gatsby-source-filesystem
then also includes the createFilePath
helper as a convenience for later on in the process, as often people want to create a pretty URL from a filesystem path when programmatically creating pages from graph nodes. I didn't bundle a copy of that function in this plugin because it's nothing to do with sourcing, and I don't want to maintain a fork of something that's already in the main gatsby repo. If you need that helper, then include it like so:
const { createFilePath } = require(`gatsby-source-filesystem`)
Hope that clears things up for you!
from gatsby-source-git.
from gatsby-source-git.
I've updated the readme to hopefully reduce the likelihood of the same confusion going forwards. Thanks everyone!
from gatsby-source-git.
I guess it's same in sourcing, not necessarily in creating as it's a source plugin. The filesystem one provides this helper for convenience.
Not everyone is using createFilePath
at least I'm not and if I needed it I can get it from gatsby-source-filesystem
.
from gatsby-source-git.
from gatsby-source-git.
You create the pages like with most other source plugins, following the example in https://www.gatsbyjs.org/tutorial/part-seven/ and https://www.gatsbyjs.org/docs/creating-and-modifying-pages/#creating-pages-in-gatsby-nodejs
You change the query from MarkdownRemark to that of the source plugin.
from gatsby-source-git.
Related Issues (20)
- can you provide a sample site? HOT 3
- Feature request : Fetching data from private repository HOT 4
- npm bump please HOT 2
- Gatsby always fetch cached data HOT 4
- Unsure about the local flag HOT 3
- Consider exposing created/edited timestamps from git HOT 7
- Requires gatsby-source-filesystem in gatsby-config.js
- any advice on auto pull from repository? HOT 4
- Git clone fails when building from Gatsby cache HOT 5
- gitlab clone HOT 2
- Looks valuable beyond gatsby HOT 2
- Read files and folders that start with a dot HOT 1
- Clone fails when the remote is ssh and option is specified in https
- Install fails with [email protected] HOT 6
- Enable cloning a repo from a specific commit SHA
- Is the project active maintained? HOT 16
- shallow HOT 2
- Unable to use gatsby environment variable with gataby-source-git patterns HOT 9
- Cloning part of the remote repo HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-git.