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

xertz

v0.57.0

Published

A static site generator written in TypeScript

Downloads

62

Readme

xertz Build Status

Pronounced ‘zerts’, it means to gulp something down quickly and/or in a greedy fashion

xertz is a static site generator with first-class support for Markdown and Handlebars templates

Installation and Usage

xertz requires Node.js to be installed and is distributed on npm. It can easily be installed and executed by using the npx tool, which is distributed with newer versions of Node.js.

Commands

npx xertz init [folder_name] - Initializes a new xertz project

npx xertz new [Post Title] - Create a new folder in posts/.

npx xertz serve - Builds and serves a xertz project on http://localhost:8080. Also watches and rebuilds on any changes.

npx xertz build - Buids a xertz project and outputs to _dist folder.

Features

  • First class support for SaSS, Markdown and Handlebars templating
  • Built in support for AMP
  • Code Highligting via Prism.js

Directory Structure

When you initialize a xertz site, a directory will created that looks like this:

|-- my_site
  |-- _layouts
  |-- media
  |-- posts
  |-- styles
  |-- _config.yml
  |-- index.html.hbs
  • _layouts - This folder contains Handlebars layouts which will be used to contsruct rendered pages.
  • media - This folder contains images and other assets and will be copied as is.
  • posts - This folder contains the posts.
  • styles - CSS files can be placed here and will be be made available in the template data.
  • _config.yml - This is the base config file.
  • index.html.hbs - This is the main index page for the site.

Config

Configuration comes from one of these places, in order of precedence:

  • Root _config.yml
  • _config.yml file in content directory or subdirectory
  • Markdown file yaml Front Matter

Templates

A file with the html.hbs extension will be processed as a Handlebars template and have access to pages data which will be an array of all pages in the current and subdirectories.

Markdown

  • A file can have a date prefix in its name which will set the date variable.
  • By default, the name of the file (minus any date prefix) will be used as the slug variable and effect the output path.

Content Package Directory

If subdirectory of posts/ contains contains a file called index.md, it will be deemed a Content Package Directory. This means all files within the directory will be processed as a unit and copied to a corresponding output directory.

For example, if you had a directory structure defined as:

|-- content
  |-- 2019-03-13-crazy-pets
    |-- index.md
    |-- catz_lol.jpg
    |-- doggy_do_little.jpg  

The 2019-03-13-crazy-pets/ folder is considered a Content Package Directory. It would be output as:

|-- crazy-pets
  |-- index.html
  |-- catz_lol.jpg
  |-- doggy_do_little.jpg  

and accessible at https://youdomain.com/crazy-pets/

Layouts

Any file with a _ prefix is ignored.

Styles

CSS and SaSS can be placed within any folder but when it is placed in the styles/ folder you have access to the styles within templates. This is useful, for example, if you want to inline your styles within a template with <style/> rather than linking to a path with <link rel="stylesheet"/>.

Any file with a _ prefix is ignored.

Handlebars Helpers

The following Handlebars helpers are made available in xertz:

  • limit - {{ limit pages 15 }}
  • filter - {{ filter pages "type" "post" }}
  • iif - {{ iif excerpt site_description }}
  • dateFormat - {{ dateFormat "now" "yyyy" }}
  • indent - {{{ indent my_text 4 }}}
  • group - {{#group pages by="year"}}
  • encodeURI - {{#encodeURI site_url}}