You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Navigate to a directory where there's a [`sourcebit.js` configuration file](https://github.com/stackbithq/sourcebit#manual-configuration) and run the Sourcebit binary
Copy file name to clipboardExpand all lines: README.md
+48-48Lines changed: 48 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,19 +8,19 @@
8
8
9
9
## Table of contents
10
10
11
-
-[Introduction](#introduction)
12
-
-[Getting started](#getting-started)
13
-
-[Manual installation](#manual-installation)
14
-
-[Manual configuration](#manual-configuration)
15
-
-[Usage](#usage)
16
-
-[As a CommonJS module](#as-a-commonjs-module)
17
-
-[As a command-line tool](#as-a-command-line-tool)
18
-
-[Disabling cache](#disabling-cache)
19
-
-[Plugin directory](#plugin-directory)
20
-
-[Source plugins](#source-plugins)
21
-
-[Target plugins](#target-plugins)
22
-
-[Other plugins](#other-plugins)
23
-
-[Contributing](#contributing)
11
+
-[Introduction](#introduction)
12
+
-[Getting started](#getting-started)
13
+
-[Manual installation](#manual-installation)
14
+
-[Manual configuration](#manual-configuration)
15
+
-[Usage](#usage)
16
+
-[As a CommonJS module](#as-a-commonjs-module)
17
+
-[As a command-line tool](#as-a-command-line-tool)
18
+
-[Disabling cache](#disabling-cache)
19
+
-[Plugin directory](#plugin-directory)
20
+
-[Source plugins](#source-plugins)
21
+
-[Target plugins](#target-plugins)
22
+
-[Other plugins](#other-plugins)
23
+
-[Contributing](#contributing)
24
24
25
25
## Introduction
26
26
@@ -30,8 +30,8 @@ Sourcebit connects to multiple data sources, for example data in a headless CMS
30
30
31
31
Sourcebit works through the use of two types of plugins:
32
32
33
-
-_Source plugins_ are responsible for fetching data, normalizing it to a standard format, and placing the resulting entries on sets of data called _data buckets_. Subsequently, any combination of plugins may consume, transform and persist these data buckets in any way they like.
34
-
-_Target plugins_ are tasked with writing data into a format and location that other programs – such as static site generators – expect. A target plugin is not required, however. This is useful for situations where the source will be called via code, such as in a site built with tools like Next.js.
33
+
-_Source plugins_ are responsible for fetching data, normalizing it to a standard format, and placing the resulting entries on sets of data called _data buckets_. Subsequently, any combination of plugins may consume, transform and persist these data buckets in any way they like.
34
+
-_Target plugins_ are tasked with writing data into a format and location that other programs – such as static site generators – expect. A target plugin is not required, however. This is useful for situations where the source will be called via code, such as in a site built with tools like Next.js.
35
35
36
36
Read more about the [anatomy of a plugin](https://github.com/stackbithq/sourcebit/wiki/Anatomy-of-a-plugin).
37
37
@@ -61,21 +61,21 @@ It looks something like this:
61
61
62
62
```js
63
63
module.exports= {
64
-
plugins: [
65
-
{
66
-
module:require("sourcebit-some-plugin-1"),
67
-
options: {
68
-
pluginOption1:"foo",
69
-
pluginOptino2:"bar"
70
-
}
71
-
},
72
-
{
73
-
module:require("sourcebit-some-plugin-2"),
74
-
options: {
75
-
pluginFunction1: (a, b) => a + b
76
-
}
77
-
}
78
-
]
64
+
plugins: [
65
+
{
66
+
module:require('sourcebit-some-plugin-1'),
67
+
options: {
68
+
pluginOption1:'foo',
69
+
pluginOptino2:'bar'
70
+
}
71
+
},
72
+
{
73
+
module:require('sourcebit-some-plugin-2'),
74
+
options: {
75
+
pluginFunction1: (a, b) => a + b
76
+
}
77
+
}
78
+
]
79
79
};
80
80
```
81
81
@@ -88,12 +88,12 @@ It's important to note that while every plugin block is defined with the `module
88
88
To use Sourcebit as a CommonJS module, include it in your project and call its `fetch` method.
89
89
90
90
```js
91
-
constsourcebit=require("sourcebit");
92
-
constconfig=require("./sourcebit.js");
91
+
constsourcebit=require('sourcebit');
92
+
constconfig=require('./sourcebit.js');
93
93
constoptions= {};
94
94
95
95
sourcebit.fetch(config, options).then(data=> {
96
-
console.log(data);
96
+
console.log(data);
97
97
});
98
98
```
99
99
@@ -125,32 +125,32 @@ To disable cache, add the flag `--no-cache` to the `sourcebit fetch` command if
125
125
126
126
Sourcebit is designed to be completely extensible. Documentation on how to build plugins can be found on our [wiki](https://github.com/stackbithq/sourcebit/wiki).
127
127
128
-
-[Anatomy of a plugin](https://github.com/stackbithq/sourcebit/wiki/Anatomy-of-a-plugin)
-[Writing files to disk](https://github.com/stackbithq/sourcebit/wiki/Writing-files-to-disk)
135
135
136
136
### Plugin directory
137
137
138
138
#### Source plugins
139
139
140
-
-[`sourcebit-sample-plugin`](http://npmjs.com/package/sourcebit-sample-plugin): A sample plugin with mock data, for demonstration/educational purposes.
141
-
-[`sourcebit-source-contentful`](http://npmjs.com/package/sourcebit-source-contentful): A source plugin for [Contentful](https://www.contentful.com/).
142
-
-[`sourcebit-source-sanity`](http://npmjs.com/package/sourcebit-source-sanity): A source plugin for [Sanity](https://sanity.io/).
143
-
-[`@kentico/sourcebit-source-kontent`](https://www.npmjs.com/package/@kentico/sourcebit-source-kontent): A source plugin for [Kontent](https://bit.ly/2yvEEWs).
140
+
-[`sourcebit-sample-plugin`](http://npmjs.com/package/sourcebit-sample-plugin): A sample plugin with mock data, for demonstration/educational purposes.
141
+
-[`sourcebit-source-contentful`](http://npmjs.com/package/sourcebit-source-contentful): A source plugin for [Contentful](https://www.contentful.com/).
142
+
-[`sourcebit-source-sanity`](http://npmjs.com/package/sourcebit-source-sanity): A source plugin for [Sanity](https://sanity.io/).
143
+
-[`@kentico/sourcebit-source-kontent`](https://www.npmjs.com/package/@kentico/sourcebit-source-kontent): A source plugin for [Kontent](https://bit.ly/2yvEEWs).
144
144
145
145
#### Target plugins
146
146
147
-
-[`sourcebit-target-hugo`](http://npmjs.com/package/sourcebit-target-hugo): A target plugin for the [Hugo](https://gohugo.io/) static site generator.
148
-
-[`sourcebit-target-jekyll`](http://npmjs.com/package/sourcebit-target-jekyll): A target plugin for the [Jekyll](https://www.jekyllrb.com/) static site generator.
149
-
-[`sourcebit-target-next`](https://www.npmjs.com/package/sourcebit-target-next): A target plugin for the [Next.js](https://nextjs.org/) framework.
147
+
-[`sourcebit-target-hugo`](http://npmjs.com/package/sourcebit-target-hugo): A target plugin for the [Hugo](https://gohugo.io/) static site generator.
148
+
-[`sourcebit-target-jekyll`](http://npmjs.com/package/sourcebit-target-jekyll): A target plugin for the [Jekyll](https://www.jekyllrb.com/) static site generator.
149
+
-[`sourcebit-target-next`](https://www.npmjs.com/package/sourcebit-target-next): A target plugin for the [Next.js](https://nextjs.org/) framework.
150
150
151
151
#### Other plugins
152
152
153
-
-[`sourcebit-transform-assets`](https://github.com/stackbithq/sourcebit-transform-assets): A plugin for downloading remote assets
153
+
-[`sourcebit-transform-assets`](https://github.com/stackbithq/sourcebit-transform-assets): A plugin for downloading remote assets
0 commit comments