AlexMercedCoder / liquid-express-views

0 stars 0 forks source link

liquid-express-views

by Alex Merced of AlexMercedCoder.com

It's pretty simple

  1. npm install liquid-express-views
const express = require("express")
const app = require("liquid-express-views")(express())

that's it!

Need update leave issues and pull requests here: https://github.com/AlexMercedCoder/liquid-express-views\

Documentation for liquidjs: https://liquidjs.com/index.html

P.S.

You can pass a secondary argument that is an object with the following properties:

regarding layouts

If your using layouts you may want to add an absolute path to your views folder which can be done through either of the following:

replace

const app = require("liquid-express-views")(express())

with

const path = require("path")
const app = require("liquid-express-views")(express(), {root: [path.resolve(__dirname, 'views/')]})

or this

const app = require("liquid-express-views")(express(), {root: process.cwd() + "/views/"});