Skip to content

Commit 35eae24

Browse files
authored
docs: describe purpose of fork and behavior
1 parent 03294b2 commit 35eae24

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

README.md

+17-19
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
Add some git information on `File` fields from latest commit: date, author, and email.
44

5+
This fork was created to add information for files that are added via symlink,
6+
such as to combine files from other git repositories.
7+
The plugin will resolve the symlink to the original file
8+
and base the information on the git repository at the original location.
9+
510
## Install
611

712
`yarn add @colliercz/gatsby-transformer-gitinfo`
813

9-
**Note:** You also need to have `gatsby-source-filesystem` installed and configured so it
10-
points to your files.
14+
**Note:** You also need to have `gatsby-source-filesystem` installed
15+
and configured so it points to your files.
1116

1217
## How to use
1318

14-
In your `gatsby-config.js`
19+
In your `gatsby-config.js`, add:
1520

1621
```javascript
1722
module.exports = {
@@ -29,7 +34,9 @@ module.exports = {
2934

3035
Where the _source folder_ `./src/data/` is a git versionned directory.
3136

32-
The plugin will add several fields to `File` nodes: `gitLogLatestAuthorName`, `gitLogLatestAuthorEmail`, and `gitLogLatestDate`. These fields are related to the latest commit touching that file.
37+
The plugin will add several fields to `File` nodes:
38+
`gitLogLatestAuthorName`, `gitLogLatestAuthorEmail`, and `gitLogLatestDate`.
39+
These fields are related to the latest commit touching that file.
3340

3441
If the file is not versionned, these fields will be `null`.
3542

@@ -45,12 +52,6 @@ query {
4552
gitLogLatestAuthorEmail
4653
gitLogLatestDate
4754
}
48-
internal {
49-
type
50-
mediaType
51-
description
52-
owner
53-
}
5455
}
5556
}
5657
}
@@ -69,14 +70,7 @@ Now you have a `File` node to work with:
6970
"fields": {
7071
"gitLogLatestAuthorName":"John Doe",
7172
"gitLogLatestAuthorEmail": "[email protected]",
72-
"gitLogLatestDate": "2019-10-14T12:58:39.000Z"
73-
},
74-
"internal": {
75-
"contentDigest": "c1644b03f380bc5508456ce91faf0c08",
76-
"type": "File",
77-
"mediaType": "text/yaml",
78-
"description": "File \"src/data/example.yml\"",
79-
"owner": "gatsby-source-filesystem"
73+
"gitLogLatestDate": "2020-10-14T12:58:39.000Z"
8074
}
8175
}
8276
}
@@ -127,7 +121,11 @@ module.exports = {
127121

128122
**`dir`** [string][optional]
129123

130-
The root of the git repository. Will use the current directory if not provided.
124+
The root of the git repository.
125+
Will use the current directory if not provided.
126+
127+
Note that including this option will override resolution of symlinks.
128+
All files will be checked against the given git repository.
131129

132130
## Example
133131

0 commit comments

Comments
 (0)