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

static2000

v0.6.0

Published

The simple static site generator

Downloads

16

Readme

Static2000 Build Status

The simple static site generator built on node.js

Installation

Via npm:

npm install static2000

You also need a template adapter, such as static2000-jade:

npm install static2000-jade --save-dev

Usage

Static2000 takes templates and content and mashes them together to create a folder structure and html files. It can be used from the command line or inside a node module and plays nice with Gulp. Gulp is the recommended method of running Static2000, since it does not have any CSS preprocessing or similar built in.

Templates and content can use jade or nunjucks with YAML front matter for defining properties on content pages using template adapters.

Static2000 now has a Yeoman generator which simplifies setup considerably. Read about it here: generator-static2000 and install it with

npm install -g generator-static2000

See the documentation for more information.

Options

  • templates Source folder for templates. Default is templates.
  • content Source folder for content. Default is content.
  • baseUrl Base URL for the site. Set this to create an XML sitemap when generating the site.
  • templateAdapter The template adapter to use. Default is static2000-jade.
  • dest Destination folder for generated html. Optional. If specified, generated files will be written to that location. If not, you can write them to disk using vinyl-fs.
  • globalFunctions An object with functions that should be available on all pages and in all templates. Optional. Note that it is often better to use a jade mixin defined in templates/includes/globals.jade or a global plugin instead.

API

Static2000 exports one function that takes three optional arguments: options (see above), a success callback and and error callback. The function returns a stream of generated html files and a sitemap xml if baseUrl was specified.

var static2000 = require('static2000');

static2000(options, onSuccess, onError);

Gulp

Using static2000 together with Gulp is simple, no plugin required. Since 0.3.0, static2000 returns a stream that can be piped to gulp.dest() to write the files to disk and optionally process them.

var static2000 = require('static2000');

gulp.task('static2000', function() {
    return static2000()
        .pipe(gulp.dest('www'));
});

Change Log

0.4.2

  • Parallellized sitemap and page generation.
  • Updated mocha and minimatch dependencies.
  • Removed gulp.

0.4.1

  • Updated vinyl-fs dependency.

0.4.0

  • Model plugins.

0.3.0

  • Now returns a stream of generated files. Makes it easy to post-process the files with plugins when using gulp.

0.2.1

  • Added loading of global plugins. It's now possible to write plugins that extend the globals object in templates and have access to options and a list of all content models.

0.2.0

  • Extracted template engines into adapters. This is a breaking change. Static2000 now requires a template adapter to work, and none is included. Install with npm i static2000-jade for jade templates.

0.1.6

  • Refactored code
  • Tests!

0.1.5

  • Last modified date added to sitemap.

0.1.4

  • XML sitemap generation.

0.1.3

  • Convert flat file list to folder structure.
  • Page sort order.

0.1.2

  • Bug fixes.
  • Improved documentation.

0.1.1

  • Fixed stream error handling.
  • Fixed compiled body rendering.
  • Fixed readme file layout issues.

License

MIT