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

quinoa

v0.3.1

Published

static site generator with versioning

Downloads

18

Readme

quinoa

static site generator with versioning inspired by wheat

install

npm install -g quinoa

the setup

you need this directory layout:

├── a.md
├── b.md
├── sub
│   ├── c.md
│   └── view.html
├── sub-two
│   └── d.md
└── view.html

nunjucks parses the nearest view.html interpolating the content your markdown files as appropriate.

In the above example, a.md, b.md, and d.md use view.html as a template. sub/c.md uses sub/view.html as a template.

templates

A template looks like this:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>blog – {{ title }}</title>
</head>
<body>
  <h1>{{ title }}</h1>
  <p>{{ date }}</p>
  <article>{{ content }}</article>
</body>
</html>

hacks

quinoa lets you customize the behavior of your site with hacks.

A hack.js file looks like this:

module.exports = function (env) {
  env.addFilter( ... );
  env.addExtension( ... );
  env.addPrerender( ... );
};

hacks can use any of methods in nunjuck's enviornment API. most commonly you'll want to use env.addFilter or env.addExtension to extend templates.

quinoa adds one method to the nunjuck enviornment – env.addPrerender. this method takes a function which can modify template locals before env.render is called.

quinoa applies hacks from the base of the git repo downward to the level of each template.

├── a.md
├── hack.js
├── sub
│   ├── b.md
│   └── hack.js
└── view.html

in the above example, a.md will apply hack.js, and b.md will apply hack.js then sub/hack.js.

building

run quinoa from within a git repo

you'll get something like this:

├── build
│   ├── a
│   │   ├── a3eb6baf58f779c0ac9780eb8949d11fba40e483.html
│   │   ├── d3952b79c7d3fe024ba2cf886dc9225d3107d342.html
│   │   └── index.html
│   ├── b
│   │   ├── f61709a29ec6f1353f2a3c1adb2631e71bb33cd3.html
│   │   └── index.html
│   └── sub
│       └── b
│           ├── af285dd370aa1b6779bf67ac3bdc19da512aaac5.html
│           ├── 29ec6f1353f2a3c1adb2631f61709ae71bb33cd3.html
│           └── index.html
├── a.md
├── b.md
├── sub
│   └── c.md
└── views
    └── index.html

the index.html files correspond to the state of the file on the disk. the sha-lookin' .html files correspond to revisions of those files.

use something like nginx to serve the files.

that's all

fyi

quinoa:

  • only works in git repos for now
  • follows your gitignore rules

license

MIT