Joker / jade

Jade.go - pug template engine for Go (golang)
BSD 3-Clause "New" or "Revised" License
354 stars 37 forks source link

I want to make the Frontend developer use pug in frontend . Then use Joker/jade transtering the pug to tpl for golang . #30

Closed jerryniepan closed 5 years ago

jerryniepan commented 5 years ago

In https://github.com/Joker/jade/blob/master/testdata/v2/attributes.tpl

how to use for golang below?

  1. {{/ url = "https://example.com/" /}} // line 19
  2. <a class="{{ print currentUrl == "/" ? "active" : "" }}" href="/">Home // line 41
jerryniepan commented 5 years ago

I want to make the Frontend developer use pug in frontend . Then use Joker/jade transtering the pug to tpl for golang .

Joker commented 5 years ago

Variables work only in compile to Golang code mode.

In https://github.com/Joker/jade/blob/master/testdata/v2/attributes.go

url = "https://example.com/" // line 30
buffer.WriteString(`<a href="`)
WriteEscString(url, buffer)
buffer.WriteString(`">Another link</a>`)