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

@jamesmh/statica

v1.0.0

Published

Dead simple zero config static site generator

Downloads

16

Readme

logo

Ever wish you could simply write some markdown files and convert them into web pages for your zero-fuss static site?

Introducing Statica - a dead simple zero config static site builder for people who don't need all that fancy "stuff".

It's perfect for static sites when you simply want to write content in markdown and easily convert them to web pages!

diagram

Install

npm install -g statica

Usage

Create The Template File

First, you need a template that represents the "outer shell" of your HTML site.

Create a file _template.html in the root of your site's folder.

Next, just put whatever HTML you want into it!

Injecting Content

Specify where content will be injected (from your markdown files) by adding the following to your template file:

<!--@Content()-->

The outer HTML might look like:

<body>
    <h1>This is my header</h1>
    <!--@Content()-->
    <footer>
        This is my footer
    </footer>
</body>

Writing Content

Write your markdown files (with an extension .md) anywhere you like. When compiled, each markdown file will be converted into an HTML file.

All other non-markdown files (HTML, JS, CSS, images, etc.) will be copied into ./www for you too.

For example, your site layout might look like:

pre-compiled

After generating the site, the compiled layout will be (inside ./www):

pre-compiled

Build It!

When installed as a global npm tool, open a terminal from the root of your site then run statica.

The compiled web site will be copied to a www folder.

terminal

Q&A

Can I add plain HTML files?

Yes! Statica will copy them over to the www folder for you when building. This might be useful for one-off pages that do differ quite a bit from your overall template.

Where do I put my site's assets (JS, CSS, etc.)?

Anywhere you want - except directly in the www folder since this is generated for you.

Can I Use NPM Modules On My Site?

Sure! Statica will ignore your node_modules folder when building your site. Just make sure your compiled files (via webpack, etc.) are being referenced in your HTML pages.

My Assets (JS, CSS) aren't working in my compiled site?

Are you using relative paths?