Coder Social home page Coder Social logo

Comments (6)

stevetweeddale avatar stevetweeddale commented on August 24, 2024 1

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.

Behinder avatar Behinder commented on August 24, 2024 1

from gatsby-source-git.

stevetweeddale avatar stevetweeddale commented on August 24, 2024 1

I've updated the readme to hopefully reduce the likelihood of the same confusion going forwards. Thanks everyone!

from gatsby-source-git.

CanRau avatar CanRau commented on August 24, 2024

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.

Behinder avatar Behinder commented on August 24, 2024

from gatsby-source-git.

CanRau avatar CanRau commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.