Balázs Orbán
Balázs Orbán

Reputation: 559

Jade variable in variable

I have a .jade file with only variables. One of them is a variable which begins with a variable defined before it.

example:

My variables.jade file:

- var baseurl = 'http://example.com'
- var assets = baserurl+'/assets'
- var images = assets+'/images'

My main.jade file:

include variables
img(src=images+'/1.jpg')

The html will be:

<img src='undefined/assets/images/1.jpg'>

Why does the baseurl appear as undefined?

Upvotes: 0

Views: 404

Answers (1)

Deendayal Garg
Deendayal Garg

Reputation: 5148

typo in baserurl. it should be baseurl

Upvotes: 1

Related Questions