Project structure

Below is a skeleton of how a Sambal project would look like.

/.sambal              // reserved for Sambal temporary files
/pages                // Root directory for pages of your website        // website config file
sambal.entry.js       // ui entry file
package.json          // node.js package file

Export site config

export const siteConfig = {
    baseUrl: "", // REQUIRED
    collections: [],               // OPTIONAL - group and sort pages into collections
    theme: "sambal-ui-material",   // OPTIONAL - theme to use
    resolvers: []                  // OPTIONAL - custom fetchers to resolve uri

This is the entry file for Sambal to render html. The only required function to implement is renderPage where page is a WebPage object and options is user defined options. User may not need to implement this file if a theme is specified in to render HTML. If both a theme and sambal.entry.js exist, sambal.entry.js will take precedence over the theme.

export function renderPage({ page, options }) {
    // render complete html page

// OPTIONAL - author defined options.  Useful for theme developers to make their theme customizable
export const defaultOptions = {
    header: true,
    primaryColor: "#FFF",
    secondaryColor: "#DFE"