Socket
Socket
Sign inDemoInstall

twigger

Package Overview
Dependencies
125
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    twigger

Simple static site generator using Twig


Version published
Weekly downloads
8
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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 / ArgumentsDescription
-h, --helpShow help screen
-v, --versionShow installed version
initInit twigger in current directory
buildBuild current twigger application
serveServe current twigger application
clearClears 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:

DirectoryDescription
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 <JannikHv@gmail.com>

FAQs

Last updated on 31 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc