如何在Jekyll/Github页面站点的config.yml中的新选项卡中打开URL? [英] How to open URLs in new tab in config.yml of Jekyll / Github pages site?

查看:361
本文介绍了如何在Jekyll/Github页面站点的config.yml中的新选项卡中打开URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Jekyll和Github Pages的自学/完全陌生的人,想知道如何在config.yml页面中使用markdown在新选项卡中打开URL.

I'm self-taught/totally new to Jekyll and Github Pages and was wondering how to go about opening a URL in a new tab with markdown in the config.yml page.

是我正在使用的网站主题. 我希望在 new 选项卡中打开最后一个"github"链接,而不是在当前选项卡中打开默认链接.

This is the website theme I'm using. I want the last 'github' link to open in a new tab, instead of the default, which is opening in the current tab.

_config.yml看起来像这样:

The _config.yml looks like this:

# # # # # # # # # # # # #
#   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]

要在任何基本的降价优惠中做到这一点,您自然会这么做

To do this in any basic markdown post, naturally you'd do

[a link](http://example.com){:target="_blank"}

但是由于此链接在网站设置中,所以无法正常工作.我搜索了很多,并尝试了5或6种不同的建议,但无济于事.

But since this link is in the site setup, that doesn't work. I've searched a ton and tried 5 or 6 different recommendations but to no avail.

有什么想法吗?将不胜感激!!!!

Any ideas? Would be uber appreciated!!!!

推荐答案

您需要按如下所示将target="_blank"添加到index.html12:

You need to add target="_blank" to index.html line 12 as follow:

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

这篇关于如何在Jekyll/Github页面站点的config.yml中的新选项卡中打开URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆