0.0.37 • Published 4 years ago

sambal-cli v0.0.37

Weekly downloads
40
License
MIT
Repository
github
Last release
4 years ago

Sambal CLI

Intro

Build fast and SEO friendly website with RxJs. No new template syntax to learn, just pure Javascript template literal. Support schema.org vocabularies and json-ld (json linked data) format.

Installation

npm install --save-dev sambal-cli sambal

touch sambal.config.js

Sample sambal.config.js

const {from, of} = require("rxjs");
const {render, template} = require("sambal");

function sitemap() {
    return from([
        '/first-blog',
    ]);
}

function render({path, params}) {
    return of({headline: "hello world"})
    .pipe(render(({headline}) => {
        return template`
            <html>
                <body>
                    <h1>${headline}</h1>
                </body>
            </html>
        `;
    }));
}

function sitemap() {
    return from([
        '/',
        '/user/user123',
    ]);
}

module.exports = {
    routes: [
        {path: '/', render: render},                 // REQUIRED. Array of routes.  Path is an expressjs style path, render is a function of type ({path, params}) => Observable  
        {path: '/user/:username', render: render}
    ],
    sitemap$: sitemap()                              // REQUIRED.  Observable of all possible urls in your website.  
};

Generate static site

npx sambal build

Start dev server and reload browser on change event

npx sambal serve
0.0.37

4 years ago

0.0.36

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.20

6 years ago

0.0.21

6 years ago

0.0.22

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.14

6 years ago

0.0.15

6 years ago

0.0.16

6 years ago

0.0.17

6 years ago

0.0.12

6 years ago

0.0.13

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

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