gpt4 book ai didi

jekyll - 如何在 Jekyll/Github 页面站点的 config.yml 中的新选项卡中打开 URL?

转载 作者:行者123 更新时间:2023-12-03 14:18:43 25 4
gpt4 key购买 nike

我是自学的/完全不熟悉 Jekyll 和 Github Pages,想知道如何在 config.yml 页面中使用 Markdown 在新选项卡中打开 URL。

This是我正在使用的网站主题。 我希望最后一个“github”链接在新标签页中打开,而不是在当前标签页中打开的默认链接。

_config.yml 看起来像这样:

# # # # # # # # # # # # #
# K i k o - p l u s #
# # # # # # # # # # # # #

# Basic
name: "Kiko Plus"

author:
facebook: your-id
youtubeUser: your-id
youtubeChannel: your-id
twitter: your-id
github: your-id
stackoverflow: your-id
quora: your-id
linkedin: your-id
pinterest: your-id
googlePlus: your-id
instagram: your-id
reddit: your-id
medium: your-id
tumblr: your-id
email: your-id@your-email.com

copyright:
year: 2017
name: Kiko

# Google-analytics
google-analytics:
id: ""

# Disqus
disqus:
id: "kiko-plus"

# URL
url: "https://AWEEKJ.github.io" # the base
hostname & protocol for your site
# url: "http://localhost:4000" # use this url when
you develop
baseurl: "/Kiko-plus" # the subpath of your site


# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: Asia/Seoul
permalink: /:year-:month-:day/:title/

# Pagination
paginate: 5
paginate_path: /page:num/

# Markdown
markdown: kramdown
kramdown:
input: GFM

# Navigation
nav:
- name: "About"
url: "/about"
- name: "Archive"
url: "/archive"
- name: "Tags"
url: "/tags"
- name: "Github"
url: "https://github.com/AWEEKJ/Kiko-plus"

# Sass
sass:
sass_dir: _sass
style: :compressed

# Scopes
defaults:
-
scope:
path: ""
type: "pages"
values:
layout: "page"
-
scope:
path: ""
type: "posts"
values:
layout: "post"

# jekyll-seo-tag,
gems:
- jekyll-seo-tag
- jekyll-paginate
- jekyll-admin

exclude: [vendor]

要在任何基本的 Markdown 帖子中执行此操作,您自然会这样做
[a link](http://example.com){:target="_blank"}

但由于此链接位于站点设置中,因此不起作用。我已经搜索了很多并尝试了 5 或 6 种不同的建议,但都无济于事。

有任何想法吗?将不胜感激!!!!

最佳答案

您需要添加 target="_blank"index.html线路12如下:

 <a href="{{ nav.url }}" target="_blank">{{ nav.name }}</a>

关于jekyll - 如何在 Jekyll/Github 页面站点的 config.yml 中的新选项卡中打开 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45003852/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com