1.0.8 • Published 4 years ago

liquid-express-views v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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:

  • viewDir: string representing view directory, defaults to "./views"
  • middleware: a function that can be used to register middleware, defaults to (app) => {}
  • engineConfig: a function that can be used to adjust templating engine, like registering liquid plugins, defaults to (engine) => {}
  • root: can pass an array of other directories to check for templates, defaults to "./views"
  • ext: can pass a file extension to look for, defaults to "./liquid"

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/"});
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago