Skip to content

Commit bc3c109

Browse files
update docs
1 parent 7d19342 commit bc3c109

6 files changed

+80
-7
lines changed

docs/README.md

-3
This file was deleted.

docs/_coverpage.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
> A simple Instagram JS plugin for your website.
44
55
- Powered by the [Instagram Basic Display API](https://developers.facebook.com/docs/instagram-basic-display-api/)
6-
- Lightweight (< 10kB), with 0 dependencies
6+
- Lightweight (12KB minified), with 0 dependencies
77
- Easily customizable with templating support
88
- Maintained and supported since 2012
99

1010
[GitHub](https://github.com/stevenschobert/instafeed.js/)
11-
[Get Started](#docsify)
11+
[Get Started](#installation)
12+
13+
![color](#f0f0f0)

docs/_sidebar.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
* [Getting Started](getting-started.md)
33
* [Managing Access Tokens](managing-access-tokens.md)
44
* [Migrating to v2](v2-migration-guide.md)
5+
* [Changelog](changelog.md)

docs/home.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Instafeed.js
2+
3+
[![Build Status](https://travis-ci.com/stevenschobert/instafeed.js.svg?branch=master)](https://travis-ci.com/stevenschobert/instafeed.js)
4+
5+
Instafeed.js is a simple way to display your Instagram photos on your website.
6+
7+
We're in the process of launching Instafeed.js v2, powered by the new [Instagram Basic Display API](https://developers.facebook.com/docs/instagram-basic-display-api/). Guides and documentation are being created and will be added to the [project's wiki](https://github.com/stevenschobert/instafeed.js/wiki).
8+
9+
See the [v2 migration guide](v2-migration-guide.md) for help on updating from v1, or a [basic demonstration with code examples](https://codepen.io/companionstudio/pen/rNVPGOz).
10+
11+
For the now-non-functional v1.x library, please [see the Legacy API branch](https://github.com/stevenschobert/instafeed.js/tree/legacy-api).
12+
13+
## Installation
14+
15+
Setting up Instafeed is pretty straight-forward - there are 3 main steps.
16+
17+
1. Create a Facebook app linked to Instagram, and add yourself as a test user. See [Managing User Tokens](https://github.com/stevenschobert/instafeed.js/wiki/Managing-Access-Tokens).
18+
2. Create an access token and provide it to an [Instagram Token service](https://github.com/companionstudio/instagram-token-agent)
19+
3. Add the instafeed.js script to your web page and provide some simple options. See [Basic Usage](https://github.com/stevenschobert/instafeed.js/wiki/Basic-Usage)
20+
21+
```html
22+
<script type="text/javascript" src="path/to/instafeed.min.js"></script>
23+
```
24+
25+
> Note: Instafeed.js is also compatible with require.js and commonJS exports
26+
27+
## Basic Usage
28+
29+
```html
30+
<div id="instafeed"></div>
31+
32+
<script type="text/javascript">
33+
var feed = new Instafeed({
34+
accessToken: 'your-token'
35+
});
36+
feed.run();
37+
</script>
38+
```
39+
40+
Instafeed will automatically look for a `<div id="instafeed"></div>` and fill it with linked thumbnails. Of course, you can easily change this behavior using [standard options](#standard-options). Also check out the [advanced options](#advanced-options) for some advanced ways of customizing __Instafeed.js__.
41+
42+
## Requirements
43+
44+
* A Facebook developer account, and an Instagram account with some media posted to it.
45+
* A Facebook app linked to your Instagram account, and a token generated through that app.
46+
* A service to keep your access token fresh
47+
48+
## Options
49+
50+
Here are some of the most commonly used options:
51+
52+
| Key | Default Value | Valid types | Description |
53+
|---|---|---|---|
54+
| `accessToken` | `null` | String, Function | **Required.** The Instagram access token, either as a string, or a function which returns a string |
55+
| `debug` | `false` | Boolean | Set to `true` to display debugging information |
56+
| `filter` | `null` | Function | A function used to exclude images from your results. The function will be given the image data as an argument, and expects the function to return a boolean. |
57+
| `limit` | `null` | Number | Display a maximum of this many posts |
58+
| `sort` | `null` | Function | A custom function to sort the media, rather than the default 'most recent' sorting|
59+
| `target` | `'instafeed'` | String, DOM Element | Either the ID or the DOM element itself where you want to add the images. |
60+
| `template` | `'<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>'` | String | A mustache template used to produce HTML for the document. |
61+
| `transform` | `null` | Function | A function used to transform the image data before it is rendered. |
62+
63+
See [Options](https://github.com/stevenschobert/instafeed.js/wiki/Options-Reference) in the wiki for the complete reference.
64+
65+
## Templating
66+
67+
The easiest way to control the way Instafeed.js looks on your website is to use the __template__ option. You can write your own HTML markup and it will be used for every image that Instafeed.js fetches. See [Templating](https://github.com/stevenschobert/instafeed.js/wiki/Templating).

docs/index.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@
1212
<div id="app"></div>
1313
<script>
1414
window.$docsify = {
15+
themeColor: '#9370DB',
1516
name: 'Instafeed.js',
1617
repo: 'stevenschobert/instafeed.js',
1718
coverpage: true,
1819
loadSidebar: true,
19-
subMaxLevel: 2
20+
subMaxLevel: 2,
21+
homepage: 'home.md',
22+
auto2top: true,
23+
alias: {
24+
'/changelog': 'https://raw.githubusercontent.com/stevenschobert/instafeed.js/develop/CHANGELOG.md',
25+
}
2026
};
2127
</script>
2228
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>

docs/v2-migration-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ v2 provides a much simpler service, but should still cater to the most common us
1414

1515
## Additional requirements:
1616

17-
- An access token refresh service is required. See [Managing Access Tokens](Managing-Access-Tokens) for more info.
17+
- An access token refresh service is required. See [Managing Access Tokens](#managing-access-tokens) for more info.
1818

1919
## Migrating, Step by Step
2020

0 commit comments

Comments
 (0)