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

iceage-ssg

v0.1.2

Published

Small, simple static site generator

Downloads

14

Readme

iceage

Small, simple static site generator with no nonsense features. It is a minimalistic tool to automate tedious parts of a static website.

Written in JavaScript. Iceage operates on HTML files with Liquid templates embedded.

Installation

npm install --save-dev iceage-ssg

Once installed, you can add the command invocation in your package.json

"scripts": {
  "dev": "iceage --reload --open",
  "build": "iceage"
}

iceage can also be installed globally as:

npm install --global iceage-ssg

Once installed, check the version using:

iceage --version

Getting Started

The structure of a Iceage website is as follows

./
- layouts/
  - default.html
  - blogs.html
- imports/
  - header.html
  - footer.html
- pages/
  - index.html
  - posts/
    - post1.html
    - post2.html
- static/
  - style.css
  - main.js
  - favicon.ico

pages/ are the root of your website. It contains the pages which your actual site will have. Each file in pages/ represent a unique page. A page may have a frontmatter at the top which is written in YAML. It is folowed by the actual page content - HTML tree with liquid. The two parts are separated by a ---.

Sample index.html

title: Homepage
draft: false
layout: default.html
tags: [ home ]
---
<h1>This is the homepage</h1>
<p>Loren ipsum</p>
...

Layout on the other hand do not contain frontmatter. But layouts can access the contents of the page on which it is being applied to using the content variable and its info using the meta object.

<!doctype html>
<html>
  <head>
    <title>{{meta.title}}</title>
  </head>
  <body>
    {{imports.header}}
    {{content}}
    {{imports.footer}}
  </body>
</html>

Here the imports object is used to access the content of all the imported HTML files. An import file is a plain HTML file which is replaced as-is in a layout or a page.

<div class="header">
  <ul>
    <li>Home</li>
    <li>Blogs</li>
    <li>Gallery</li>
    <li>Contacts</li>
  </ul>
</div>

Apart from that, the page object can be used to access all the pages present in the workspace. It is a list (array) where all the elements are an object having a path property and all the meta data (frontmatter) of that page.

Finally, the contents of the static/ directory is copied as-is to your final generated site. It can be used to keep JavaScript files, CSS files, icons, images etc.

In order to generate the website, simply run the CLI:

iceage

To run the CLI in live-reload mode which hosts the website in a web server and hot reloads it based on changes:

iceage --reload

Optionally, --open flag may be used to automatically open the browser window pointing to the URL where the website is hosted.