Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open URLs in new tab in config.yml of Jekyll / Github pages site?

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.

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.

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:      [email protected]

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"}

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!!!!

like image 280
E489D Avatar asked Jul 10 '17 04:07

E489D


1 Answers

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

 <a href="{{ nav.url }}" target="_blank">{{ nav.name }}</a>
like image 166
Abdul Hadi Avatar answered Nov 15 '22 10:11

Abdul Hadi