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

twigger

v1.2.1

Published

Simple static site generator using Twig

Downloads

15

Readme

Twigger

Twigger ist a simple static site generator using Twig and SCSS.

Motivation

My problem building a simple static HTML website was that...

  • ... I don't want to have redundant HTML
    • so Twigger uses Twig that can include Twig templates.
  • ... I don't want to write plain CSS
    • so Twigger used SCSS, that is compiled and compressed to CSS by default.
  • ... I don't want to have bloated JavaScript files
    • so Twigger automatically minifies JavaScript by default.

Commands

| Command / Arguments | Description | | ------------------- | --------------------------------- | | -h, --help | Show help screen | | -v, --version | Show installed version | | init | Init twigger in current directory | | build | Build current twigger application | | serve | Serve current twigger application | | clear | Clears the public directory |

Installation

Install globally from NPM:

npm i -g twigger

Configuration

The following configuration is used by default:

cssOutputStyle: "compressed"
minifyJs: true
cssSourceMap: true
templateVariables: { }

cssOutputStyle

  • Type: String
  • Values: "expanded", "compressed"
  • Default: compressed

minifyJs

  • Type: Boolean
  • Default: true

cssSourceMap

  • Type: Boolean
  • Default: true

templateVariables

Template variables can be globally accessed in your project's Twig files.

  • Type: Object
  • Default: { }

You can override it by editing the twigger-config.yaml in your project's root directory.

Basic Structure

After initializing your twigger project, the following structure is built:

| Directory | Description | | ----------------- | ------------------------------------------------------------ | | public/ | Contains the built application. Can be cleared with twigger clear. | | src/assets/ | Assets directory that is synced to the public directory. | | src/js/ | Each JavaScript file is optionally minified and written to the public directory. | | src/pages/ | Twig pages that are each rendered to HTML files in the public directory. | | src/includes/ | Twig templates that are included by Twig pages. | | src/styles/ | SCSS styles that is optionally minified and written to the public directory as style.css. |

Get started

  1. Install twigger globally

npm i -g twigger

  1. Create a new project directory

mkdir my-new-project && cd my-new-project

  1. Initialize project

twigger init

  1. Serve the application on localhost:8080

twigger serve

  1. Build the application

twigger build

Author

Jannik Hauptvogel <[email protected]>