我是自学成才/对 Jekyll 和 Github Pages 完全陌生,并且想知道如何在 config.yml 页面中使用 markdown 在新选项卡中打开 URL。
This https://aweekj.github.io/Kiko-plus/是我正在使用的网站主题。我希望最后一个“github”链接在new选项卡,而不是在当前选项卡中打开的默认选项卡。
_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: [email protected] /cdn-cgi/l/email-protection
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 个不同的建议,但均无济于事。
有任何想法吗?将不胜感激!
我发现一个插件可以自动设置任何外部 URL 以在新选项卡中打开:
https://rubygems.org/gems/jekyll-target-blank https://rubygems.org/gems/jekyll-target-blank
将以下内容添加到您网站的 Gemfile
gem 'jekyll-target-blank'
并将以下内容添加到您的网站
_config.yml
plugins:
- jekyll-target-blank
您可能还需要运行bundle install
安装新的 Gem
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)