Jekyll 在 markdown 中打印 {{
Jekyll print {{ in markdown
我想在降价中打印{{。
这是我想在我的博客中显示的示例 ansible 脚本。
- 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
但是当我在浏览器中渲染时,它显示
- 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
如果您看到了,则该名称不是用 {{ user }} 打印的,而只是用“”打印的。有没有办法打印 {{ }} ?
您是说在代码块中?是的,确实如此。
"{% raw %} {{ user}} {% endraw %}"
应该完成这项工作。
希望对您有所帮助! :)
我想在降价中打印{{。
这是我想在我的博客中显示的示例 ansible 脚本。
- 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
但是当我在浏览器中渲染时,它显示
- 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
如果您看到了,则该名称不是用 {{ user }} 打印的,而只是用“”打印的。有没有办法打印 {{ }} ?
您是说在代码块中?是的,确实如此。
"{% raw %} {{ user}} {% endraw %}"
应该完成这项工作。
希望对您有所帮助! :)