0.11.0 • Published 3 years ago

pitch-cli v0.11.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
3 years ago

The objetive of pitch is to provide a powerful tool capable of building static websites progressively. Just a src folder should be enough to build a static website.


LinuxWindows
CircleCIAppVeyor

Install

npm install -g pitch-cli

Usage

Create a file structure like this:

MyWebsite/
    src/
        index.html
        style.css

Running pitch serve inside MyWebsite will run a web server in http://127.0.0.1:3000. Access it from the browser check that it's working.

Now change the index.html extension to .ejs and the style's to .scss, change the contents of the files, add new styles and reference them from index.ejs, or create some partials.

As you can see, pitch takes care of building the needed resources as you request them. It just works.

Data

To include data into your website, just create a data folder with some JSON files in it:

MyWebsite/
    src/
        index.ejs
        style.scss
    data/
        people.json

Inside people.json:

["John", "Charles", "Thomas"]

Inside index.ejs:

<p>People: <%= data.people.join(", "); %></p>

And that's all you need to do to include data into your website. Change any file's contents and reload the page in the browser, it gets re-compiled automatically.

The data proxy is able to navigate into folders too.

MyWebsite/
    data/
        articles/
            helloWorld.md
<article>
    <%- data.articles.helloWorld.html %>
</article>

Pitch understands many file formats inside it's data folder:

  • .json: Gets JSON.parse()'d.
  • .js: Gets require()'d.
  • .md: Parsed with remark.

If the file isn't any of these formats, will read it like a plain text file.

Router

Documentation is on the way.

Why

Got really tired of configuring stuff to build a simple website that I need right now because whatever.

Regular static site generators tie you to 'blogs' or websites with pages. Wanted something that isn't oriented to a certain type of website and gave me everything I needed, instead of requiring some extra build tasks to transpile something.

Also, many of them require you to have a default configuration file, when a single index.html should be enough.

Thought that gluing together a template system with some css pre-processing inside a CLI tool should do the trick. And it did.

0.11.0

3 years ago

0.10.0

4 years ago

0.9.0

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago