在 _config.yml 中创建 pdf link 的语法是什么
What is the syntax to create a pdf link in _config.yml
我正在使用 Jekyll 创建个人网站。我正在使用非常流行的Beautiful-Jekyll template。 _config.yml
中已经定义了一个导航栏。我想将 Resume link 制作成我的简历 pdf。
我已经用这段代码完成了(在 _config.yml
):
# List of links in the navigation bar
navbar-links:
Moi: "aboutme"
Projects:
- Hell Game: "http://deanattali.com/beautiful-jekyll/"
- Success City: "http://www.markdowntutorial.com/"
Resume: "Tech Resume.pdf"
但是,这只会在同一选项卡中打开简历。我希望它在单独的选项卡中打开。在 HTML 中,您可以使用 target="_blank"
来实现此目的。我如何在 YAML 中执行此操作?
我试过 但我的 index.html
实际上不使用 link。我知道,很奇怪。
beautiful-jekyll/_includes/nav.html 第 26 行:
<a href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>
改成:
<a href="{{ linkparts[1] | relative_url }}"
{% if linkparts[1] contains '.pdf' %}target="_blank"{% endif %}
>{{ linkparts[0] }}</a>
或使用此 (java)script/solution:
https://jekyllcodex.org/without-plugin/new-window-fix/
我正在使用 Jekyll 创建个人网站。我正在使用非常流行的Beautiful-Jekyll template。 _config.yml
中已经定义了一个导航栏。我想将 Resume link 制作成我的简历 pdf。
我已经用这段代码完成了(在 _config.yml
):
# List of links in the navigation bar
navbar-links:
Moi: "aboutme"
Projects:
- Hell Game: "http://deanattali.com/beautiful-jekyll/"
- Success City: "http://www.markdowntutorial.com/"
Resume: "Tech Resume.pdf"
但是,这只会在同一选项卡中打开简历。我希望它在单独的选项卡中打开。在 HTML 中,您可以使用 target="_blank"
来实现此目的。我如何在 YAML 中执行此操作?
我试过 index.html
实际上不使用 link。我知道,很奇怪。
beautiful-jekyll/_includes/nav.html 第 26 行:
<a href="{{ linkparts[1] | relative_url }}">{{ linkparts[0] }}</a>
改成:
<a href="{{ linkparts[1] | relative_url }}"
{% if linkparts[1] contains '.pdf' %}target="_blank"{% endif %}
>{{ linkparts[0] }}</a>
或使用此 (java)script/solution: https://jekyllcodex.org/without-plugin/new-window-fix/