Skip to content

Template

Render Handlebars templates.

import { std } from "vyft";
export const nginx = std.fs.template("nginx", {
source: "./nginx.conf.hbs",
vars: {
port: "3000",
domain: "example.com",
},
});

Or use inline content:

export const config = std.fs.template("config", {
content: "PORT={{port}}",
vars: { port: "8080" },
});
FieldTypeDefaultDescription
sourcestringPath to template file
contentstringInline template string
varsRecord<string, string>requiredTemplate variables

One of source or content must be provided.

  • content — rendered template
  • sha256 — content hash