Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

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

Solved by Taylor Ren View solution

Started by Taylor Ren 6 years ago · 1 replies · 681 views
6 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
6 years ago Solution

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

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 82 12 hours ago
General · by pamtbaau, 17 hours ago
1 55 16 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 348 5 days ago
General · by Duc , 5 days ago
3 43 5 days ago