Closed kaedea closed 9 years ago
I consider not everyone would need this feature. :smiley:
I agree with @h404bi. I think that open an external link in a new tab is the right default behavior. But your script do the job for all links of the page. I don't really understand what do you want exactly? Why do you talk about the sidebar if your script affects all links?
I am not asking to add my script.
I need this feature to open an external link in a new tab. And this script works for me (relative link will not open in new tab). But i think using JS is not better rather than using CSS.
I ask for help how to use css to support this feature
.
Ok, I misunderstood Please consider to add this feature.
...
I guess you want to let those external links such as GitHub
, Twitter
to be opened in a new tab, right? If yes, actually the theme has the implementation, see /layout/partial/sidebar.ejs#L19.
As @h404bi said, the theme has already this behavior for external links in sidebar. Don't really understand what do you want :D
I am using release 1.3.0, setting the following code for external link of my github page. It will not working, opening github in the current tab.
author_links:
github:
title: global.github
url: https://github.com/kaedea
icon: github
# stack_overflow:
# title: global.stack_overflow
# url: http://stackoverflow.com/users
# icon: stack-overflow
# twitter:
# title: global.twitter
# url: https://twitter.com/
# icon: twitter
# facebook:
# title: global.facebook
# url: https://facebook.com/
# icon: facebook
# google_plus:
# title: global.google_plus
# url: https://plus.google.com/
# icon: google-plus
# linked_in:
# title: global.linked_in
# url: https://www.linkedin.com/profile/
# icon: linkedin
mail:
title: global.mail
url: mailto:kidhaibara@gmail.com
icon: envelope-o
Have you tried the original theme(i.e. without change anything), May be you can make a new hexo directory for testing the theme, just use the original theme files. If it works, then you can reconfigure your changes.
You have opened an other issue about 1.3.0 bug about author location and biography but you hadn't the right configuration file from tranquilpeak 1.3.0. Please be sure to have the right version with all files. It works perfectly with.
to LouisBarranqueiro
I did use the release 1.3.0. The issuse about author location and biography I mistaked is becasue the docs of 1.3.0 said that I could configure this in the theme _config.yml.
I will try to download 1.3.0 again and only set the external link in sidebar to make sure whether it work or not.
It works, and just checked 2min ago. :)
Does not work for me.
I download this version.
Just add this link.
hexo version info:
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.1.1"
},
"dependencies": {
"hexo": "^3.1.0",
"hexo-deployer-git": "0.0.4",
"hexo-generator-archive": "^0.1.2",
"hexo-generator-category": "^0.1.2",
"hexo-generator-feed": "^1.0.3",
"hexo-generator-index": "^0.1.2",
"hexo-generator-tag": "^0.1.1",
"hexo-renderer-ejs": "^0.1.0",
"hexo-renderer-marked": "^0.2.4",
"hexo-renderer-stylus": "^0.3.0",
"hexo-server": "^0.1.2"
}
}
look your settings of google chrome
I have used several Browser and get the same problem, using the default setting of the browser.
I look into the html code and found target="_blank"
in the external link in the post area, while found nothing in the link in the sidebar.
in the sidebar
in the post
Do you have target="_blank"
in your sidebar's exteral link?
Strange! :D look this with 1.3.0 built version
Is that possible that the hexo version make these diff?
I don't think so
@kaedea absolutely not, I see you use hexo 3.1.1, me too.
Please try to make a new hexo directory(hexo init test1
) for testing the theme, and see whether it works.
@kaedea sorry for the obvious question, but are you making the edit inside the hexo _config.yaml
or using the other _config.yaml
inside the theme's directory?
Because you need to use the latter. This confused me initially also.
@kaedea is it fixed?
I repeat this in another computer and it works. I am trying to find the diff. Please close this issue. Sorry to offer useless info.
ok good to know :) If you got the answer, write a comment to know what was the problem :)
Now open external links from sidebar will not open in new tab. The setting of HEXO's config.yml works only in post concent. Please consider to add this feature. Me myself use JS to support this in the following code, but I think this is not so good.