Sambal

A static site generator based on RxJs and linked data

$ npm install --save-dev sambal

Load json-ld from URL

const {from} = require("rxjs");
const {loadJsonLd} = require("sambal");

from(['https://www.imdb.com/title/tt1843866'])
.pipe(loadJsonLd());

Render schema.org metadata and HTML

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

of({
    "familyName": "Smith",
    "givenName": "John",
    "description": "Making linked data useful",
    "sameAs": [
        "https://github.com/johnny123",
    ]
})
.pipe(pushJsonLd((d) => toSchemaOrgJsonLd(d, "Person"))) // add schema.org Person
.pipe(render(({familyName, givenName}) => {
    return template`
        <html>
            <body>
                <h1>I am ${givenName} ${familyName}</h1>
            </body>
        </html>
    `;
}));