sambal-cli
Sambal CLI tools
Last updated 6 days ago by chen4119 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sambal-cli 
SYNC missed versions from official npm registry.

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

Generate schema.org boilerplate type in yaml or json format

npx sambal schema.org <schema.org type> <output file> [-f, --full]

For example,

npx sambal schema.org person person.yml

npx sambal schema.org blogposting blog.json

Current Tags

  • 0.0.34                                ...           latest (6 days ago)

34 Versions

  • 0.0.34                                ...           6 days ago
  • 0.0.33                                ...           a month ago
  • 0.0.32                                ...           a month ago
  • 0.0.31                                ...           a month ago
  • 0.0.30                                ...           a month ago
  • 0.0.29                                ...           3 months ago
  • 0.0.28                                ...           3 months ago
  • 0.0.27                                ...           5 months ago
  • 0.0.26                                ...           5 months ago
  • 0.0.25                                ...           5 months ago
  • 0.0.24                                ...           5 months ago
  • 0.0.23                                ...           5 months ago
  • 0.0.22                                ...           6 months ago
  • 0.0.21                                ...           6 months ago
  • 0.0.20                                ...           6 months ago
  • 0.0.19                                ...           6 months ago
  • 0.0.18                                ...           6 months ago
  • 0.0.17                                ...           6 months ago
  • 0.0.16                                ...           6 months ago
  • 0.0.15                                ...           6 months ago
  • 0.0.14                                ...           6 months ago
  • 0.0.13                                ...           6 months ago
  • 0.0.12                                ...           6 months ago
  • 0.0.11                                ...           6 months ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 14
This Month 14
Last Day 0
Last Week 0
Last Month 90
Dependencies (7)
Dev Dependencies (30)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |