Questions tagged [pyjade]

Jade syntax adapter for Django, Jinja2 and Mako templates

PyJade is a high performance template preprocessor, that converts any .jade source to the each Template-language (Django, Jinja2 or Mako).

35 questions
1
vote
1 answer

pyjade and ternary conditional failing?

I'm diving into Jade for the first time using PyJade so that I can use it within Flask (and Jinja2). So far everything seems to be working and compiling correctly, though I'm wondering if this is a bug in PyJade's translation? I'm unable to inject…
Scott
  • 3,204
  • 3
  • 31
  • 41
1
vote
1 answer

Access Flask context variables from included or imported Jade templates?

I'm using flask with pyjade for templating. I can access context variables within templates directly, and even in inherited templates, but not when I include mixins or try to import mixins from another template. Here's the example: My Flask…
maackle
  • 2,074
  • 2
  • 15
  • 27
1
vote
1 answer

pyjade radio inputs text not showing

I'm learning about pyjade and I'm having trouble with the inputs type radio. I can't render the text of the radio my code: .radio label …
Alejandro
  • 1,159
  • 3
  • 16
  • 30
1
vote
3 answers

pyjade on gae cannot concatenate 'str' and 'long' objects

The below pyjade code causes an internal server error. When the #{module.key} is taken outside the href it works fine. Any ideas? table // the table isn't working perfectly but leo is making responsive // anyway, will merge that version …
Gobi Dasu
  • 459
  • 1
  • 6
  • 22
1
vote
1 answer

How to combine Django with Jade

I'm trying to combine Django with Jade, but I've had some problems. I have model which is named About. This has a view like this: def about(request): return render_to_response('about.jade',{},RequestContext(request)) and in my urls I…
bcap
  • 500
  • 5
  • 14
1
vote
1 answer

Interpolate Jade and Python dictionary

Given a jade template and a dictionary, how can I use the dictionary to populate the jade template? For example, >>> data = { ... 'name': "World", ... 'ages': [10, 20, 30] ... } >>> template = """ ... html ... body ... h1 "Hello,…
duckworthd
  • 14,679
  • 16
  • 53
  • 68
1
vote
1 answer

Error importing template source loader pyjade.ext.django.Loader

Jade is a great template.I wanna use it in Django and I found Pyjade. I follow the example code but I got error when I run the project. In Django Debug Mode , Django told me : ImproperlyConfigured at / Error importing template source loader…
CashLee李秉骏
  • 1,038
  • 1
  • 10
  • 23
0
votes
1 answer

Django + Pug(Jade) - how to pass object to mixin?

I installed pypugjs, added it to settings.py, it works fine, but when I'm trying to pass object to Pug mixin - I got a TemplateSyntaxError - Could not parse the remainder: '{age:20' from '{age:20' mixin card(data) div…
0
votes
1 answer

Pug & Django: reverse URL + variable inline?

Desired output: You're currently following xx artists Assuming I'm using Pug in a Django template, how would I achieve that if I don't want to hardcode the URL (which I have named as artists in my URL), and if the artist count is also a…
zerohedge
  • 3,185
  • 4
  • 28
  • 63
0
votes
1 answer

Jade script: check if variable exists

I want to optionally pass variables to my jade template, with pyjade==4.0.0, with some JavaScript to return defined variables (to locals().pageargs): script(type='text/javascript'). console.log("#{item_id}"); Which works perfect when item_id is…
Joost Döbken
  • 3,450
  • 2
  • 35
  • 79
0
votes
1 answer

Iterate Jekyll Posts using Pug

I'm new to using pug, what I want to accomplish basically is convert this to pug code.

Blog Posts

    {% for post in site.posts %}
  • {{ post.date | date_to_string }}
juscuizon
  • 51
  • 1
  • 9
0
votes
1 answer

{{ }} is not getting parsed by pyjade as expected with django

I have line of pyjade a.js-track(data-track-data="{\"Job ID\":\"{{ job_details|get_or_na:'id' }}\",\"Job Title\":\"{{ job_details|get_or_na:'title' }}\",\"Company Name\":\"{{ job_details|get_or_na:'organization'|get_or_na:'name' }}\"}",…
Himanshu Pandey
  • 726
  • 5
  • 13
0
votes
1 answer

Not able to add json data to data-attribute in pyjade

a(data-track-dynamic-attrs='["Page","Stakeholder"]') Download App This is the line in jade. Here for data-track-dynamic-attrs I have to add json data. I expect to be the generated html so…
Himanshu Pandey
  • 726
  • 5
  • 13
0
votes
1 answer

How to use pyjade as part of clientside and serverside application?

I'm creating a single page application using flask. If I understand the process correctly, then ill be having flask serve up a single page (html and css) upon the first GET request. From their, the client will only receive data and the it will use…
Drew Verlee
  • 1,880
  • 5
  • 21
  • 30
0
votes
2 answers

Example of configuring Flask + AngularJS + PyJade (or other alternative to Jinja)

I am new to Flask and building a web app that uses Flask and AngularJS. My understanding is that the static directory is the place to store AngularJS files like javascript and templates. I wonder if there is a stable alternative to Html/Jinja that…
kpax
  • 621
  • 1
  • 8
  • 18