1.2.1 • Published 1 year ago

twigger v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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\

1.2.1

1 year ago

1.2.0

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago