npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-tumblr

v1.0.2

Published

Better tumblr theming with gulp

Downloads

8

Readme

gulp-tumblr

Better tumblr theming with gulp

Install

With npm:

npm install --save-dev gulp-tumblr

Usage

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

    {
    	"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": "<p>Lorem ipsum dolor sit amet, consectetuer <a target=\"_blank\" href=\"/\">adipiscing elit</a>. 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.</p>\n\t<ul>\n\t\t<li>Lorem ipsum dolor sit amet.</li>\n\t\t<li>Consectetuer adipiscing elit. </li>\n\t\t<li>Nam at tortor quis ipsum tempor aliquet.</li>\n\t</ul>\n\t<p>Cum sociis <a target=\"_blank\" href=\"/\">natoque penatibus</a> 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.</p>\n\t<blockquote>Donec placerat mauris commodo dolor. Nulla tincidunt. Nulla vitae augue.</blockquote>\n\t<p>Suspendisse ac pede. Cras <a target=\"_blank\" href=\"/\">tincidunt pretium</a> 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.</p>"
    	},
    	"Quote": {
    		"Quote": "It does not matter how slow you go so long as you do not stop.",
    		"Source": "Wisdom of <a target=\"_blank\" href=\"http://en.wikipedia.org/wiki/Confucius\">Confucius</a>",
    		"Length": "short",
    		"Tags": "wisdom"
    	}
    }
  • A main template file that contains Tumblr variables and blocks and will be streamed in.

    Example: template.html

    <!DOCTYPE html>
    <html>
    <head>
    	<title>{Title}</title>
    
    	{block:Description}
    		<meta name="description" content="{MetaDescription}" />
    	{/block:Description}
    
    	<link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body>
    	<h1>{Title}</h1>
    	<h2>{Description}</h2>
    
    	{block:Quote}{/block:Quote}
    	{block:Text}{/block:Text}
    </body>
    </html>
    
  • A directory (options.postFolder) with individual templates for each post type.

    Example: post/text.html

    <!-- block:Text -->
    	{block:Title}{Title}{/block:Title}
    	{Body}
    <!-- /block:Text -->

    Example: post/quote.html

    <!-- block:Quote -->
    	<article>
    		<blockquote class="{Length}">
    			{Quote}
    		</blockquote>
    
    	</article>
    	{block:Source}<div class="source">{Source}</div>{/block:Source}
    <!-- /block:Quote -->
    

API

.preview([options])

Takes a file with Tumblr variables and blocks 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 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.