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

create-static-web

v0.9.5

Published

Create static websites easily with the expected defaults

Downloads

42

Readme

Create-Static-Web

Another static site generator:

$ npm install create-static-web -g
$ web

|Transformations |Features | |------------------------------------|-------------------------------------| |.liquid .hbs.html |• Works out of the box | |.md + layout:.html |• Livereload | |.scss .sass.min.css |• Extensible with hooks [WIP] | |.src.js.min.js [WIP] |• Basic compatibility with Jekyll |

Getting Started

Create your readme.md:

---
layout: hello.hbs
---

Front-matter enabled website

Also your _hello.hbs file:

<main>{{ body }}</main>

Voila! Your site should be ready to go:

<main>
<p>Front-matter enabled website</p>
</main>

Demo

Clone this repo and run web:

$ npm install create-static-web -g
$ git clone https://github.com/franciscop/create-static-web.git
$ cd create-static-web
$ web      # The browser will open with this readme

Automatic compilation

The command web will automatically compile some extensions (explained below). Except if they also start by an underscore. Then they will be considered partials and not be rendered by default.

Liquid template

These will be rendered (excluding Partials) into a file with the same name and the extension html:

  • ./index.liquid./index.html
  • ./demo.liquid./demo.html
  • ./blog/index.liquid./blog/index.html

They will receive the data as specified in the Data Specification:

// index.liquid
<!DOCTYPE html>
<html>
  <head>
    <title>{{title}}</title>
    ...
  </head>
  ...
</html>

SASS and SCSS

The style files (excluding Partials) will be compiled to a file with the same name in the same folder, with the extension .min.css:

  • ./style.scss./style.min.css
  • ./demo.scss./demo.min.css
  • ./blog/style.scss./blog/style.min.css

Then you have to include it in your template as normal:

// index.hbs
<!DOCTYPE html>
<html>
  <head>
    ...
    <link rel="stylesheet" href="/style.min.css">
  </head>
  ...
</html>

Files ending with these extensions will be automatically compiled:

.liquid, .hbs, .sass, .scss

They are compiled to the same folder with the same filename. SASS and SCSS will add a .min to the extension to differentiate in case you have any .css.

Partials

Partials are useful in two situation: as layouts and to be included in another files.

Data Specification

A file called static.config.js in the same folder where the script is being run will be loaded as a configuration script.

Front Matter

There is a special variable called content (aliased as body) which represents the Markdown content as html into your template:

// index.liquid
<!DOCTYPE html>
<html>
  <head>
    <title>{{title}}</title>
    ...
  </head>
  <body>
    {{ body }}
  </body>
</html>