Jekyll print {{ in markdown

310 Views Asked by At

I want to print {{ in markdown.

This is a sample ansible script that I want to display in my blog.

- hosts: all
  remote_user: ubuntu
  become: True
  become_method: sudo
  become_user: root

  tasks:
    - name: Add user
      user:
          name="{{ user }}"
          shell=/bin/bash
          state=present
          groups=staff
          append=yes
          createhome=yes

But when I render in browser, it shows

- hosts: all
  remote_user: ubuntu
  become: True
  become_method: sudo
  become_user: root

  tasks:
    - name: Add user
      user:
          name=""
          shell=/bin/bash
          state=present
          groups=staff
          append=yes
          createhome=yes

If you see that, the name is not printing with {{ user }} but just "". Is there a way to print {{ }} ?

1

There are 1 best solutions below

1
Virtua Creative On BEST ANSWER

In a code block, you mean? Yes, it does.

"{% raw %} {{ user}} {% endraw %}"

Should do the job.

Hope to have helped! :)