如何在 Hugo 中写一个段落?

发布于 2025-01-14 03:47:49 字数 464 浏览 3 评论 0 原文

我和 Hugo 建立了一个网站。在config.toml中,有几行如下:

[params]
    name = "My name"
    description = "Blog Description"
    bio = "Data Analyst at [@X](https://www.x.com/)" 

现在,我想在我的博客bio中再添加一行,如下所示:

[params]
    name = "My name"
    description = "Blog Description"
    bio = "Data Analyst at [@X](https://www.x.com/)" 
    "previously at [@Y](https://www.y.com/)" 

但是,它没有显示出来。我在这里做错了什么?带有 p 的 HTML 代码也不起作用。

I've built a website with Hugo. In the config.toml, there are a few lines as below:

[params]
    name = "My name"
    description = "Blog Description"
    bio = "Data Analyst at [@X](https://www.x.com/)" 

Now, I'd like to add one more to my blog in bio like this:

[params]
    name = "My name"
    description = "Blog Description"
    bio = "Data Analyst at [@X](https://www.x.com/)" 
    "previously at [@Y](https://www.y.com/)" 

However, it does not come out. What am I making wrong here? HTML code with p did not work as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ι不睡觉的鱼゛ 2025-01-21 03:47:49
bio = "Data Analyst at [@X](https://www.x.com/) <br /> previously at [@Y](https://www.y.com/)"

如果

或您决定放置的任何内容呈现为 " 等等。然后无论 site.Params.bio 或 .Site.Params.bio 位于何处(在布局等中),添加
“| safeHTML”即{{ .site.Params.bio | safeHTML }}

或者只是要求主题维护者添加您想要的任何内容。

注意:您可以在您希望输出的任何模板中添加一个新位,
example

bio = "Data Analyst at [@X](https://www.x.com/)"   
more_bio = "previously at [@Y](https://www.y.com/)" 

{{ .Site.Params.more_bio }} <- 将其放在您想要输出的任何位置(以任何布局)

等...

https://gohugo.io/variables/site/

bio = "Data Analyst at [@X](https://www.x.com/) <br /> previously at [@Y](https://www.y.com/)"

if the <br /> or <p> or whatever you decide to put there renders as "<br..." etc. Then wherever site.Params.bio or .Site.Params.bio is (in the layouts etc), add
"| safeHTML" i.e. {{ .site.Params.bio | safeHTML }}

Or just ask the theme maintainer to add whatever you want.

Note: You could just add a new bit in whatever template you wish to output this,
example

bio = "Data Analyst at [@X](https://www.x.com/)"   
more_bio = "previously at [@Y](https://www.y.com/)" 

{{ .Site.Params.more_bio }} <- put that wherever you want it to output (in whatever layout)

Etc...

https://gohugo.io/variables/site/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文