jekyll 博客换行(最小错误)

jekyll blog new line (minimal-mistake)

jekyll blog(minimal-mistakes thema)有一个space自我介绍。

这个space我想分两行写。
例如

hello
world

我知道要编辑此页面,我需要触摸 _config.yml 文件。

# Site Author
author:
  name             : "Choi Young-jin"
  avatar           : "/assets/images/images/avatar.png"

  bio              : "**^^**" <-----------Parts to change

  42 intra ID: yochoi
  location         : "Seoul"
  email            : "amateur.toss@gmail.com"
  links:
    - label: "Email"
      icon: "fas fa-fw fa-envelope-square"
      # url: "amateur.toss@gmail.com"
    - label: "GitHub"
      icon: "fab fa-fw fa-github"
      url: "https://github.com/amateurtoss"

转义字符不起作用。

  bio: "hello\nworld"

如果我想分两行显示字符串怎么办?

嗯,这是降价,所以你应该这样做

  bio: |-
    hello

    world

(这是一个 YAML 块标量,按字面解释并以与 bio 相同或更小的缩进级别的下一项结束)

你当然也可以

  bio: "hello\n\nworld"

但这里发生的事情不太明显。

您可以在 bio 字符串中使用 HTML,因此您可以简单地使用 HTML 换行符:

  bio: "hello<br>world"

以上是我成功实现单行换行的唯一方法。所有其他选项导致两行之间没有换行符或空行。