Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

How to output "{{.....}}" in Grav

Solved by Taylor Ren View solution

Started by Taylor Ren 7 years ago · 1 replies · 977 views
7 years ago

Hi all,

I am writing somthing on Vue.js. As you know, in Vue.js, it uses {{...}} syntax commonly.

So when I am quoting these codes in my Grav site, I shall quote these Vue syntax:

HTML
<div>
  <p class="mid">
    <router-link class="yellow shadow" :to="{name: 'BookDetail', params: {id: book.bookid} }">
      {{book.title}}
    </router-link>
  </p>
</div>
<div><p className="s18">{{this.book.author}}</p></div>
<div><p className="s18">{{this.book.p_name}}</p></div>
<div><p className="small"><em>收录时间:{{this.book.purchdate}}</em></p></div>

But it seems that in the above code snippet, "{{...}}" has been parsed by Twig template.

How to lieterally print {{this.book.author}}? Thanks for your help?

👍 1
7 years ago Solution

I have found the solution: use {% verbatim %}...{% endverbatim %} block.

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Hanns Mattes, 6 days ago
0 93 6 days ago
General · by Dima, 2 weeks ago
1 121 2 weeks ago
General · by pamtbaau, 2 weeks ago
0 192 2 weeks ago
General · by lynbor, 2 months ago
5 701 4 weeks ago
General · by Andy Miller, 1 month ago
0 425 1 month ago