Skip to content

Commit

Permalink
switch to nunjucks templates
Browse files Browse the repository at this point in the history
Swig is unmaintained.
  • Loading branch information
afeld committed Aug 25, 2020
1 parent 81cef2b commit 2686084
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 96 deletions.
3 changes: 1 addition & 2 deletions examples/login/app.js
@@ -1,7 +1,6 @@
var express = require("express"),
session = require("express-session"),
passport = require("passport"),
swig = require("swig"),
SpotifyStrategy = require("passport-spotify").Strategy;

var consolidate = require("consolidate");
Expand Down Expand Up @@ -66,7 +65,7 @@ app.use(passport.session());

app.use(express.static(__dirname + "/public"));

app.engine("html", consolidate.swig);
app.engine("html", consolidate.nunjucks);

app.get("/", function (req, res) {
res.render("index.html", { user: req.user });
Expand Down
234 changes: 145 additions & 89 deletions examples/login/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/login/package.json
Expand Up @@ -5,8 +5,8 @@
"consolidate": "~0.15.1",
"express": "^4.17.1",
"express-session": "^1.17.1",
"nunjucks": "^3.2.2",
"passport": "~0.4.1",
"passport-spotify": "../..",
"swig": "~1.4.2"
"passport-spotify": "../.."
}
}
2 changes: 1 addition & 1 deletion examples/login/views/index.html
@@ -1,7 +1,7 @@
{% extends 'layout.html' %}

{% block content %}
{% if !user %}
{% if not user %}
<h2>Welcome! Please log in.</h2>
<p><a href="/login">login</a></p>
{% else %}
Expand Down

0 comments on commit 2686084

Please sign in to comment.