Skip to content

Commit 355406f

Browse files
committed
Document this and that.
1 parent 076e4a3 commit 355406f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@
33
Content source from git repository. A way to have your writing in public and open for edition while not being distracted
44
by static site generator trivia this content is usually mixed with.
55

6+
## Usage
7+
8+
Add to `Gemfile` in your nanoc project:
9+
10+
```ruby
11+
gem "nanoc-github"
12+
```
13+
14+
Then tell nanoc to load it in `lib/default.rb`:
15+
16+
```ruby
17+
require "nanoc/github"
18+
```
19+
20+
At last, enable github data source in `nanoc.yaml`:
21+
22+
```yaml
23+
data_sources:
24+
- type: github
25+
items_root: /posts # the root where items should be mounted
26+
repository: arkency/posts-from-arkency-blog # organization/repository on github to use as a source of content
27+
encoding: utf-8 # how to decode content (default: utf-8)
28+
access_token: secret123 # github access token, not required for public repositories (default: nil)
29+
path: posts/ # subdirectory of the content in given repository (default: nil)
30+
concurrency: 10 # how many threads to spawn to fetch data (default: 5)
31+
```
632
733
## Status
834

0 commit comments

Comments
 (0)