How to use the liquidjs function in liquidjs

To help you get started, weโ€™ve selected a few liquidjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fomantic / create-fomantic-icons / src / tasks / BuildDist.ts View on Github external
return new Promise((resolve) => {
    Logger.log();
    const distSpinner = spinner()
      .start('building dist');

    const engine = new Liquid({
      root: resolvePath(__dirname, '../../src/templates'),
      extname: '.liquid',
    });

    const ctx: { [key: string]: any } = parseResults;
    ctx.version = results.asset.version;

    const distFiles: { [key: string]: string } = {
      'icon.html.eco': 'docs/server/documents/elements/',
      'icon.overrides': 'ui/src/themes/default/elements/',
      'icon.variables': 'ui/src/themes/default/elements/',
    };

    const templateFileRenderFuncs = Object.keys(distFiles)
      .map(filename => new Promise((resolveRender, rejectRender) => {
        engine.renderFile(`${filename}.liquid`, ctx)
github catarse / catarse.js / src / root / admin-notifications.js View on Github external
controller() {
		const templates = commonNotification.paginationVM(
            models.notificationTemplates, 'label.asc'),
            engine = Liquid(),
            loaderTemp = m.prop(true),
            loaderSubmit = m.prop(false),
            selectedItem = m.prop(),
            selectedItemTemplate = m.prop(),
            renderedTemplate = m.prop(),
            renderedSubjectTemplate = m.prop(),
            parsedTemplate = m.prop(),
            parsedSubjectTemplate = m.prop(),
            selectedItemSubjectTemplate = m.prop(),
            templateDefaultVars = {
                user: {
                    name: 'test name user'
                }
            },
            renderSubjectTemplate = (tpl) => {
                const tplParsed = engine.parse(h.stripScripts(tpl));

liquidjs

A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.

MIT
Latest version published 4 days ago

Package Health Score

83 / 100
Full package analysis

Popular liquidjs functions