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

@terrymooreii/sia

v1.0.2

Published

Sia is static site generator

Downloads

1

Readme

Sia blog

Sia is static site generator

Installation

npm install --save-dev @terrymooreii/sia

After installation run the following command in a new node repo

sia init

This will install the nunjucks template files, some base css and a shell index.html

It also add the .siarc.js config file to the root of your project.

The .siarc.js file contains two sections. One for configuing your site information. The second is to configure the app's folders, numjucks template, and markdown configutation.

Adding pages and posts

The easist way to add a new page or a post to your site is to run the following command

sia new post new-post-name

This will create a new folder in the content folder called new-post-name and add a shell index.html

You can do the same thing to create a new page

sia new post new-post-name

The difference between pages and posts is that during the build process sia keeps tack of all posts and generate a post list page at the url /blog

New pages and post will have config area at the top that tell sia how to handle the page and post. All properties expect the image is required. The image is used to generate the page's og:image. If its not present we will use the blogs_image.

---

template: post
title: Page title
created_at: 2024-01-12 16:00:00-5:00
description: Testing out some markdown
---
  • template is the nunjucks template located in src/_partials
  • title is the post title and used in the blog posts list page
  • create_at is the date of the post
  • description a short description of the post

Not ready to publish a post? Add draft: true

Build

To build the site run

sia build

This will parse all markdown files and then numjucks. The default output folder is /public

The build command will also copy all assets, js and css to the /public folder. If a post or a page folder contain other files other than markdown then those files will also get moved to the /public/<folder>. This makes it easy to organize a single page or posts with custom js, css, or images.

All markdown files will get parsed with markdown-it and you can add additional markdown-it plugins in the .siarc.js file.

Plugins

There are lots of plugins that you can use in sia to extend markdown-it and in turn sia. Just install the plugin, import itto your .siarc.js file and then add it to the app.markdown.plugins array.

Local developement

Currently these are the apps that I use on my blog for local development and building

"scripts": {
  "serve": "npx http-server public",
  "watch": "forever --watchDirectory ./src -w ./node_modules/@terrymooreii/sia/lib/index.js build",
  "dev": "concurrently --kill-others \"npm run watch\" \"npm run serve\"",
  "clean": "rm -rf public",
  "build": "sia build"
},
npm install forever concurrently http-server

Coming soon will be a simple way to run a local web server to see live updates to posts and pages as you work via the sia command.

Templates and site configuration

All njk files are in a simple default state to generate a simple and clean website. You can modifiy the html in these file to customer your site to look how you want.

If you make something cool please let me know.

Todo

This is a list of items that still need to be tackled

[ ] Better error handling [ ] Pagination [ ] sia init to generate a new site and clean up of the initial theme [ ] While pages and longer blog posts are great, i would like to add a mircoblogging feed to the site. [ ] Github action to publish new version to npm