Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philipbordallo/gulp-tumblr
Better tumblr theming with gulp
https://github.com/philipbordallo/gulp-tumblr
Last synced: about 6 hours ago
JSON representation
Better tumblr theming with gulp
- Host: GitHub
- URL: https://github.com/philipbordallo/gulp-tumblr
- Owner: philipbordallo
- License: mit
- Created: 2016-02-02T00:44:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-05T20:54:21.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T14:26:24.179Z (about 1 month ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-tumblr
> Better tumblr theming with gulp## Install
With [**npm**](https://www.npmjs.com/package/gulp-tumblr):
```
npm install --save-dev gulp-tumblr
```## Usage
```javascript
const gulp = require('gulp');
const tumblr = require('gulp-tumblr');gulp.src(['./template.html'])
.pipe(tumblr.preview())
.pipe(gulp.dest('./export/'));
```## Requirements
* A JSON file (`options.dataFile`) that has the variable data of what to show.
Example: _data.json_```json
{
"Basic": {
"Title": "Demo Theme",
"MetaDescription": "This is a meta description",
"Description": "This is a description",
"BlogURL": "http://demo.tumblr.com/"
},
"Text": {
"Title": "An example post",
"Body": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam nisi lorem, pulvinar id, commodo feugiat, vehicula et, mauris. Aliquam mattis porta urna. Maecenas dui neque, rhoncus sed, vehicula vitae, auctor at, nisi. Aenean id massa ut lacus molestie porta. Curabitur sit amet quam id libero suscipit venenatis.
\n\t
- \n\t\t
- Lorem ipsum dolor sit amet. \n\t\t
- Consectetuer adipiscing elit. \n\t\t
- Nam at tortor quis ipsum tempor aliquet. \n\t
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse sed ligula. Sed volutpat odio non turpis gravida luctus. Praesent elit pede, iaculis facilisis, vehicula mattis, tempus non, arcu.
\n\tDonec placerat mauris commodo dolor. Nulla tincidunt. Nulla vitae augue.\n\t
Suspendisse ac pede. Cras tincidunt pretium felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque porttitor mi id felis. Maecenas nec augue. Praesent a quam pretium leo congue accumsan.
"},
"Quote": {
"Quote": "It does not matter how slow you go so long as you do not stop.",
"Source": "Wisdom of Confucius",
"Length": "short",
"Tags": "wisdom"
}
}
```
* A main template file that contains [Tumblr variables and blocks](https://www.tumblr.com/docs/en/custom_themes) and will be streamed in.
Example: _template.html_
```html
{Title}
{block:Description}
{/block:Description}
{Title}
{Description}
{block:Quote}{/block:Quote}
{block:Text}{/block:Text}
```
* A directory (`options.postFolder`) with individual templates for each post type.
Example: _post/text.html_
```html
{block:Title}{Title}{/block:Title}
{Body}
```
Example: _post/quote.html_
```html
{Quote}
{block:Source}
```
## API
### `.preview([options])`
Takes a file with [Tumblr variables and blocks](https://www.tumblr.com/docs/en/custom_themes) and streams out a compiled file with data taken from a JSON file and separate post files.
### `.build([options])`
Takes a file with [Tumblr variables and blocks](https://www.tumblr.com/docs/en/custom_themes) and streams out a compiled file with blocks from separate post files ready to be upload to Tumblr.
#### `options`
Type: `object`
#### `options.dataFile`
Type: `string`
Default: `'./data.json'`;
Location of json file that stores variable data.
#### `options.postFolder`
Type: `string`
Default: `'./post/'`;
Location of folder that holds individual post files.