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

tickle-js-ssg

v0.5.1

Published

a little thing

Downloads

43

Readme

This is Tickle 😂

Actual Truth (I think...):

I don't really know what a static site generator is (I'm actually not sure if that's true, but let's roll with it). Is this what it is, sort of?

I did this why, now?

I've used Jekyll a tiny, little, bit before and liked it a lot. But I didn't like not knowing what was going on underneath. I don't speak Ruby.

So it was either learn Ruby or write something in JavaScript (something about Ruby syntax bothers me -- I have no idea what or why). So I did some looking and reading and came across Marijn Haverbeke's heckle, a Jekyll clone written in JavaScript (Marijn Haverbeke is amazing).

✨ Jackpot! ✨

Tickle is heckle adapted (read: simplified) for my own needs. It's also not nearly ready for actual use. Happily welcoming contribs 😄

Basically, you point tickle to a directory of markdown files and a template for those files, and it renders ther markdown as html, spitting things out into a build folder. And it does it chuckling the entire time! 😆

Usage:

Currently, Tickle expects your project directory to contain the following:

_site
├── blog
│   └── posts
├── _includes
└── _templates

Posts will be generated based on the template specified in the post's frontmatter.

_includes

Partials can be placed in your _includes folder. Then, e.g. header.html, can be injected in your templates with {{>header}}.

/* _includes/header.html*/
<header>
  <h1>Site Header 😆</h1>
</header>
/* _templates/default.html */

<!DOCTYPE html>
<html>
  ...
  <body>
    {{>header}}
    ...
</html>

blog/posts/

Posts should follow (what I take is fairly) standard naming convention:

yyyy-mm-dd-blogpost.(md|markdown|html)

Posts should begin with the following frontmatter:

---
title: "YourPostTitle"
template: "NameOfYourTemplate"
---

/* Begin post here */

_config.json

{
  "site_url": "changethis.com",
  "base_path": "./_site", <-- important
  "output": "./public_html", <-- important
  "clean_dist": true, <-- backs output up to old_output, deletes output
  "build_index": true <-- creates postIndex.html ./public_html/blog/
}

Installation

Install with npm: npm install -D tickle-js-ssg Then in your project root, you'd have a build file where you run:

'use strict';
const Tickle = require('tickle-js-ssg');

const config = require('path/to/your/_config.json')
// By default, Tickle looks for your a configuration file in your project root called `_config.json`.

function generate() {
  Tickle(config);
};

generate(); // run generate() to :rocket:

WIP:

📆 I'll be adding support for, among other things, ✓ partials and automatic generation of an index of posts, based on a given a template.