如何在 Jekyll / Github 页面站点的 config.yml 中的新选项卡中打开 URL?
How to open URLs in new tab in config.yml of Jekyll / Github pages site?
我是 self-taught/totally Jekyll 和 Github 页面的新手,想知道如何在 config.yml 中使用降价在新标签页中打开 URL页。
This 是我使用的网站主题。 我希望最后一个 'github' link 在 新 选项卡中打开,而不是在当前选项卡中打开的默认设置。
_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
Whosebug: 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]
要在任何基本降价中做到这一点 post,您自然会这样做
[a link](http://example.com){:target="_blank"}
但是由于此 link 在站点设置中,所以它不起作用。我搜索了大量内容并尝试了 5 或 6 种不同的建议,但无济于事。
有什么想法吗?将不胜感激!!!!
您需要将 target="_blank"
添加到 index.html
行 12
,如下所示:
<a href="{{ nav.url }}" target="_blank">{{ nav.name }}</a>
这是我在尝试解决同一问题时发现的最高 Google 结果之一。
我发现一个插件可以自动设置任何外部 url 在新标签页中打开:
我是 self-taught/totally Jekyll 和 Github 页面的新手,想知道如何在 config.yml 中使用降价在新标签页中打开 URL页。
This 是我使用的网站主题。 我希望最后一个 'github' link 在 新 选项卡中打开,而不是在当前选项卡中打开的默认设置。
_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
Whosebug: 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]
要在任何基本降价中做到这一点 post,您自然会这样做
[a link](http://example.com){:target="_blank"}
但是由于此 link 在站点设置中,所以它不起作用。我搜索了大量内容并尝试了 5 或 6 种不同的建议,但无济于事。
有什么想法吗?将不胜感激!!!!
您需要将 target="_blank"
添加到 index.html
行 12
,如下所示:
<a href="{{ nav.url }}" target="_blank">{{ nav.name }}</a>
这是我在尝试解决同一问题时发现的最高 Google 结果之一。 我发现一个插件可以自动设置任何外部 url 在新标签页中打开: