Git Product home page Git Product logo

jing's Introduction

Please consider using [pachacamac/sessg] instead. It should be considerably better than this one. Also this one is not further developed anymore.

Jing

A tiny static site generator packing a punch

Jing tai wang ye sheng cheng qi 静态网页生成器


Has built in support for Erb - and Markdown templates, Typescript compiler, Sass compiler, JavaScript/Css minifier, partial- and layout support, variable support, easily extendable, updates your page as soon as you change a file.

Installation

Add this line to your application's Gemfile:

gem 'jing'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jing

Usage

call jing on the command line or have a look at the code (it's tiny) :)

Creates a new folder mypage or updates an existing one and adds a basic setup:

$ jing create mypage
$ cd mypage

Build the current project:

$ jing build

Automatically build the page whenever a file in the project folder changes:

$ jing watch
$ jing watch -full_build true   # to not skip uglifying js files (slower)

Serves the current projects _dst folder on http://0.0.0.0:8000:

$ jing serve
$ jing serve -no_auto_reload true       # to not inject auto page reload code into html files
$ jing serve -port 1234 -root somepath  # to change port and root directory

Options that work in all commands:

-src somepath     # changes the source folder - default: ./ (current folder)
-dst somepath     # changes the output folder - default: ./_dst
-layouts folder   # changes the layouts folder - default: ./_layouts
-partials folder  # changes the partials folder - default: ./_partials

Show current version

$ jing version

File endings work like Russian dolls: They get converted from outer to inner. Rails folks should be somewhat familiar with that but here it's a bit stricter.

Folders starting with _ have special meaning, they generally won't get copied into the destination folder _dst.

_partials holds partials (TODO: explanation)

_layouts holds layouts (TODO: explanation)

`_dst' holds the generated site

.meta.yml holds global meta variables available in templates when not overwritten

I'll try and add a basic example project soon. Check out the examples folder. If you feel like giving this a try and have questions feel free to open an issue or reach out otherwise. Pull requests welcome too.

Development

Extending is fairly easy.

@converters variable in the initialize method holds a bunch of converters. Just add one in the spirit of the others.

Class methods that end in a bang ! automatically are registered as cli commands. If you wish to add a command just add a bang-method and you should be done.

Feel free to open issues for questions / ideas etc that you don't know how to work on or have no time working on as well as actual bugs and quirky etc. I'm sure there are some.

Please fork and make a pull request if you want to contribute.

Examples

Check out the examples folder, or this repository for a full fledged example that is directly deployable to netlify.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pachacamac/jing.

License

The gem is available as open source under the terms of the MIT License.

jing's People

Contributors

dependabot[bot] avatar pachacamac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jing's Issues

fix gem loading

  • fix gem loading time (seems to take way long since last version)
  • add simple way to load additional gems

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.